Skip to content

Commit

Permalink
Merge pull request #39 from python-project-templates/tkp/admon
Browse files Browse the repository at this point in the history
Use myst-md for admonishments to stay in markdown syntax
  • Loading branch information
timkpaine authored Dec 12, 2024
2 parents 24a807e + a151459 commit ff244e6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/src/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ graph TD
GitHub admonitions are automatically translated to sphinx.

> [!NOTE]
> Note content
> Note `markdown` content
> [!TIP]
> Tip content
Expand Down
4 changes: 2 additions & 2 deletions yardang/conf.py.j2
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ def run_convert_github_admonitions_to_rst(app, filename, lines):
# look for admonition key
for admonition_key in _GITHUB_ADMONITIONS:
if admonition_key in line:
line = line.replace(admonition_key, "\n```{}\n.. {}::\n".format("{eval-rst}", _GITHUB_ADMONITIONS[admonition_key]))
line = line.replace(admonition_key, ":::{" + _GITHUB_ADMONITIONS[admonition_key] + "}\n")
# start replacing quotes in subsequent lines
replacing = True
break
Expand All @@ -180,7 +180,7 @@ def run_convert_github_admonitions_to_rst(app, filename, lines):
line = line.replace("> ", " ")
elif replacing:
# missing "> ", so stop replacing and terminate directive
line = f"\n```\n{line}"
line = f"\n:::\n{line}"
replacing = False
# swap line back in splits
orig_line_splits[j] = line
Expand Down

0 comments on commit ff244e6

Please sign in to comment.