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

Allow the *.typ file to be called something other than main.typ #25

Open
Enivex opened this issue Aug 21, 2023 · 4 comments
Open

Allow the *.typ file to be called something other than main.typ #25

Enivex opened this issue Aug 21, 2023 · 4 comments
Labels
enhancement New feature or request

Comments

@Enivex
Copy link

Enivex commented Aug 21, 2023

This caused massive headaches for me ;)

At the very least, this limitation should be written clearly somewhere.

@Cubxity
Copy link
Owner

Cubxity commented Aug 21, 2023

This is possible, but currently undocumented. It is possible to set the path to the main file in .typstudio/config.json.

@Enivex
Copy link
Author

Enivex commented Aug 21, 2023

This is possible, but currently undocumented. It is possible to set the path to the main file in .typstudio/config.json.

Do I have to create the file myself? I wasn't able to find it.

Anyway, ideally it would detect what the main file is. Especially if there's only a single .typ file in the folder.

@Cubxity
Copy link
Owner

Cubxity commented Aug 21, 2023

Yes, you have to manually create the file for the time being. There will be a user-friendly way to set this in the GUI in the future.

An example of config.json:

{
  "main": "main.typ"
}

@caoimhebyrne
Copy link
Collaborator

caoimhebyrne commented Oct 29, 2023

There will be a user-friendly way to set this in the GUI in the future.

We should add a warning that appears when trying to compile without a main.typ, and it will then ask "Do you want to mark the current file as the main typst file?", if the user selects yes, we will write the config.json for them/make changes to it.

We could also:

  • Add a context menu action to files that allows the user to mark it as the main typst file
  • Add a project creation wizard which will create a main.typ file automatically with some boilerplate within it

What do you think of these suggestions @Cubxity?

@caoimhebyrne caoimhebyrne added the enhancement New feature or request label Oct 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants