Skip to content
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

Configure name of exported PDFs on a project level #1104

Open
JonPichel opened this issue Jan 2, 2025 · 4 comments · May be fixed by #1142
Open

Configure name of exported PDFs on a project level #1104

JonPichel opened this issue Jan 2, 2025 · 4 comments · May be fixed by #1142
Labels
editor-integration Features about editor integrations enhancement New feature or request

Comments

@JonPichel
Copy link

I am using the tinymist.exportPdf feature from Neovim and I would like to be able to specify the name of the generated PDF on a project level. I usually name the main file of any Typst project "main.typ" so I get "main.pdf" as the name of the generated file.

Is there currently a way to do this? I've seen an approach using TOML is being discussed in #900 and there it is mentioned that we can use tinymist.typstExtraArgs to have the same functionality, but I am not sure how this would work in Neovim on a project level since this parameter is passed to the LSP itself anytime Neovim starts.

@Eric-Song-Nop
Copy link
Collaborator

Sadly, the project level config might not come in short term, while there are some ways to do project level config for Neovim, if you are using lazyvim, you can create a .lazy.lua file in the project root, and there are other ways for any neovim configuration.

@Eric-Song-Nop Eric-Song-Nop added enhancement New feature or request editor-integration Features about editor integrations labels Jan 3, 2025
@SylvanFranklin
Copy link
Contributor

Using lua feels a little bit out of spirit for Typst, I think this would be a great thing to work on for tinymist. To me even Toml seems a little bit overkill, If this could be solved within neovim directly that would be ideal. That would likely involve some additional commands in tinymist though.

@Myriad-Dreamin
Copy link
Owner

It is easy to implement but we lack of nice project model. The project model should cover:

  • What are the inputs (main files and their sys.inputs)?
  • What are the outputs (preview, pdf, SVG, or json result of queries)?
  • When to export (on save or on type)?

The project configuration should be also read by different editors and manageable via git, as you use neovim while your collaborator may use vscode.

To be honest, I'm whether it is complicated and whether we can reuse some existing stuffs. Before figuring out it, a tinymist.typstExtraArgs is the only easy-to-understand fallback solution.

@Myriad-Dreamin
Copy link
Owner

We also marks such feature requests as low priority, unfortunately. It deserves to note that it is okay for tinymist as a classical language server to only understand project's inputs. Being capable to export at the same time is only a bonus. If some project really has some complicate structure, they can arrange the export tasks by typst-cli plus some build system like just or make.

@Myriad-Dreamin Myriad-Dreamin linked a pull request Jan 9, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
editor-integration Features about editor integrations enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants