Documentation generation?

I wish I could generate documentation like “docgen” from zig, but it doesn’t work or at least I can’t.

and I don’t have time for the moment and when we publish it becomes heavy.

good, it’s still possible to proofread and do with mustache-zig generate at least the functions and make a link

does anyone have a solution. Thank you

with the last dev.zig

zig build-obj -femit-docs ./forms.zig

Be careful, the build-obj is not aligned with build-file.
Imports into the master program must all be qualified.

on the other hand, all the sources must be in the same folder

zig build --build-file ./buildExemple.zig
source —> const kbd = @import(“cursed”).kbd;
build —>Prog.addPackagePath(“cursed”, “deps/curse/cursed.zig”);

zig build-obj -femit-docs ./Exemples.zig use cursed.zig
build-obj ----> source —> const kbd = @import(“deps/curse/cursed.zig”).kbd;

it’s a little bug
but the doc is pretty clean

I think that soon, we will have the possibility of making a documentation of the projects which we publish.

Thanks to the whole team.

Hello, with help I found how to generate documentation for a project.
It’s all in my Termcurs project
you will find in the src-zig buildExample how to do it

1 Like

If you want to generate documentation on GitHub for example with the dev version it doesn’t really work.
So I recompiled with the official version ex:0.10
there everything works fine everything is there

After reading several… I send you my new 0.11.0 build where I put the module creation instead of the package
and the association of the modules to the executable

const std = @import("std");

pub fn build(b: *std.Build) void {
    // Standard release options allow the person running `zig build` to select
    // between Debug, ReleaseSafe, ReleaseFast, and ReleaseSmall.
    const target   = b.standardTargetOptions(.{});
    const optimize = b.standardOptimizeOption(.{});
    // zig-src            source projet
    // zig-src/deps       curs/ form / outils ....
    // src_c              source c/c++
    // zig-src/srcgo      source go-lang 
    // zig-src/srcgo/lib source.h

    // Definition of module

    // data commune
    const dds = b.createModule(.{
      .source_file = .{ .path = "./deps/curse/dds.zig" },
    // console
    const cursed = b.createModule(.{
      .source_file = .{ .path = "./deps/curse/cursed.zig" },
      .dependencies= &.{.{ .name = "dds", .module = dds }},
    // outils
    const utils = b.createModule(.{
      .source_file = .{ .path = "./deps/curse/utils.zig" },
      .dependencies= &.{.{ .name = "dds", .module = dds }},
    // formulaire
    const forms = b.createModule(.{
      .source_file = .{ .path = "./deps/curse/forms.zig" },
      .dependencies= &.{
        .{ .name = "dds",    .module = dds },
        .{ .name = "cursed", .module = cursed },
        .{ .name = "utils",  .module = utils },

    // Building the executable

    const Prog = b.addExecutable(.{
    .name = "Docscurs",
    .root_source_file = .{ .path = "./Docscurs.zig" },
    .target = target,
    .optimize = optimize,

    Prog.addModule("dds"   , dds);
    Prog.addModule("cursed", cursed);
    Prog.addModule("utils" , utils);
    Prog.addModule("forms" , forms);