Skip to content

Commit

Permalink
fix formules in doxygen markdown
Browse files Browse the repository at this point in the history
  • Loading branch information
matekelemen committed Aug 7, 2024
1 parent cafb856 commit 42f1689
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions docs/prepareDocs.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,19 @@

docLinkPattern = re.compile(r"\[mcgs::(\w+)\]\(([\w0-9\.#]+)\)")
docLinkReplace = r"[mcgs::\1](" + docPath + r"\2)"

assetLinkPattern = re.compile(r"\.github/assets/")
assetLinkReplace = assetPath

formulaPattern = re.compile(r"\$(.*)\$")
formulaReplace = r"@f$\1@f$"

readme = ""
with open(pathlib.Path(__file__).absolute().parent.parent / "readme.md", "r") as inputFile:
readme = inputFile.read()

for pattern, replace in ((docLinkPattern, docLinkReplace), (assetLinkPattern, assetLinkReplace), (formulaPattern, formulaReplace)):
readme = re.sub(pattern, replace, readme)

with open(pathlib.Path(__file__).parent / "readme.md", "w") as outputFile:
outputFile.write(re.sub(assetLinkPattern,
assetLinkReplace,
re.sub(docLinkPattern,
docLinkReplace,
readme)))
outputFile.write(readme)

0 comments on commit 42f1689

Please sign in to comment.