Skip to content

Commit ff244e6

Browse files
authored
Merge pull request #39 from python-project-templates/tkp/admon
Use myst-md for admonishments to stay in markdown syntax
2 parents 24a807e + a151459 commit ff244e6

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

docs/src/configuration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ graph TD
235235
GitHub admonitions are automatically translated to sphinx.
236236

237237
> [!NOTE]
238-
> Note content
238+
> Note `markdown` content
239239
240240
> [!TIP]
241241
> Tip content

yardang/conf.py.j2

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ def run_convert_github_admonitions_to_rst(app, filename, lines):
170170
# look for admonition key
171171
for admonition_key in _GITHUB_ADMONITIONS:
172172
if admonition_key in line:
173-
line = line.replace(admonition_key, "\n```{}\n.. {}::\n".format("{eval-rst}", _GITHUB_ADMONITIONS[admonition_key]))
173+
line = line.replace(admonition_key, ":::{" + _GITHUB_ADMONITIONS[admonition_key] + "}\n")
174174
# start replacing quotes in subsequent lines
175175
replacing = True
176176
break
@@ -180,7 +180,7 @@ def run_convert_github_admonitions_to_rst(app, filename, lines):
180180
line = line.replace("> ", " ")
181181
elif replacing:
182182
# missing "> ", so stop replacing and terminate directive
183-
line = f"\n```\n{line}"
183+
line = f"\n:::\n{line}"
184184
replacing = False
185185
# swap line back in splits
186186
orig_line_splits[j] = line

0 commit comments

Comments
 (0)