docs: add typlite docs (#1828)
Some checks failed
tinymist::ci / Duplicate Actions Detection (push) Has been cancelled
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Has been cancelled
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Has been cancelled
tinymist::ci / prepare-build (push) Has been cancelled
tinymist::gh_pages / build-gh-pages (push) Has been cancelled
tinymist::ci / E2E Tests (darwin-arm64 on macos-latest) (push) Has been cancelled
tinymist::ci / E2E Tests (linux-x64 on ubuntu-22.04) (push) Has been cancelled
tinymist::ci / E2E Tests (linux-x64 on ubuntu-latest) (push) Has been cancelled
tinymist::ci / E2E Tests (win32-x64 on windows-2019) (push) Has been cancelled
tinymist::ci / E2E Tests (win32-x64 on windows-latest) (push) Has been cancelled
tinymist::ci / build-binary (push) Has been cancelled
tinymist::ci / build-vsc-assets (push) Has been cancelled
tinymist::ci / build-vscode (push) Has been cancelled
tinymist::ci / build-vscode-others (push) Has been cancelled
tinymist::ci / publish-vscode (push) Has been cancelled

* docs: add typlite docs

* docs: update typlite docs

* chore: reduce trim
This commit is contained in:
Myriad-Dreamin 2025-06-19 14:15:17 +08:00 committed by GitHub
parent 7ee2e53189
commit 59c6e1c48e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
18 changed files with 278 additions and 25 deletions

36
typ/templates/git.typ Normal file
View file

@ -0,0 +1,36 @@
#let git-head = read("/.git/HEAD").trim()
#let git-head-branch = if git-head.starts-with("ref: refs/heads/") {
git-head.slice("ref: refs/heads/".len())
} else {
none
}
#let git-head-hash = if git-head.starts-with("ref: ") {
read("/.git/" + git-head.slice(5)).trim()
} else {
git-head
}
// todo: read it from somewhere
#let remote = "https://github.com/Myriad-Dreamin/tinymist"
#let github-link(path, body, kind: "tree", permalink: true) = link(
{
remote
"/"
kind
"/"
if not permalink or git-head-branch == none {
git-head-branch
} else {
git-head-hash
}
"/"
if path.starts-with("/") {
path.slice(1)
} else {
path
}
},
body,
)