-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(typst): support semantic link jump (#42)
* feat: create semantic label for headings * dev: add helper function to make heading ref * feat: support semantic link jump * docs: update supports secion * docs: update todo list
- Loading branch information
1 parent
c3efa80
commit 4dedb52
Showing
15 changed files
with
274 additions
and
31 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
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,12 @@ | ||
#import "/github-pages/docs/book.typ": book-page | ||
|
||
#show: book-page.with(title: "Typst Supports") | ||
|
||
In this section you will learn how to: | ||
|
||
- Make a cross reference in the same page or to other pages. | ||
- Embed HTML elements into the pages: | ||
- `html-ext.iframe` corresponds to a ```html <iframe/>``` element | ||
- Specifically, embed multimedia elements: | ||
- `html-ext.video` corresponds to a ```html <video/>``` element | ||
- `html-ext.audio` corresponds to a ```html <audio/>``` element |
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,23 @@ | ||
#import "/github-pages/docs/book.typ": book-page | ||
|
||
#show: book-page.with(title: "Typst Supports - Cross Reference in other pages") | ||
|
||
= Sample page for cross reference in other pages | ||
|
||
#lorem(50) | ||
|
||
== Subsection | ||
|
||
#lorem(50) | ||
|
||
== -sub option | ||
|
||
#lorem(50) | ||
|
||
== A sentence... | ||
|
||
#lorem(50) | ||
|
||
== Math equation $f = lambda x . x$ in heading | ||
|
||
#lorem(50) |
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,17 @@ | ||
#import "/github-pages/docs/book.typ": book-page, cross-link, heading-reference | ||
|
||
#show: book-page.with(title: "Typst Supports - Cross Reference") | ||
|
||
// begin of sample | ||
#let p = "/format/supports/cross-ref-sample.typ" | ||
- #cross-link(p)[cross reference to the sample page] | ||
#let sub = heading-reference[== Subsection] | ||
- #cross-link(p, reference: sub)[cross reference to ```typ == Subsection``` in the sample page] | ||
#let ref-head = "== Math equation $f = lambda x . x$ in heading" | ||
#let sub = heading-reference(eval(ref-head, mode: "markup")) | ||
- #cross-link(p, reference: sub)[cross reference to #raw(lang: "typ", ref-head) in the sample page] | ||
// end of sample | ||
|
||
== List of Code | ||
|
||
#raw(lang: "typ", read("cross-ref.typ").find(regex("// begin of sample[\s\S]*?// end of sample")).replace("\r", "").slice(18, -16).trim(), block: true) |
Oops, something went wrong.