Fork of dvui, the immediate-mode Zig GUI, with a font face index for Pipit
dvui docs readme-docs.md
1.8 kB · 47 lines
Markdown
at main

How to #

Just run zig build docs

This will generate the docs, ready for static server, in zig-out/docs

Viewing in local can be achieve with, for exemple :

  • python -m http.server -d zig-out/docs/
  • caddy file-server --root zig-out/docs/ --listen :8000

Note that zig build docs --watch should works beautifully. I also add success temporarily adding in the <head> section of docs/index.html :
<script type="text/javascript" src="http://livejs.com/live.js"></script>
For a full auto reload experience. Cool enough to be mentioned.

About Images #

Images/screenshots are integrated in the docs. It works by :

  • Declaring a test block whose name ends with .png
  • Said test block should use dvui.testing.saveDocImage function
  • It relies on docs/image_gen_test_runner.zig test runner to provide a path.
  • To use the image, use the markdown image syntax with the test name.

e.g. :

  • test "my-image.png" { // declare gui element and call dvui.testing.saveDocImage }
  • /// ![image description](my-image.png)

About Customization #

Simple Customization of the logo is performed with docs/add_doc_logo.zig that is automatically called via the build.zig.

docs/index.html is mostly a copy paste of the default one generated by the zig tool chain.

Changes :

  • Removed logo and favico for a NEEDLE_STRING that is replaced at build time.
  • Played a bit around with the colors to roughly match Web Demo style

Note to future self (or other future people) #

It's possible (likely ?) that zig update will change stuff enough to make the current index.html broken at some point. In which case one would need to comment out the "Html Customization" section in build.zig, build the docs, copy-paste the default index.html and reapply the relevant changes.

CI #

TODO