[English] | [中文]
Instantly share typst documents on git and other network storage.
Assuming that you have a GitHub link, for example:
https://github.com/typst/templates/blob/main/charged-ieee/template/main.typ
Simply replace the github.com
with gistd.myriad-dreamin.com
:
https://gistd.myriad-dreamin.com/typst/templates/blob/main/charged-ieee/template/main.typ
Example Documents:
- https://gistd.myriad-dreamin.com/johanvx/typst-undergradmath/blob/main/undergradmath.typ
- https://gistd.myriad-dreamin.com/Jollywatt/typst-fletcher/blob/main/docs/manual.typ
- https://gistd.myriad-dreamin.com/typst/templates/blob/main/charged-ieee/template/main.typ
These URL parameters can change the behavior of gistd.
g-page
: The page number to display. Default is1
. Only available in the slide mode.g-mode
: The mode to display.doc
: View the document in the document mode.slide
: View the document in the slide mode.
Using g-mode=slide
mentioned above to view the document in the slide mode:
Example Documents:
Assuming that you have arbitrary link, for example:
https://github.com/typst/templates/blob/main/charged-ieee/template/main.typ
Put any-gistd.myriad-dreamin.com
before the link:
https://any-gistd.myriad-dreamin.com/github.com/typst/templates/blob/main/charged-ieee/template/main.typ
any-gistd.myriad-dreamin.com
is alias for gistd.myriad-dreamin.com/@any
.
If a domain (host) is specially identified, gistd will use corresponding approach to serve the document.
github.com
: git protocol.codeberg.org
: git protocol.localhost
and others: HTTP protocol if host islocalhost
otherwise https protocol. Note: gistd won't load other files on the specified domain if it cannot identifies the domain, i.e. the typst document cannot load other resources relative to the domain.
Example Documents:
- https://any-gistd.myriad-dreamin.com/github.com/Myriad-Dreamin/gistd/raw/main/README.typ
- https://gistd.myriad-dreamin.com/@any/github.com/Myriad-Dreamin/gistd/raw/main/README.typ
By default, gistd uses a trusted cors proxy (https://underleaf.mgt.workers.dev
) to load documents. This is because GitHub and Forgejo doesn't allow gistd to load documents. See isomorphic-git: Quickstart for more details.
However, you may want to load a document without cors proxy. You can do this by adding g-cors=false
to the query string.
For example, to load a document at http://localhost:11449/main.typ
:
@any
infers protocol from the URL, while you could use @http
to force HTTP protocol. For example, to load a document at http://localhost:11449/main.typ
:
Install dependencies:
pnpm install
Develop locally:
pnpm dev
Build:
pnpm build