kivikakk / koino

CommonMark + GFM compatible Markdown parser and renderer
https://hrzn.ee/kivikakk/koino
MIT License
118 stars 13 forks source link

port to zig package manager #50

Closed lun-4 closed 2 months ago

lun-4 commented 3 months ago

following my work on https://github.com/kivikakk/libpcre.zig/pull/18, I attempted to port koino to the package manager for my personal project, https://github.com/lun-4/obsidian2web/tree/zig012

this would be a large change to how koino is distributed as there wouldn't be a need for vendoring the dependencies anymore. dependencies would need respective PRs to port them (which this PR is dependent upon). because of all of this, the PR is unfinished (README was not updated, build.zig.zon refers to my forks of the libraries, etc), and I would be asking for your opinion on such (including dismissing the port altogether)

this also adds a fix to the parser because @memcpy will safety check on the length of the slices and safety-panic if the lengths differ (I looked at the two other @memcpy users and they seem fine), since the parser explicitly wants to add a newline to the end of the input, it would always panic (bug found by doing this porting work. if the zigpkg port is dismissed, I'll submit another PR to fix that specifically lol)

dependency PRs (should be merged first):

TODO (if this is accepted):

kivikakk commented 2 months ago

this would be a large change to how koino is distributed as there wouldn't be a need for vendoring the dependencies anymore. dependencies would need respective PRs to port them (which this PR is dependent upon). because of all of this, the PR is unfinished (README was not updated, build.zig.zon refers to my forks of the libraries, etc), and I would be asking for your opinion on such (including dismissing the port altogether)

I'd consider this a strict improvement, absolutely! Am very happy and grateful for all these PRs. I haven't been keeping up with the Zig ecosystem for a while until just recently, so this's been super helpful to me personally, too, in seeing how the package manager hangs together.

since the parser explicitly wants to add a newline to the end of the input, it would always panic

Oh lol, thank you. The recent updates to use @memcpy were in the beginning pretty widely broken; thanks for catching one more!

lun-4 commented 2 months ago

should be ready to merge now then! many thanks

kivikakk commented 2 months ago

Yay! Thanks so much!