Skip to content

Enhancement request: Link to a specific heading in a document #20

Closed
@JenniBeadle

Description

@JenniBeadle

At present links to documents are supported but only to the whole document. It would be nice to link to a specific heading either in the same document or another document.

How to do it in Docusaurus
Docusaurus allows this by adding a code to the (destination) heading {#...} and then including that code in the link.
For example, see https://manual.paratext.org/Training-Manual/Stage-1/OD

In chapter 2 under 2.3 Create a new text layout I have a link to section 2.5
... ≡ Paratext menu, under (Paratext > Open, select several resources, choose to open as Text collection. See [2.5]

Heading 2.5 is coded as:
### 2.5 Open resources in a Text collection {#25}
The link is coded as:
See [2.5] (/Training-Manual/02-Stage-1/2.OD.md#25)
(the link is broken to display the coding)

Note: I have the code without decimal points otherwise it didn't work reliably.

Docusaurus documentation
see https://docusaurus.io/docs/markdown-features/toc#example-subsubsection-1-a-ii for a discussion on setting an explicit heading id.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions