Repository navigation
Publish all project documentation on smallrye.io, from the projects' repositories - #136
Conversation
|
Screenshots of each project's documentation before (its MkDocs or Antora site today) and after (the project's AsciiDoc from its PR, rendered by this branch locally), updated for the header and sidebar changes. On smallrye.io the sidebar starts closed (the ☰ button opens it, and it stays open on the next pages for that reader); its groups are folded except the one holding the current page. The project and version picker sit in the header next to the logo, so a start page has no separate title; further down, a start page lists the documentation, from its navigation. Each project PR has more pages, including one with the sidebar open.
Dark theme: the same screenshots with the dark themeThe old Antora sites and the GraphQL, Vert.x bindings and Mutiny Zero MkDocs sites have no dark theme, so their "before" stays light; the other old MkDocs sites were switched to their own dark palette.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Hey @phillip-kruger, this looks amazing! One question: are we supposed to merge your PRs in the individual projects before this one is merged, or after? Or it doesn't matter? |
|
Oh one more thing: the way we preview individual project docs locally is not good. I mean, it's probably the best we can do at the moment, and I usually don't mind because IntelliJ's built-in Asciidoc renderer is good enough for most cases, but when it's not... Well, I guess I'll get used to it. At least it's documented :-) |
|
Thanks @Ladicek! Best is this one first, then the project PRs in any order.
|
|
OK, thanks! I'll review the PRs but wait with merging until this is done. |
|
@Ladicek I'll add something that make local preview easier. |
|
@Ladicek about previewing locally: that should be much better now. In a project's checkout, To make that possible, the tools in this PR are now Java (one JBang program, |
|
Sounds much better, thanks! |
cfd9016 to
be09664
Compare
34c74a6 to
fe01744
Compare
Each project's AsciiDoc documentation is pulled from its repository into content/docs/<project>/<version>/ and published at /docs/<project>/<version>/, replacing Antora and the per-project MkDocs/mike sites. - data/docs.yml: the projects, their docs paths, the versions followed (main, latest, every minor of the latest two major lines, one version per older major line), versions hidden from the picker or no longer published (hidden, from), and their old addresses. - tools/docs/Docs.java (JBang): sync, local preview, MkDocs and Antora converters (releases still in those formats are converted on the fly), dark versions of diagrams and drawings, redirects for the old Antora addresses and the old gh-pages sites, and blog link rewriting. - Pages an older version shares with the next newer one are stored once (_inherited.yml); after Roq, Docs.java inherit writes them in their own version's frame, keeping the build within what Roq can record. - Workflows: nightly and on-demand sync committing to develop, a reusable check for project PRs, and the build without Antora. - Layout: docs pages with sidebar, version picker (latest, minors grouped by major line, main), release date, a notice linking to the latest release, on-this-page list, tabs, start-page contents and dark-theme images, the project's description as the start page's heading and its logo in the header; blog posts link to the new addresses. - Search in each project's documentation (a Pagefind index per project, filtered by version) and the project's repository, release, stars and forks in its docs header. - /docs/ and /projects/: a card per project, the documentation link, the latest release and its date, newest first (data/projects.yml now drives /projects/). - content/docs/ and data/docversions.yml: the synced documentation of 188 versions of 12 projects.
fe01744 to
c63aae0
Compare
























































smallrye-docs-mutiny.mp4
Every SmallRye project's documentation is now published on this site at
/docs/<project>/<version>/, from the project's own repository, as AsciiDoc laid out like the Quarkus guides. Antora leaves the build, and the per-project MkDocs/mike sites are replaced.Versions. 200 versions in all:
/docs/smallrye-mutiny/2.9/is 2.9.5);/docs/smallrye-graphql/1/);hiddenkeeps versions published but out of the picker, andfromstops publishing releases older than a given one (their old addresses go to the next newer version).The old MkDocs sites can therefore go entirely: old addresses redirect, see Cutover.
/docs/and/projects/./docs/, each card shows the latest release and its date, and links to the documentation. Within each group, the newest release comes first; the sync writes that order todata/docversions.yml./projects/, each card has a Documentation link (when the docs are here) and a GitHub link. The page is now generated fromdata/projects.yml:/or Ctrl/Cmd+K). It searches the project and version being read, using a static Pagefind index built after the site (tools/docs/search-index.sh, one index per project, about 35 s for all 5,915 pages). One index across all projects dropped pages for common words; per-project indexes match a plain text count.'wasm-unsafe-eval'(Pagefind) andapi.github.com.Picker and notices.
Each project gets a PR moving its sources to AsciiDoc (smallrye/smallrye-graphql#2732 first). The site does not wait for those PRs: a release whose docs are still MkDocs or Antora is converted on the fly, so all current releases are published as soon as this is merged.
Reviewing: why 11,910 files
Almost all of the diff is documentation copied in from the projects, not code.
tools/docs/, templates, CSS/JS, workflows,data/docs.yml, README, blog linkscontent/docs/(200 versions of 12 projects) anddata/docversions.yml.adocpages: an older version stores only the pages that differ from the next newer one, see "Shared pages" below;content/docs/anddata/docversions.ymlin the PR's file filter.maincommit or release tag moved;developas the CI GitHub App, which triggers the normal build and deploy;How it works
data/docs.ymllists every project with docs: repository, docs path, the versions followed, and the addresses published before. It also drives the/docs/hub.tools/docs/Docs.java: Java and JBang are all it needs. Each subcommand was checked byte for byte against the Python scripts it replaced, including the full nightly sync (28 versions of 13 projects).Docs.java synccopies a project's docs from a branch, tag or local checkout intocontent/docs/<project>/<version>/, and records versions and navigation indata/docversions.yml. It also:{project-version}stays)._inherited.yml: 1,870 pages are stored and 4,045 inherited.Docs.java inherit target/roqwrites each inherited page from the stored one:Docs.java mkdocs2adocandDocs.java antora2adocdo the one-off conversion of a project, and the on-the-fly one. The MkDocs converter covers the docissimo macros (insert,javadoc,image, attributes), admonitions, tabs, PlantUML and nested pages. An HTML page kept next to the Markdown (Mutiny Vert.x bindings' 3.x to 4.x API compatibility report) becomes a page of its own, so the migration guide's links to it keep working. Javadoc links to other projects' artifacts (Kafka's and Pulsar's clients) use those projects' versions, read from each release's pom (maven-attributes,javadoc-versions).develop./docs/<project>/<release>/<page>.html) to the same page in the version replacing them.#_snake_caseanchors are mapped to the new Quarkus-style ids.Docs.java dark-images, run by the sync): the project's ownx.dark.png, or the same hues with lightness inverted and white made transparent. Screenshots and photos keep a light background; rolesno-dark/dark-invertoverride.Docs.java rewrite-linkschecked each page and anchor against the generated site, including sections renamed in later releases.Try this PR locally
try-smallrye-docs.shchecks out this PR, builds the site the way CI does, and serves it. With--project, it also checks out that project's docs PR and previews it live.ghlogin is needed; the PRs are fetched aspull/<n>/head.graphql,config,fault-tolerance,health,reactive-messaging,mutiny,mutiny-vertx-bindings,mutiny-zero,stork,jandex.Preview a project's docs locally (once this is merged)
In the project's checkout:
Then open
http://localhost:8080/docs/<project>/main/, for example http://localhost:8080/docs/smallrye-fault-tolerance/main/.What it does:
docs-previewprofile (added by each project PR) runsjbang docs-preview@smallrye/smallrye.github.io, and installs JBang if needed.developonce a day, and publishes the project's docs as themainversion.jbang docs-preview@smallrye/smallrye.github.io --help):--port <port>for another port;--site ../smallrye.github.ioto preview against a local checkout of this site, for example to try layout changes.It only works once this PR is merged, because it runs the tools and the site from
develop.Security
The PR check renders untrusted pull-request content, so:
Checked locally
The full site was built with all 200 versions, then
inheritandredirectswere run on it:og) examples and one Kafka example;/client_configuration, Fault Tolerance 6.0'slink:core.adoc, and the links to pages that never existed (Reactive Messaging's JMSserdeup to 4.24, and 5.0.0-RC2's RabbitMQ page), which become plain text.After merge
CI_APP_ID/CI_APP_PRIVATE_KEY) is reused by the sync workflow.main.gh-pages,Docs.java gh-pages-redirectsturns every page of every old version into a redirect to the same page of the version replacing it here: its minor, or its major line when older (e.g./smallrye-graphql/2.8.0/federation/→/docs/smallrye-graphql/2.8/federation/), or the version's start page if the page no longer exists. Tried on all seven branches when versions were per major line: 12,739 redirect pages, none broken, 85% to the same page. Javadoc (apidocs/) stays as it is. Jandex's old site gets the same treatment.