Class GenerateDocs
java.lang.Object
ai.redouble.docs.GenerateDocs
Generates the HTML documentation site from the markdown files in the reactor's source
trees. Runs at the site phase (after the aggregate javadoc); the whole pipeline is
Maven plus a JDK, so it runs the same on any contributor's machine.
Pipeline:
1. Read the reading order,
nucleo-docs/CONTENTS.md (Contents): the pages
the site carries, their titles, their parts, their order. Every PACKAGE.md under any
module's src/main/java must be listed there, so no page is left out of the story.
2. Build a class index over all .java files for javadoc linking. The javadoc tree is
produced by the aggregate goal bound to pre-site, so one tree covers every module.
3. Per page, in reading order: Samples checks every checked sample against its
source region, the source's own H1 gives way to the page frame, LinkRewriter
resolves inter-doc .md links, points a link to any other file of the reactor at a copy
the site ships, and links backticked class names to javadoc, and flexmark converts the
body to HTML.
4. Wrap each body in the shared template: the search box in the titlebar, the part and
title above the body, the previous and next pages of the reading order and the
copyright and license footer below it, the sidebar NavGenerator renders once
from the contents beside it. The reactor's LICENSE and NOTICE ride along as
LICENSE.txt and NOTICE.txt, which the footer links, and so does every
file a page links that is not a page itself, each under its own name with .txt appended.
5. Write llms.txt and llms-full.txt, the contents and the whole site as
markdown for a coding agent, and search-index.js, what the search box searches
(SearchIndex), and verify: every page appears in the nav, no .md href is left,
every local image resolves, every anchor the search index lands on exists.- Since:
- 0.1 (2026-09-17)
- Author:
- Andrey Santrosyan
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordOne page of the site: its id (the file name without .html), its title from the contents, its markdown source, the part it belongs to as the breadcrumb reads it (null for the front matter) and the package and module the source documents (null for a document outside every module's source tree). -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidThe whole site from the reactor atrootintodocsDir, every page carryingversion; with links into the javadoc tree when the site ships one, and with the version badge offering the other versions when the site is published beside them.static voidArguments: the reactor root and the version the site documents, then optionally--out <dir>for a different output directory (the demo build embeds the site into its jar this way) and--no-javadoc-linksfor a build that does not ship the javadoc tree - backticked class names then stay code chips instead of becoming dead links - and--no-versionsfor a build that is not published beside other versions - its version badge then names no list of versions and asks for none.
-
Constructor Details
-
GenerateDocs
public GenerateDocs()
-
-
Method Details
-
main
Arguments: the reactor root and the version the site documents, then optionally--out <dir>for a different output directory (the demo build embeds the site into its jar this way) and--no-javadoc-linksfor a build that does not ship the javadoc tree - backticked class names then stay code chips instead of becoming dead links - and--no-versionsfor a build that is not published beside other versions - its version badge then names no list of versions and asks for none.- Throws:
IOException
-
generate
public static void generate(Path root, Path docsDir, String version, boolean javadocLinks, boolean versionsBeside) throws IOException The whole site from the reactor atrootintodocsDir, every page carryingversion; with links into the javadoc tree when the site ships one, and with the version badge offering the other versions when the site is published beside them.- Throws:
IOException
-