-
Notifications
You must be signed in to change notification settings - Fork 41
153 add instructions for antora based spec template #154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
cb1ff8c
ad7908a
dbe6198
e00e031
1d4a918
0ca633d
928e994
b33c164
c54dc2d
2de5e51
44d5608
0bf3294
c82fa01
d64a5a5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| # Changes | ||
|
|
||
| ## 2026-06-08 — Antora structure and documentation site guidance | ||
|
|
||
| ### New files | ||
|
|
||
| - `src/antora-structure.adoc` — New section documenting the Antora-based repository layout used by RISC-V specification repositories. Covers `antora.yml`, `modules/ROOT/pages/`, `modules/ROOT/nav.adoc`, `modules/ROOT/images/`, and how to register a specification with the RISC-V documentation site by submitting a pull request to [riscv-admin/antora-dev.riscv.org](https://github.com/riscv-admin/antora-dev.riscv.org). Includes content-source entry format, chapter numbering rules configuration, branch naming conventions, and Antora installation instructions. | ||
|
|
||
| ### Modified files | ||
|
|
||
| **`src/docs-dev-guide.adoc`** | ||
| - Added `include::antora-structure.adoc[]` between `authoring.adoc` and `a_few_basics.adoc`. | ||
|
|
||
| **`src/authoring.adoc`** | ||
| - Updated repository reference from `docs-templates` to `docs-spec-template`. | ||
| - Replaced stale `asciidoctor book_header.adoc` quick-build command with the correct entry point (`asciidoctor modules/ROOT/pages/spec-sample.adoc`) and a `make` alternative. | ||
| - Updated description of template repo to reflect Antora-based directory structure. | ||
|
|
||
| **`src/a_few_basics.adoc`** | ||
| - Updated two references to `book_header.adoc` (lines 91 and 334) to `modules/ROOT/pages/spec-sample.adoc` in the docs-spec-template repo. | ||
|
|
||
| **`src/build-infrastructure.adoc`** | ||
| - Added `=== Source directory` subsection noting that `SRC_DIR` is now `modules/ROOT/pages/` and cross-referencing the antora-structure section. | ||
| - Added `[[spec-types]]` subsection distinguishing ISA specifications (authored on a branch/fork of riscv-isa-manual) from non-ISA specifications (authored in an autonomous repository using docs-spec-template). | ||
| - Added `[[spec-lifecycle]]` section defining the four specification states (Draft, Stable, Frozen, Ratified) with `:revremark:` examples and a link to `riscv.org/spec-state`. | ||
| - Documented that state advancement is entirely manual — no automation promotes a specification between states. | ||
| - Documented the non-ISA release process using the `workflow_dispatch` GitHub Actions trigger, including the `revision_mark` input and a note on keeping it consistent with `:revremark:` in the source. | ||
| - Documented that ISA specification state is managed within the relevant chapter(s) of the riscv-isa-manual branch where the author is working. | ||
|
|
||
| **`src/intro.adoc`** | ||
| - Added `[[getting-help]]` subsection consolidating help resources: `sig-documentation` mailing list, `help@riscv.org`, docs-dev-guide GitHub issues, and antora-dev.riscv.org GitHub issues. | ||
|
|
||
| **`local_build.md`** | ||
| - Updated `## AsciiDoc book headers and styles` section to reference `modules/ROOT/pages/spec-sample.adoc` as the document entry point and `docs-resources/global-config.adoc` for shared attributes. | ||
| - Updated `## Create and name a new .adoc file` to reflect the Antora workflow: new files go in `modules/ROOT/pages/`, are included in `spec-sample.adoc` for the PDF build, and registered in `modules/ROOT/nav.adoc` for the Antora site. | ||
| - Updated `## HTML build` section to use `make` and the correct entry point (`modules/ROOT/pages/spec-sample.adoc`) in place of stale `book_header.adoc` references. | ||
| - Added `## Antora site build` section covering `make antora`, output location, and Antora installation (`npm install -g antora`). | ||
| - Added `## Run a local Kroki server for diagrams` section with the Docker run command (`docker run -d -p 9870:8000 yuzutech/kroki`), a stop command, and a note that the dev playbook is already configured for `localhost:9870`. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,162 @@ | ||
| [[antora-structure]] | ||
| == Antora repository structure | ||
|
|
||
| RISC-V specification repositories use an https://docs.antora.org[Antora]-compatible directory structure. This enables individual specification repositories to be assembled into the RISC-V documentation site by Antora while also supporting a standalone PDF and HTML build via `make`. | ||
|
Check failure on line 4 in src/antora-structure.adoc
|
||
|
|
||
| === Repository layout | ||
|
|
||
| A specification repository contains the following top-level files and directories: | ||
|
|
||
| ---- | ||
| antora.yml <1> | ||
| Makefile <2> | ||
| docs-resources/ <3> | ||
| modules/ | ||
| ROOT/ | ||
| nav.adoc <4> | ||
| images/ <5> | ||
| pages/ <6> | ||
| spec-sample.adoc | ||
| intro.adoc | ||
| chapter2.adoc | ||
| example.bib <7> | ||
| ... | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. add resources for bibliographies?
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also partials? I know I know - not many have wavedrom files. but still....
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yep, added that in with my last push. |
||
| partials/ <8> | ||
| ---- | ||
| <1> Antora component descriptor — identifies this repo as an Antora component and provides component metadata and configuration. | ||
|
Check failure on line 26 in src/antora-structure.adoc
|
||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. antora.yml - An antora component descriptor that identifies ... |
||
| <2> Makefile — drives the PDF/HTML build. | ||
|
Check failure on line 27 in src/antora-structure.adoc
|
||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it doesn't though? Maybe for local PDFs and the weird HTML, but you are implying that Makefile controls all the build stuff. Are we recommending that people use the Makefile for building PDFs still?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. From Antora's POV the antora.yml is what makes it a component to be targetted. However, Make is still the way to build. |
||
| <3> Git submodule providing shared fonts, themes, and images. | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. docs-resources - Git submodule....
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure I understand what you mean. |
||
| <4> Navigation file — defines the sidebar structure for the Antora site. | ||
|
Check failure on line 29 in src/antora-structure.adoc
|
||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nav.adoc - The navigation file that defines.... |
||
| <5> Symlink to `docs-resources/images` so Antora can find shared images. | ||
|
Check failure on line 30 in src/antora-structure.adoc
|
||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it is? I also put shared images into the common assets folder in antora-dev.riscv.org
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I thought you also put any graphics for the topic in here.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess some of this only applies to ISA content, which would already be convered by the fact that you branch the ISA repo to develop a new ISA spec. |
||
| <6> All AsciiDoc source files live here. | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Pages directory - all AsciiDoc source files live here. |
||
| <7> BibTeX bibliography file. Referenced by `spec-sample.adoc` via the `:bibtex-file:` attribute. | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. doesn't this go in resources folder? |
||
| <8> Optional directory for reusable AsciiDoc fragments (partials), such as Wavedrom diagram source files or content shared across chapters. Reference partials with `include::partial$filename.adoc[]`. | ||
|
Check failure on line 33 in src/antora-structure.adoc
|
||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. partials - optional directory .... |
||
|
|
||
| === antora.yml | ||
|
|
||
| The `antora.yml` file at the repository root is the Antora https://docs.antora.org/antora/latest/component-version-descriptor/[component descriptor]. It serves two purposes: it identifies the repository as an Antora content component, and it provides the component metadata and configuration (name, title, version, navigation, and AsciiDoc attributes) used when the documentation site is assembled. | ||
|
Check failure on line 37 in src/antora-structure.adoc
|
||
|
|
||
| [source,yaml] | ||
| ---- | ||
| name: spec-sample <1> | ||
| title: RISC-V Example Specification (Zexmpl) <2> | ||
| version: ~ <3> | ||
| nav: | ||
| - modules/ROOT/nav.adoc <4> | ||
| ---- | ||
| <1> Component name — used in Antora cross-references from other components (`xref:spec-sample:page.adoc[]`). Rename to match your specification. | ||
|
Check failure on line 47 in src/antora-structure.adoc
|
||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. also becomes the name in the URL so be specific.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. plus match what? I'm not sure what they are matching to? |
||
| <2> Human-readable title shown in the site UI. Update this for your specification. | ||
| <3> `~` means unversioned. Set to a version string (e.g., `1.0`) once the specification is released. | ||
|
Check failure on line 49 in src/antora-structure.adoc
|
||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. they should be using some sort of version here though? |
||
| <4> Path to the navigation file, relative to `antora.yml`. | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if they use the correct set up, this should always be the same. |
||
|
|
||
| When creating a new specification repository from the template, at minimum rename `name` and `title` to match your specification. | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. rather than at minimum, tell them to set the name, title, and version... Versions should be probably set as "frozen" "development" or "stable" or whatever we decide. They should also include a page-group. asciidoc: |
||
|
|
||
| === modules/ROOT/pages/ | ||
|
|
||
| All AsciiDoc source files live in `modules/ROOT/pages/`. This is the Antora convention for the default (ROOT) module's page content. | ||
|
Check failure on line 56 in src/antora-structure.adoc
|
||
|
|
||
| The entry point for the standalone PDF and HTML build is `spec-sample.adoc`, which uses AsciiDoc `include::` directives to pull in the other chapter files. For the Antora site build, each file in `pages/` becomes a separate HTML page. | ||
|
Check failure on line 58 in src/antora-structure.adoc
|
||
|
|
||
| When adding a new chapter: | ||
|
|
||
| . Create the `.adoc` file in `modules/ROOT/pages/`. | ||
| . Add an `include::` directive for it in `spec-sample.adoc` (for the PDF build). | ||
| . Add an `xref:` entry for it in `modules/ROOT/nav.adoc` (for the Antora site build). | ||
|
Check failure on line 64 in src/antora-structure.adoc
|
||
|
|
||
| === modules/ROOT/nav.adoc | ||
|
|
||
| The `nav.adoc` file defines the navigation sidebar shown in the Antora site. It uses a nested list of `xref:` macros. | ||
|
Check failure on line 68 in src/antora-structure.adoc
|
||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. sidebar is confusing because that makes me think of the right nav, which is controlled by the headings on the page. |
||
|
|
||
| [source,adoc] | ||
| ---- | ||
| * xref:spec-sample.adoc[RISC-V Example Specification] | ||
| ** xref:intro.adoc[Introduction] | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. very few of them actually nest. We just made them flat. |
||
| ** xref:chapter2.adoc[The Second Chapter] | ||
| ** xref:contributors.adoc[Contributors] | ||
| ** xref:bibliography.adoc[Bibliography] | ||
| ---- | ||
|
|
||
| Add a new entry here each time you add a chapter to `pages/`. The order of entries controls the sidebar order. | ||
|
|
||
| === modules/ROOT/images/ | ||
|
|
||
| This directory is a symlink to `docs-resources/images`, which contains the shared RISC-V logo and other common images. Antora requires images to be located within the module directory tree, which is why the symlink exists rather than referencing `docs-resources/` directly. | ||
|
Check failure on line 83 in src/antora-structure.adoc
|
||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think this is true. |
||
|
|
||
| Place any specification-specific images in this directory alongside the symlinked shared images, or manage them via the symlink target in `docs-resources/`. | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. for all jpg, png, and svg (with svg being the preferred). They don't need to include the risc-v logo because that is in the common-assets folder in antora-dev. But not sure how they are going to get that building locally. |
||
|
|
||
| [[dev-playbook]] | ||
| === Publishing to the RISC-V documentation site | ||
|
|
||
| The RISC-V documentation site is assembled from all specification repositories by a central Antora playbook maintained at https://github.com/riscv-admin/antora-dev.riscv.org[riscv-admin/antora-dev.riscv.org]. Specification authors do not manage their own playbook — instead, they submit a pull request to that repository to register their specification as a content source. | ||
|
Check failure on line 90 in src/antora-structure.adoc
|
||
|
|
||
| ==== Naming your branch | ||
|
|
||
| By convention, Antora-ready branches are named with the version and an `-antora` suffix: | ||
|
|
||
| ---- | ||
| v1.0-antora | ||
| v20250312-antora | ||
| ---- | ||
|
|
||
| Create this branch from your specification's release tag or working branch once the Antora directory structure is in place. | ||
|
Check failure on line 101 in src/antora-structure.adoc
|
||
|
|
||
| ==== Adding a content source | ||
|
|
||
| In the playbook at `antora/antora-playbook.yml`, add an entry to the `content.sources` list. Use an existing entry as a model and follow the comment convention used throughout the file: | ||
|
|
||
| [source,yaml] | ||
| ---- | ||
| # My Specification — component: my-spec | chapters 5–12 | ||
| - url: https://github.com/riscv/my-spec.git | ||
| branches: [v1.0-antora] | ||
| start_page: ROOT::index.adoc | ||
| start_path: / | ||
| worktrees: true | ||
| submodules: true | ||
| ---- | ||
|
|
||
| The `component` name in the comment must match the `name` field in your `antora.yml`. Set `submodules: true` if your repository uses git submodules (e.g., `docs-resources`). Set `worktrees: true` if your repository contains symlinks. | ||
|
|
||
| ==== Adding numbering rules | ||
|
|
||
| The playbook uses custom extensions to number chapters and appendices in the site navigation. Add a corresponding entry for your specification to both the `nav_numbering_extension` and `section_numbering_extension` blocks. Both blocks share the same rules via a YAML anchor (`&numbering_rules` / `*numbering_rules`), so you only need to add your entry once, in the `nav_numbering_extension` block: | ||
|
Check failure on line 122 in src/antora-structure.adoc
|
||
|
|
||
| [source,yaml] | ||
| ---- | ||
| # --- My Specification -------------------------------------------------- | ||
| - component: my-spec <1> | ||
| module: ROOT <2> | ||
| branches: ['v1.0-antora'] <3> | ||
| chapters: {start: 5, end: 12} <4> | ||
| appendices: {start: 13, end: 14} <5> | ||
| ---- | ||
| <1> Must match the `name` in your `antora.yml`. | ||
| <2> Use `ROOT` for single-module specifications (the standard case). | ||
| <3> Must match the branch name(s) listed in your `content.sources` entry. | ||
| <4> The range of nav entries (top-level `*` items in `nav.adoc`) that are numbered chapters. Count from the first entry in `nav.adoc` — entries before your first chapter (e.g., a preface or overview page) are typically at position 1–4. | ||
| <5> Omit this line entirely if your specification has no appendices. | ||
|
Check failure on line 137 in src/antora-structure.adoc
|
||
|
|
||
| ==== Submitting the pull request | ||
|
|
||
| . Fork or branch https://github.com/riscv-admin/antora-dev.riscv.org[riscv-admin/antora-dev.riscv.org]. | ||
| . Add your content source and numbering rules to `antora/antora-playbook.yml` as described above. | ||
| . Open a pull request against the `main` branch with a brief description of the specification being added. | ||
|
|
||
| [[install-antora]] | ||
| === Installing Antora | ||
|
|
||
| Antora is needed to run a local site preview. It requires Node.js version 18 or later. Once Node.js is installed, install Antora globally: | ||
|
Check failure on line 148 in src/antora-structure.adoc
|
||
|
|
||
| [source,cmd] | ||
| ---- | ||
| npm install -g antora | ||
| ---- | ||
|
|
||
| Verify the installation: | ||
|
|
||
| [source,cmd] | ||
| ---- | ||
| antora --version | ||
| ---- | ||
|
|
||
| For Node.js installation instructions, see https://nodejs.org/en/download/[nodejs.org]. | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd just kill this. We want svg files. They can suck it up and start creating them.