AstroNvim / astrocommunity

A community repository of common plugin specifications
GNU General Public License v3.0
1.13k stars 232 forks source link

Typst Pack: TypstPreview isn't available #909

Closed Tyrn closed 4 months ago

Tyrn commented 4 months ago

Checklist

Neovim version (nvim -v)

0.9.5

Operating system/version

Linux (Manjaro)

Terminal/GUI

alacritty

Describe the bug

Neither :TypstPreview nor :TypstPreviewToggle is available. The only available command is :TypstWatch which starts the PDF viewer (Okular, in my case).

My community.lua:

return {
    -- Add the community repository of plugin specifications
    "AstroNvim/astrocommunity",
    -- example of imporing a plugin, comment out to use it or add your own
    -- available plugins can be found at https://github.com/AstroNvim/astrocommunity
    -- { import = "astrocommunity.colorscheme.catppuccin" },
    { import = "astrocommunity.pack.lua" },
    { import = "astrocommunity.pack.rust" },
    { import = "astrocommunity.pack.python" },
    { import = "astrocommunity.pack.kotlin" },
    { import = "astrocommunity.pack.json" },
    { import = "astrocommunity.pack.elm" },
    { import = "astrocommunity.pack.nix" },
    { import = "astrocommunity.pack.haskell" },
    { import = "astrocommunity.pack.typst" },
}

Steps to Reproduce

Start AstroNvim with any *.typ file

Expected behavior

:TypstPreview and :TypstPreviewToggle should be available.

Screenshots

No response

Additional Context

No response

Std-Enigma commented 4 months ago

The plugin has to dowoad the necessary binaries to work before any other command in order to work.

The reason this is happening is probably because that the build process have failed For example you quiting nvim when they are downloading

Or possibly you haven't finished downloading them but you are trying to use it

I'll add the ability for you to manually run the build command

Std-Enigma commented 4 months ago

913 adds the TypstPreviewUpdate command run it and wait for it download then try using the preview again

Tyrn commented 4 months ago

I can see the change. Unfortunately, the only available command is still :TypstWatch. Do I have to update something manually?

Uzaaft commented 4 months ago

You need to update the plugins Yes.

Tyrn commented 4 months ago

You need to update the plugins Yes.

I'm really sorry. I've never had to do it before. What do I have to do?

Std-Enigma commented 4 months ago

Run the command Lazy sync or Lazy update

Tyrn commented 4 months ago

Run the command Lazy sync or Lazy update

Thanks! It turned out, I'll have to update to AstroNvim 4.0 first :)

Tyrn commented 4 months ago

I've my AstroNvim updated to 4.0 successfully. :TypstPreview command is available. Unfortunately, I have only the gray canvas in my default Google Chrome browser (http://127.0.0.1:35415/).

Actually, there's some very brief messy activity on the canvas before the grayness sets in. I'd prefer a different (non-default) browser for preview, BTW.

Uzaaft commented 4 months ago

Why a non-default browser?

Uzaaft commented 4 months ago

If you want that, feel free to add it into your own config. :)

Tyrn commented 4 months ago

Using your default browser with a tiling window manager for a very special purpose is inconvenient. Something like a separate app is needed, as a matter of fact.

What do you mean, add it into your own config?

Std-Enigma commented 4 months ago

@Tyrn you should probably do it urself cause in a community package like this It brings a lot of more problems for example what if the user doesn't have that specific browser(do we have to hack it and use messy code to support all browsers?)

Doing it in your own config would be more reasonable

Tyrn commented 4 months ago

Doing it in your own config would be more reasonable

Clearly so. Unfortunately, I've no idea how to go about it :)

Uzaaft commented 4 months ago

Doing it in your own config would be more reasonable

Clearly so. Unfortunately, I've no idea how to go about it :)

By reading the docs: https://github.com/chomosuke/typst-preview.nvim Hint: open_cmd

Tyrn commented 4 months ago

Thanks! And back to the title: I don't have any preview, just the gray canvas. I've never seen any preview so far.