neovim / tree-sitter-vimdoc

Tree-sitter parser for Vim help files
Apache License 2.0
97 stars 13 forks source link

Publish to crates.io #90

Open chipsenkbeil opened 1 year ago

chipsenkbeil commented 1 year ago

I noticed that this library has official releases with the latest being 1.2.5.

Is publishing the Rust crate planned? This would mirror other established treesitter libraries like tree-sitter-javascript and tree-sitter-md.

Would enable others to build off the library without a cargo git dependency, which is a requirement to publish a crate to crates.io.

clason commented 1 year ago

Who except Neovim is expected to use this parser?

chipsenkbeil commented 1 year ago

I'm using it right now to build a cli to convert vimdoc to html.

clason commented 1 year ago

Why not use https://github.com/neovim/neovim/blob/master/scripts/gen_help_html.lua?

chipsenkbeil commented 1 year ago

I want a standalone binary rather than needing to pull in neovim or something else to run lua, and I also need more flexibility in what and how I generate the HTML. For that script, I would need to fork the lua file (to my knowledge) to alter and maintain CSS.

I may also do a conversion to markdown so I can more cleanly integrate it into a pre-existing statically-generated website.

Is there a reason not to publish this crate? I wouldn't think a maintenance burden would be a concern since you already have the Rust support available as part of tree sitter and have releases tagged.

justinmk commented 1 year ago

For that script, I would need to fork the lua file (to my knowledge) to alter and maintain CSS.

The script outputs a help.css file, which could be replaced as needed. Though of course the HTML structure and css class names are fixed.

Is there a reason not to publish this crate?

No reason except needing to manage another account and upload process. (idk what's involved with publishing to crates)

chipsenkbeil commented 1 year ago

Is there a reason not to publish this crate?

No reason except needing to manage another account and upload process. (idk what's involved with publishing to crates)

I'm happy to help here including setting up automatic publishing through a Github action, since I have a decent background in Rust library development and crate publishing. The main challenge today with publishing is that you still need to tie crates to an owner. Not sure if neovim has any generic account that the core maintainers have access to.

From discussion about publishing:

On crates.io, crates are owned by individual users who log in directly with their personal GitHub account. Teams don't own crates and "team owners" are just an authorization mechanism that allows other GitHub users (who are part of the GH team, but not necessarily crates.io crate owners) to publish new releases.

In all cases interaction with crates.io is done via personal GitHub accounts, not via team/org account.

justinmk commented 1 year ago

github workflow to publish a treesitter crate: https://github.com/neovim/tree-sitter-c/blob/nvimc/.github/workflows/publish_crate.yml

clason commented 1 year ago

Upstream is experimenting with release and publish actions (using org secrets for cargo and npm); once all the issues are ironed out, we'll likely add them for all our parsers. No point in doing special things for this parser alone.