Enter-tainer / typst-preview

[DEPRECATED] Use tinymist instead
https://Enter-tainer.github.io/typst-preview/
MIT License
450 stars 21 forks source link

Relative paths don't work in `typst-preview.fontPaths` #259

Closed Myriad-Dreamin closed 7 months ago

Myriad-Dreamin commented 7 months ago

I have a configuration of typst-preview.fontPaths, it works with absolute paths:

{
  "typst-preview.fontPaths": [
    "/home/user/work/typst/tutorial/assets/fonts",
    "/home/user/work/typst/tutorial/assets/typst-fonts"
  ]
}

But I do want to use relative paths so that I can commit it to my git repository.

{
  "typst-preview.fontPaths": [
    "./assets/fonts",
    "./assets/typst-fonts"
  ]
}

To Reproduce

Use the configuration.

Expected behavior

Let relative paths work. Ideally we can also let vscode variables work.

Package/Software version:

typst-preview extension version: v0.10.8

Enter-tainer commented 7 months ago

Maybe use ${workspaceFolder}, see #107

Enter-tainer commented 7 months ago

But it's still interesting why relative path won't work 🤔

Myriad-Dreamin commented 7 months ago

Maybe use ${workspaceFolder}, see #107

It works.

Enter-tainer commented 7 months ago

But it's still interesting why relative path won't work 🤔

Maybe for typst-preview the . is ~/.cache/vscode/.... I guess. I think this could be improved