tinymist
tinymist copied to clipboard
Improved export conditions
Motivation
Currently, opening vscode with the export pdf set to onSave
will automatically trigger a render of the last opened Typst document. This is less than ideal as it can cause merge conflicts when using Git to pull changes, as the exported pdf by typst modifies the ModifiedDate
field of the PDF. This behavior is particularly likely to happen when the exported PDF of a document is stored in Git.
Description
I currently have to use git restore
to revert this compiled PDF each time I open vscode before I can run git pull
and pull changes from my upstream repository, to avoid having these merge conflicts happen. This is less than ideal.
It's briefly touched upon in https://github.com/Myriad-Dreamin/tinymist/issues/555#issuecomment-2308947041, but there was also some discussion on Discord about improving the way tinymist can trigger an export of a PDF. Potential predicates are:
- onSave
- onType
- onDocTitles
- onPinned
Adding something like onPinnedAndSaved
would solve my use case, however there may be other export conditions people want. Perhaps this issue can be used to discuss other ways the export system could work (e.g., the customization suggested in https://github.com/Myriad-Dreamin/tinymist/issues/555#issuecomment-2308947041, however even adding a onPinnedAndSave
would be a big improvement.
Alternatives
Perhaps the onSave
export option could be changed so that when a PDF is not saved, but rather the vscode instance is just opened, it does not trigger a save.