zig-cookbook icon indicating copy to clipboard operation
zig-cookbook copied to clipboard

Build website using zine

Open jiacai2050 opened this issue 8 months ago • 4 comments

https://zine-ssg.io/

I would like a solution written entirely in Zig, but it seems zine is designed for blogs, not book.

Upstream issue: https://github.com/kristoff-it/zine/issues/138

jiacai2050 avatar Apr 10 '25 06:04 jiacai2050

Related : https://tigerbeetle.com/blog/2025-02-27-why-we-designed-tigerbeetles-docs-from-scratch/ - maybe this could be inspiration for a pure-Zig tool to build the book?

FObersteiner avatar Apr 18 '25 11:04 FObersteiner

Looks very promising, do you have ideas about injecting code into HTML?

Currently, mdbook support include instruction for this purpose.

jiacai2050 avatar Apr 20 '25 02:04 jiacai2050

you mean like the runnable code snippets in the Rust cookbook? No idea, sorry... They have code fragments in the tigerbeetle docs, but they're all static AFAIK.

FObersteiner avatar Apr 22 '25 17:04 FObersteiner

you mean like the runnable code snippets in the Rust cookbook?

No, static is fine.

The problem is the code snippets is in a .zig file, they need to be injected into an HTML file.

jiacai2050 avatar Apr 30 '25 11:04 jiacai2050

It's a problem to migrate include(from mdbook) to relevant operator in zine.

xihale avatar Jul 21 '25 02:07 xihale

Could we write a similar function in Zine?

jiacai2050 avatar Jul 21 '25 04:07 jiacai2050

https://zine-ssg.io/docs/supermd/scripty/#$code

It seems $code is what we need:

[This is the caption]($code.asset('foo.zig'))

jiacai2050 avatar Jul 21 '25 12:07 jiacai2050