Conversation
|
Hey there, since this template is the first for HTML (instead of PDF), what is the way to publish it? Did I do it correctly? Also, the checks do not seem to pass because of |
| ```typst | ||
| #import "@preview/manifesto:0.1.0" | ||
|
|
||
| #show: it => template(it, title: "MyAwesomePackage", toml: "PATH_TO/typst.toml") |
There was a problem hiding this comment.
I didn't test but I think template is not in scope with the current import, it would be manifesto.template.
|
|
||
| You are free to check either [this example](https://bone.grangelouis.ch) from `bone` or [this one](https://zap.grangelouis.ch) from `zap`. | ||
|
|
||
| <img width="1232" height="758" alt="Capture d’écran 2026-01-22 à 18 39 15" src="https://github.com/user-attachments/assets/076e3071-6feb-4453-8b44-e5de1a32ec53" /> |
There was a problem hiding this comment.
Can you write an actual alternative text please?
| license = "MIT" | ||
|
|
||
| [template] | ||
| path = "" |
There was a problem hiding this comment.
Your template should be in its own subdirectory. Only files in that directory will be copied to the user project. The "library" part of your package should contain utility and templating functions you don't expect the user to modify, while the template files should contain some default content.
| [package] | ||
| name = "manifesto" | ||
| version = "0.1.0" | ||
| compiler = "0.14.2" |
There was a problem hiding this comment.
This corresponds to the lowest version number this package works with, so unless you depend on a fix that was introduced in 0.14.2, it should probably be 0.14.0 or even lower.
| #let license = if toml != none { detoml(toml).package.at("license", default: none) } else { license } | ||
| #let repository = if toml != none { detoml(toml).package.at("repository", default: none) } else { repository } | ||
| #let description = if toml != none { detoml(toml).package.at("description", default: none) } else { description } | ||
| #html.elem("html", attrs: (lang: "en", class: "scroll-smooth"))[ |
There was a problem hiding this comment.
If you are using the untyped html.elem API you can support Typst 0.13, but if you want to only support 0.14 you could use the typed HTML API.
| @@ -0,0 +1,30 @@ | |||
| #let qa-icon = html.elem( | |||
There was a problem hiding this comment.
I think it would be nice to provide some fallback when compiling to PDF, even if the template is supposed to be HTML-only. PDF export is still the default and it would be a bad experience to get a non-working template by default. Simply displaying a non-editable page that says "This template is HTML-only" (with a bit of styling if you feel like it) would be enough. You would also have to take care of not using html at the top-level like you are doing here, but to always wrap it behind a conditional or a function that is lazily evaluated.
If what I'm saying is not clear I can try to give a more explicit example, let me know.
I am submitting
Description: This package is the first HTML template for Typst, written 100% in Typst using native HTML export. It works the same as a PDF template, but produces a stunning, HTML website ready for online package documentations, tutorials, etc...
I have read and followed the submission guidelines and, in particular, I
typst.tomlfile with all required keysREADME.mdwith documentation for my packageLICENSEfile or linked one in myREADME.mdexcluded PDFs or README images, if any, but not the LICENSE