Skip to content

docs(build): unified output subtree under docs/build/#4081

Open
grandixximo wants to merge 2 commits into
LinuxCNC:masterfrom
grandixximo:docs/unified-build-output
Open

docs(build): unified output subtree under docs/build/#4081
grandixximo wants to merge 2 commits into
LinuxCNC:masterfrom
grandixximo:docs/unified-build-output

Conversation

@grandixximo
Copy link
Copy Markdown
Contributor

Summary

Move all rendered docs artefacts (HTML, PDF, po4a-translated .adoc) under a single docs/build/ tree, drop asciidoc-py-era leftovers in docs/html/, and stop leaking build-time artefacts into docs/src/.

Builds on top of #4053 (asciidoctor migration). Implements Bertho's layout proposal agreed in the #4053 discussion.

Layout

docs/build/html/index.html           static redirect -> en/
docs/build/html/{shared CSS, logo}
docs/build/html/<lang>/index.html
docs/build/html/<lang>/<topic>/<page>.html
docs/build/html/<lang>/man/manN/<page>.html
docs/build/html/<lang>/pdf/LinuxCNC_*[_<lang>].pdf
docs/build/adoc/<lang>/              po4a-translated source

English now lives under en/ like every other language, so the top-level redirect lands users on the right tree.

Manpage troff stays at docs/man/ because halcompile output, install-man, mandb, and rip-environment read it.

Source-tree cleanup

Three build-time artefacts no longer leak into docs/src/:

Was generated under Now generated under
docs/src/man/man1/linuxcnc.1.adoc (config.status output) docs/build/adoc/en/man/man1/linuxcnc.1.adoc
docs/src/drivers/mb2hal_HOWTO.ini (include fixture) docs/build/adoc/en/drivers/mb2hal_HOWTO.ini
docs/src/gui/gmoccapy_release_notes.txt dropped (was dead under new layout)

mb2hal.adoc's include:: now uses the {fixturedir} attribute, set per-language by the asciidoctor HTML rule. The 8 .po files are repointed at the new include path (mechanical msgid edit, no po4a regen).

The manpage HTML rule grows a build-tree fallback so the English manpage build finds linuxcnc.1.adoc; the LinuxCNC_Manual_Pages.pdf master generator grows the same fallback. An explicit troff rule for linuxcnc.1 replaces the generic pattern (which expects sources under docs/src/man/).

Static assets in the former output dir docs/html/ move to docs/src/ (gcode.html, index.css, logo). asciidoc-py-era files (asciidoc.css, linuxcnc.css, minus.png, plus.png) are deleted.

debian/*.docs and docs/po4a.cfg are repointed at the new tree. Install destinations under usr/share/doc/ are unchanged.

Test plan

  • cd src && make -j$(nproc) clean full build
  • English HTML + 5 Master PDFs + Manual_Pages.pdf
  • All 8 languages (en, de, es, fr, nb, ru, uk, zh_CN) build HTML + 4 Master PDFs each
  • mb2hal.html contains the example INI fixture in all 8 languages
  • LinuxCNC_Documentation.pdf contains the mb2hal INI fixture
  • linuxcnc(1) troff renders to docs/man/man1/linuxcnc.1
  • linuxcnc(1) HTML and PDF (in LinuxCNC_Manual_Pages.pdf) both contain the manpage body
  • make docclean leaves no generated .adoc / .ini / .txt in docs/src/
  • git clean -dxn docs/src/ reports only hal/components_gen.adoc (pre-existing, generated by gen_complist.py, not from this PR)

All rendered artefacts (HTML, PDF, po4a-translated .adoc) move under
docs/build/.  Layout:

    docs/build/html/index.html        static redirect -> en/
    docs/build/html/{shared assets, CSS}
    docs/build/html/<lang>/index.html
    docs/build/html/<lang>/<topic>/<page>.html
    docs/build/html/<lang>/man/manN/<page>.html
    docs/build/html/<lang>/pdf/LinuxCNC_*[_<lang>].pdf
    docs/build/adoc/<lang>/           po4a-translated source

English now has its own en/ subdir so every language is symmetric
and the top-level redirect lands users on the right tree.

Manpage troff stays at docs/man/ (halcompile output, install-man /
mandb / rip-environment read it).

Static assets in the former output dir docs/html/ go to docs/src/
(gcode.html, index.css, logo); asciidoc-py-era leftovers are dropped.

debian/*.docs and po4a.cfg are repointed at the new tree.  Install
destinations under usr/share/doc/ are unchanged.

Also moves three build-time artefacts that previously leaked into
docs/src/ to the new build tree, so the source tree stays clean and
no per-build .gitignore entries are needed:

    docs/src/man/man1/linuxcnc.1.adoc       (config.status output)
        -> docs/build/adoc/en/man/man1/linuxcnc.1.adoc
        The manpage HTML rule grows a build-tree fallback so the
        English manpage build still finds it; the explicit troff rule
        is duplicated from the generic pattern (sources under
        docs/src/man/) since the build-tree path no longer matches.

    docs/src/drivers/mb2hal_HOWTO.ini       (.include-stamp copy)
        -> docs/build/adoc/en/drivers/mb2hal_HOWTO.ini
        mb2hal.adoc's include now uses {fixturedir}, set per-language
        by the asciidoctor HTML rule.  The link: target still copies
        to docs/build/html/<lang>/drivers/ for runtime download.
        po files repointed at the new include path.

    docs/src/gui/gmoccapy_release_notes.txt (.include-stamp copy)
        Dead code under the new layout: gmoccapy.adoc only link:s the
        file (HTML render time), and the recipe already copies it
        next to the rendered HTML.
@grandixximo
Copy link
Copy Markdown
Contributor Author

@hansu @BsAtHome See if this is the right shape, the submake file since I'm getting blame almost everywhere, I fixed everything to tabs just to make it mostly consistent, adoc folder naming is sensible?

@grandixximo grandixximo marked this pull request as draft May 30, 2026 12:26
@grandixximo
Copy link
Copy Markdown
Contributor Author

reverting to draft till it builds on sid

…ionally

CI on PR LinuxCNC#4081 failed for two reasons exposed by --enable-build-documentation=pdf:

* The asciidoctor PDF rule did not set the fixturedir attribute, so the
  mb2hal {fixturedir}/drivers/mb2hal_HOWTO.ini include resolved literally
  in every Master_Documentation*.pdf and asciidoctor reported it missing.
  Pass fixturedir=$(DOC_OUT_ADOC)/<lang> from the rule, where <lang> is the
  literal "en" for the English call site and $(firstword $(subst /, ,$*))
  for the per-language call site (so the same recipe serves both).

* docs/build/html/en/gcode.html only got copied as a side effect of
  .copy-asciidoc-stamp, which lives under htmldocs.  debian/configure
  sets --enable-build-documentation=pdf for CI, so htmldocs never fires
  and the en/ copy never lands, breaking dh_installdocs --package=
  linuxcnc-doc-en.  Promote the copy to its own rule, depended on
  unconditionally by `docs:`.
@grandixximo grandixximo marked this pull request as ready for review May 30, 2026 12:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant