Skip to content

Commit

Permalink
Fix find of end comment block
Browse files Browse the repository at this point in the history
Signed-off-by: Sara Damiano <[email protected]>
  • Loading branch information
SRGDamia1 committed Aug 15, 2024
1 parent 01dc62d commit 289df32
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 6 deletions.
24 changes: 19 additions & 5 deletions docs/documentExamples.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,24 +63,38 @@
print(f"\nCurrent example: {filename}")
with open(filename, "r") as in_file: # open in readonly mode
i = 1
lines_copied = 0
got_start_comment = False
got_example_nav = False
got_footer_nav = False
lines = in_file.readlines()
for line in lines:
if i < 3 and line.startswith("/**"):
got_start_comment = True
print(f" First line of doc block: {i}")
if got_start_comment and (
line.startswith("*/") or line.startswith(" */")
):
if got_start_comment and "@m_examplenavigation" in line:
got_example_nav = True
print(f" Got example nav command in line: {i}")
if got_start_comment and "@m_footernavigation" in line:
got_footer_nav = True
print(f" Got footer nav command in line: {i}")
if got_start_comment and "*/" in line:
out_file.write(" *\n")
out_file.write(" * @m_examplenavigation{examples_page,}\n")
out_file.write(" * @m_footernavigation\n")
if not got_example_nav:
out_file.write(" * @m_examplenavigation{examples_page,}\n")
if not got_footer_nav:
out_file.write(" * @m_footernavigation\n")
out_file.write(line)
print(f" Last line of doc block: {i}")
got_start_comment = False
got_example_nav = False
got_footer_nav = False
if got_start_comment:
out_file.write(line)
lines_copied += 1
i += 1
if lines_copied == 0:
print(f" No doc block detected in file")

out_file.write("\n\n")

Expand Down
3 changes: 2 additions & 1 deletion docs/runDoxygen.bat
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ set PLATFORMIO_GLOBALLIB_DIR=../.pio/libdeps/mayfly
set PLATFORMIO_PACKAGES_DIR=C:/Users/sdamiano/.platformio/PLATFORMIO_PACKAGES_DIR

echo Generating Doxygen code documentation...
"C:\Program Files\doxygen\bin\doxygen.exe" -d filteroutput -d commentcnv -d markdown Doxyfile > output_doxygen_run.log 2>&1
"C:\Program Files\doxygen\bin\doxygen.exe" Doxyfile > output_doxygen_run.log 2>&1
@REM "C:\Program Files\doxygen\bin\doxygen.exe" -d filteroutput -d commentcnv -d markdown Doxyfile > output_doxygen_run.log 2>&1
endlocal

@REM Fix up xml sections before running m.css
Expand Down

0 comments on commit 289df32

Please sign in to comment.