Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/cfg/Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -1107,7 +1107,7 @@ INPUT_FILTER =
# need to set EXTENSION_MAPPING for the extension otherwise the files are not
# properly processed by doxygen.

FILTER_PATTERNS =
FILTER_PATTERNS = *.md="python3 docs/scripts/doxygen_filter.py"

# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
# INPUT_FILTER) will also be used to filter the input files that are used for
Expand Down
30 changes: 30 additions & 0 deletions docs/scripts/doxygen_filter.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/usr/bin/env python3
"""
Doxygen filter to clean markdown for documentation:
- Remove 'test' from code blocks: ```cpp test -> ```cpp
- Remove HIDE: lines
"""

import sys
import re

# Read input file
with open(sys.argv[1], 'r') as f:
content = f.read()

# Process each line
filtered_lines = []
for line in content.split('\n'):
# Remove 'test' attribute from code blocks
if re.match(r'^```(\w+)\s+test\s*$', line):
language = re.match(r'^```(\w+)', line).group(1)
filtered_lines.append(f'```{language}')
# Skip HIDE: lines
elif re.match(r'^\s*HIDE:', line):
continue
# Keep all other lines
else:
filtered_lines.append(line)

# Output filtered content
print('\n'.join(filtered_lines), end='')
Loading