-
Hi there, I would like to talk about cross reference in Marp. At first, we can jump to the slide that we want to go to with like section a.cref {
display: block;
position: absolute;
top: 0px;
left: 0px;
z-index: auto;
} And it works very good as I expected with this. ---
# Subject of the page <a class="cref" id="thepage"></a>
...
[Go to The Page](#thepage) But I feel it's not beautiful because the tag is occupied on the document and it's not related to the actual content of the document. Generally, we all who write any markups should not think about the shape and how tags should be used, and we all should focus on the content itself. If we follow that principle, we have to make it more smart. So I have some questions.
Cheers. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
See also: https://github.com/orgs/marp-team/discussions/161#discussioncomment-5627844 In Markdown documents, it's common to use automatically generated anchors from the heading content to jump to specific headings. In Marp as well, you can use such anchors without having to write HTML and CSS: # Subject of the page
---
[Go to the page](#subject-of-the-page) You can reference the page that including the specified heading by the link. In addition, it's also possible to suggest the anchor names generated from the headings by using VS Code. (This feature is provided by the Markdown Language Server in VS Code, not Marp for VS Code extension) This approach is smart enough to eliminate the need for using The Marp Markdown format also places importance on cross-compatibility with other Markdown processors. Adding the directive like |
Beta Was this translation helpful? Give feedback.
That cannot reproduce at least for me. The simple case like
[リンク](#リンク)
is working well in VS Code preview, the exported HTML, and PDF.video.mov
That should not be a problem because the slide would be presented one by one pages when doing the actual presentation by PDF/HTML. (See above video)