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

Can not import module for templating #18

Open
blackjyn opened this issue Feb 25, 2024 · 7 comments
Open

Can not import module for templating #18

blackjyn opened this issue Feb 25, 2024 · 7 comments

Comments

@blackjyn
Copy link

Thank you for creating this useful tool.

So, I create a template file called template.typ that contains settings for fonts, colors etc. The template is fine no errors.
It is located at the root dir.

Then I tried to import the template to my page:

#import "../template.typ"

I encountered error with typst-live :

= hint: cannot read file outside of project root
= hint: you can adjust the project root with the --root argument

with typst w dir\src.typs --root="path\to\root" , it works just fine.

the --root arg is owned by typst but not typst-live.

perhaps we need a way to bypass args to the typst?

Thank you

@ItsEthra
Copy link
Owner

How do you launch typst-live and what arguments do you pass?

@blackjyn
Copy link
Author

simply typst-live source.typ with no arguments

@ItsEthra
Copy link
Owner

Yea I guess one solution would be to separate typst and typst-live args with --, like cargo run does it, but I don't know how to do it with clap yet.

@ItsEthra
Copy link
Owner

With cfdb60d you should now be able to pass extra args like this typst-live file.typ -- --root=..., could you verify if it works?

@malkoG
Copy link

malkoG commented Mar 12, 2024

@ItsEthra It does not work

@ItsEthra
Copy link
Owner

Until I fix it I recommend using typst watch to output a pdf file which you can serve with typst-live -R

@malkoG
Copy link

malkoG commented Mar 12, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants