-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add option to export PDF on type only when document has a title #555
Comments
I already noticed that it is not composable, but I didn't have time to improve it. There is a thing remaining to discuss, how could we design condition syntax to tell LSP to when export a document. Besides I don't want to break existing configurations, so I would like to improve export configuration totally on new configuration items and get our more powerful configuration work there. |
possibly design: use typst syntax, and provides several usable varaibles, and we can have conditions like:
|
I don't actually know Rust or the codebase enough to offer any valuable insight here. Just wanted to share since it's one of my biggest wishes for the LSP - that maybe there would be more people that share my sentiment. Is there a reason to not simply add a new configuration option in addition to the existing ones, where it conditionally uses |
Adding
We may move things towards a new single
{ "export": [{"when": "onTyped", "filter": "query(document).first().title.len() > 0"}] } You even get rid of "onDocumentHasTitle" by nice naming convention. Note we cannot do it by default since it is a user preferred convention rather than one is forced by official typst. { "export": [{"input": "**/*/main.typ", "when": "onTyped"}] } Btw, for other formats, it may be: { "export": [{"format": ["html", "pdf"], "input": "**/*/main.typ", "when": "onSaved"}] } |
Ah, makes sense. That would be very nice indeed. |
Motivation
Currently, I can only use
onType
in my workflow using Zathura for previewing. But whenever I create and edit modules / templates, I have to delete a bunch of unnecessary PDFs.The
onDocumentHasTitle
option could solve this, if you could choose to pair it with eitheronSave
oronType
.Description
Many possibilities for implementation. I guess the most simple one would be to add one additional option that would combine
onDocumentHasTitle
andonType
.The text was updated successfully, but these errors were encountered: