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: docs/en/guide/markdown.md
+47
Original file line number
Diff line number
Diff line change
@@ -897,6 +897,53 @@ You can also use a [VS Code region](https://code.visualstudio.com/docs/editor/co
897
897
Note that this does not throw errors if your file is not present. Hence, when using this feature make sure that the contents are being rendered as expected.
898
898
:::
899
899
900
+
Instead of VS Code regions, you can also use header anchors to include a specific section of the file. For example, if you have a header in your markdown file like this:
901
+
902
+
```md
903
+
## My Base Section
904
+
905
+
Some content here.
906
+
907
+
### My Sub Section
908
+
909
+
Some more content here.
910
+
911
+
## Another Section
912
+
913
+
Content outside `My Base Section`.
914
+
```
915
+
916
+
You can include the `My Base Section` section like this:
Here, `my-base-section` is the generated id of the heading element. In case it's not easily guessable, you can open the part file in your browser and click on the heading anchor (`#` symbol left to the heading when hovered) to see the id in the URL bar. Or use browser dev tools to inspect the element. Alternatively, you can also specify the id to the part file like this:
936
+
937
+
```md
938
+
## My Base Section {#custom-id}
939
+
```
940
+
941
+
and include it like this:
942
+
943
+
```md
944
+
<!--@include: ./parts/basics.md#custom-id-->
945
+
```
946
+
900
947
## Math Equations
901
948
902
949
This is currently opt-in. To enable it, you need to install `markdown-it-mathjax3` and set `markdown.math` to `true` in your config file:
0 commit comments