You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,8 @@ Full Changelog: [v0.16.1...v0.17.0](https://github.com/executablebooks/MyST-Pars
8
8
9
9
### ‼️ Markdown link resolution improvements
10
10
11
+
**WARNING: This is a breaking change for links that rely on auto-generated anchor links**. You should now [manually enable auto-generated anchor links](https://myst-parser.readthedocs.io/en/latest/syntax/optional.html?highlight=anchor#auto-generated-header-anchors) if you see errors like `WARNING reference target not found`.
12
+
11
13
Markdown links are of the format `[text](link)`.
12
14
MyST-Parser looks to smartly resolve such links, by identifying if they are:
13
15
@@ -30,6 +32,8 @@ See [Markdown Links and Referencing](docs/syntax/syntax.md#markdown-links-and-re
30
32
31
33
### ‼️ Dollarmath is now disabled by default
32
34
35
+
**WARNING: This is a breaking change for dollar math**. You should now manually enable dollar math (see below).
36
+
33
37
The default configuration is now `myst_enable_extensions=()`, instead of `myst_enable_extensions=("dollarmath",)`.
34
38
If you are using math enclosed in `$` or `$$` in your documents, you should enable `dollarmath` explicitly.
Copy file name to clipboardExpand all lines: docs/syntax/optional.md
+30-11Lines changed: 30 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -489,12 +489,36 @@ Also see [](syntax/html-admonition).
489
489
490
490
## Auto-generated header anchors
491
491
492
-
A common, extended Markdown syntax is to use header bookmark links, locally; `[](#header-anchor)`, or cross-file `[](path/to/file.md#header-anchor)`.
493
-
To achieve this, section headings must be assigned anchors, which can be achieved in `myst-parser`,
494
-
by setting `myst_heading_anchors = 2` in your `conf.py`.
495
-
This configures heading anchors to be assigned to both `h1` and `h2` level headings.
496
-
The anchor "slugs" created aim to follow the [GitHub implementation](https://github.com/Flet/github-slugger); lower-case text, removing punctuation, replacing spaces with `-`, uniqueness *via* suffix enumeration `-1`.
497
-
To change the slug function, set `myst_heading_slug_func` in your `conf.py` to a function that accepts a string and returns a string.
492
+
The MyST Parser can automatically generate label "slugs" for header anchors so that you can reference them from markdown links.
493
+
For example, you can use header bookmark links, locally; `[](#header-anchor)`, or cross-file `[](path/to/file.md#header-anchor)`.
494
+
To achieve this, use the `myst_heading_anchors = DEPTH` configuration option, where `DEPTH` is the depth of header levels for which you wish to generate links.
495
+
496
+
For example, the following configuration in `conf.py` tells the `myst_parser` to generate labels for heading anchors for `h1`, `h2`, and `h3` level headings (corresponding to `#`, `##`, and `###` in markdown).
497
+
498
+
```python
499
+
myst_heading_anchors =3
500
+
```
501
+
502
+
You can then insert markdown links directly to anchors that are generated from your header titles in your documentation.
503
+
For example `[](#auto-generated-header-anchors)`: [](#auto-generated-header-anchors).
504
+
505
+
The paths to other files should be relative to the current file, for example
0 commit comments