grep — AsciiDoc
Document Structure
Document title (Level 1)
grep -n '^= ' file.adoc
All headers (outline)
grep -nE '^={1,5} ' file.adoc
Headers containing keyword across all pages
grep -n '^={2,4}.*deploy' docs/**/*.adoc
Document attributes
grep -nE '^:[a-z]' file.adoc
Antora attributes (4-space indent in antora.yml)
grep -E '^ [a-z]' antora.yml
Attribute usage in a file
grep -n '{[a-z][a-z0-9-]*}' file.adoc
Extract unique attributes used
grep -oE '\{[a-z][a-z0-9-]*\}' file.adoc | sort -u
Linting and Validation
Find unescaped pipes in tables (build error prevention)
grep -nP '^\|.*`[^`]*(?<!\\)\|[^`]*`' docs/modules/ROOT/**/*.adoc
# Real catch: | `[object] | Get-Member` → should be | `[object] \| Get-Member`
Find hardcoded IPs (STD-019 violation)
grep -rnP '\b10\.50\.\d+\.\d+\b' --include='*.adoc' docs/modules/ROOT/pages/
Find inline TOC violations (STD-004)
grep -rnP '^:toc:' --include='*.adoc' docs/
Find missing description headers
grep -rLP ':description:' --include='*.adoc' docs/modules/ROOT/pages/
Verify xref fix — negative lookbehind excludes escaped instances
grep -rnP '(?<!\\)\{search_id\}' --include='*.adoc' docs/modules/ROOT/
# Returns nothing = all escaped
Find broken xrefs after directory rename
grep -rnP 'xref:codex/cli/' --include='*.adoc' docs/modules/ROOT/