Closed mrgalopes closed 10 months ago
I think having clap as a build dependency unconditionally is unfortunate. If we want to do this, maybe the CLI should be extracted into its own crate like in Typst.
cc: @reknih
Yeah, I actually also extracted it when I did the rewrite initially, but I didn't know whether that was what you wanted so I ended up reverting to using a cli
feature. I also think having them separate would be nicer.
Originally, I liked this setup, but I've come to prefer the more flexible two-crate setup since.
Yeah, extracting the CLI into its own crate should be nicer, you're right. I will update the PR in the following days with this setup. Thank you for the feedback!
I separated the crates inspired by the structure of typst, and also rebased on main. Let me know what you think.
Apologies for the delay. I've been looking for alternatives to add the completions but couldn't find any that were ideal. The way that this was done mirrors the typst-cli, where the nix flake installs the completion after the build. Without nix, this would have to be done manually. From what I could find, crates.io doesn't let you install arbitrary files, like completion files. This is how I've done for zsh:
fpath+=~/.zfunc
autoload -Uz compinit compinit
2. Copy the completion artifact corresponding to zsh and bash to the ~/.zfunc folder, and restart the shell
```sh
cp target/release/artifacts/_svg2pdf ~/.zfunc
Thank you!
Closes #27.
Adapted from the main typst repo. It only outputs the completions and the man page when the cli feature is enabled. A downside is that it always fetches and compiles the dependencies. Any suggestions are appreciated. 😄