-
Notifications
You must be signed in to change notification settings - Fork 76
Exlude (Empty) Files from PDF Export #285
Comments
An include-list might be more useful since you'd be explicitly listing the files you care about, and you can add any number of helper files without having to change the vscode config. Though I agree, automatically excluding blank PDFs would be the most user-friendly option. |
currently there is no good way for lsp to determine which file is the entry point. This may also happen in c/c++ and they use a compile_commands.json to determine where the entrypoint is. i'd suggest something like a typst-project.toml or package.json to determine where the entrypoint is. include/exclude list is obviously suboptimal but it's like a quick workaround. Perhaps maintain a "import count" for files in project and only consider |
While I agree that a typst project config file of some sorts makes the most sense, I feel like that is a pretty large change that would require a lot of community input, and should probably be standardized in conjunction with the @typst project. IMO a whitelist glob (I agree w/ @platformer, this seems better than an exclude list) in the LSP config would be a great solution for the time being, and if/when a project format is decided on, the setting can be deprecated. |
A very simple approach is to detect your document's title and don't export that documents with empty title.
|
Related issue with a different solution: #11. |
@Marmare314 Are you referring to on-demand compile? I feel that's a workaround at best, not a solution. |
Typst packages already use a |
Feature Request
Hi, I find that keeping
"typst-lsp.exportPdf"
set often ends up generating blank pdf exports for files that are not meant to be compiled, such as templates or utility files. Having to manually delete these blank files gets tedious, so I'd like a settings interface to exclude files from the pdf export.I imagine something along the lines of
"typst-lsp.exportPdfExclude": "glob string"
or evenAlternatively, a setting for detecting empty files and not generating them would be even more helpful for my own use-case, but is less general, and I'm not sure what the complexity of implementing this would be.
Thanks for the project, it's been working wonderfully for me so far!
The text was updated successfully, but these errors were encountered: