Created
March 27, 2026 19:58
-
-
Save notmayo/7d90b4eec12f79fd758261a99c1a02ea to your computer and use it in GitHub Desktop.
Confluence HTML export - Find all macros used in pages
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| grep -I -o '<[^>]*macro[^>]*>' ./*.html \ | |
| | grep -Fv 'src=confmacro' \ | |
| | awk ' | |
| { | |
| tag=$0 | |
| out=tag | |
| if (match(tag, /class="[^"]*macro[^"]*"/)) { | |
| out=substr(tag, RSTART+7, RLENGTH-8) | |
| } else if (match(tag, /class='\''[^'\'']*macro[^'\'']*'\''/)) { | |
| out=substr(tag, RSTART+7, RLENGTH-8) | |
| } else if (match(tag, /aria-label="[^"]*"/)) { | |
| out=substr(tag, RSTART+12, RLENGTH-13) | |
| } else if (match(tag, /[[:alnum:]_-]*macro[[:alnum:]_-]*/)) { | |
| out=substr(tag, RSTART, RLENGTH) | |
| } | |
| gsub(/rbtoc[0-9]+/, "rbtoc", out) | |
| if (!seen[out]++) print out | |
| }' | sort |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment