-
Notifications
You must be signed in to change notification settings - Fork 189
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
馃憣 IMPROVE: Add
myst_heading_slug_func
option (#359)
For specifying a custom function to auto-generate heading anchors
- Loading branch information
1 parent
15ff74e
commit a39d236
Showing
9 changed files
with
94 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
from docutils.nodes import make_id | ||
|
||
extensions = ["myst_parser"] | ||
exclude_patterns = ["_build"] | ||
myst_heading_anchors = 2 | ||
myst_heading_slug_func = make_id |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Hyphen - 1 | ||
|
||
## Dot 1.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
tests/test_sphinx/test_sphinx_builds/test_heading_slug_func.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<div class="documentwrapper"> | ||
<div class="bodywrapper"> | ||
<div class="body" role="main"> | ||
<section id="hyphen-1"> | ||
<h1> | ||
Hyphen - 1 | ||
<a class="headerlink" href="#hyphen-1" title="Permalink to this headline"> | ||
露 | ||
</a> | ||
</h1> | ||
<section id="dot-1-1"> | ||
<h2> | ||
Dot 1.1 | ||
<a class="headerlink" href="#dot-1-1" title="Permalink to this headline"> | ||
露 | ||
</a> | ||
</h2> | ||
</section> | ||
</section> | ||
</div> | ||
</div> | ||
</div> |
7 changes: 7 additions & 0 deletions
7
tests/test_sphinx/test_sphinx_builds/test_heading_slug_func.resolved.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<document source="index.md"> | ||
<section ids="hyphen-1" myst-anchor="index.md#hyphen-1" names="hyphen\ -\ 1"> | ||
<title> | ||
Hyphen - 1 | ||
<section ids="dot-1-1" myst-anchor="index.md#dot-1-1" names="dot\ 1.1"> | ||
<title> | ||
Dot 1.1 |
7 changes: 7 additions & 0 deletions
7
tests/test_sphinx/test_sphinx_builds/test_heading_slug_func.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<document source="index.md"> | ||
<section ids="hyphen-1" myst-anchor="index.md#hyphen-1" names="hyphen\ -\ 1"> | ||
<title> | ||
Hyphen - 1 | ||
<section ids="dot-1-1" myst-anchor="index.md#dot-1-1" names="dot\ 1.1"> | ||
<title> | ||
Dot 1.1 |