Thanks for your interest in contributing! This guide covers how to set up your environment, build locally, and submit changes.
This repository uses the docs-resources submodule.
git clone --recurse-submodules https://github.com/riscv/riscv-isa-manual.gitIf you already cloned the repo, initialize the submodules:
git submodule update --init --recursiveBuilding with the container is the most consistent approach.
- Install Docker (or Podman).
- Pull the base image:
docker pull riscvintl/riscv-docs-base-container-image:latestLocal builds are available, but require the full documentation toolchain (Ruby, Asciidoctor, and related extensions). Follow the dependency list in the RISC-V Documentation Developer Guide:
https://github.com/riscv/docs-dev-guide
From the repo root:
make -j2 buildNOTE: If you have a powerful machine with lots of RAM you can use -j4 or higher parallelism settings, however, -j2 is optimal for most machines.
Common targets:
make build-pdf
make build-html
make build-epubNOTE: For local development, it's recommended to target build-html throughout your development process. The HTML output is the priority format and generating the PDF consumes considerable resources increasing build time to over 8 minutes typically.
When iterating on spec changes locally, you can significantly speed up incremental rebuilds by using:
make build-html UNRELIABLE_BUT_FASTER_INCREMENTAL_BUILDS=1This skips the clean-workdir step between builds, so unchanged files are not reprocessed. As the name implies, this is not guaranteed to catch all changes in every scenario — use a clean build (make build-html) before opening a PR.
Outputs land in the build/ directory.
make build-changebar-pdf builds the normal manual with a red bar in the left
margin next to everything the current branch changed. It is fully automatic —
the bars are derived from git diff, so no source annotation is needed and it
works for any branch with any mix of additions, edits, and deletions.
make build-changebar-pdf # vs origin/main (merge base)
make build-changebar-pdf CHANGEBAR_BASE=v2.0 # vs any ref/tag/commitThe comparison uses the merge base with CHANGEBAR_BASE (default origin/main),
i.e. everything the branch changed since it forked, and includes uncommitted
working-tree edits so you can preview before committing. Output:
build/riscv-spec-changebar.pdf.
How it works: scripts/gen-changebar-diff.sh emits the changed .adoc line
ranges as JSON (git runs on the host, not in the build container), and
src/lib/changebar.rb uses Asciidoctor's --sourcemap to tag the affected
blocks and draw the bars.
- Create a branch for your change.
- Keep commits focused and include clear messages.
- Run the relevant build target(s) before opening a PR.
- Sign off your commit with
git commit -sor addgit config --global format.signOff trueto your global git config. - Open a pull request with a short summary of what changed and why.
- Run the relevant build target(s), such as
make build,make build-pdf, ormake build-html. - Add or update references/citations in
src/resources/riscv-spec.bibwhen needed. - Under development by the Documentation SIG: Normative Rules and Antora integration.
src/is the canonical AsciiDoc content used bymakebuilds.src/riscv-spec.adocis the entry point that includes volume files (e.g.unpriv.adocandpriv.adoc).modules/contains the Antora site sources.modules/unpriv/pagesandmodules/priv/pagesmirror chapter files for the site, andmodules/*/nav.adoccontrols navigation.docs-resources/is a submodule with shared themes, converters, schemas, and tooling.normative_rule_defs/contains one YAML definition file per chapter for normative rules.build/is generated output.
NOTE: New RISC-V specifications may only be developed by RISC-V International members through the formal ratification process and in accordance with the applicable Technical Steering Committee policies. Specifications cannot be introduced arbitrarily or by submitting an unsolicited pull request.
- Create
src/<extension>.adocwith the new chapter content. - Add an
include::line in the appropriate volume (e.g.src/unpriv.adocorsrc/priv.adoc) in the correct order.
All contributions must be signed with a Signed-off-by: Name <email> and a cryptographic key using either SSH (recommended) or GPG.
This can be achieved with git commit -s or automating it by adding git config --global format.signOff true to your global git config file.
Note that the Developer's Certificate of Origin bot that RISC-V employs across all of it's repositories requires the Signed-off-by: trailer exists. If it's missing, Pull Requests will fail the DCO Check and will not be accepted.
In addition to adding the DCO Signed-off-by line to your commits, your commits must be signed with your private key, and your public key must be uploaded to GitHub as a signing key.
ssh-keygen -t ed25519 -C "your_email@example.com"
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_ed25519cat ~/.ssh/id_ed25519.pubGitHub → Settings → SSH and GPG keys → New SSH key Key type: Signing key
git config --global gpg.format ssh
git config --global user.signingkey ~/.ssh/id_ed25519.pub
git config --global commit.gpgsign truegit commit -m "message"git log --show-signature -1For a comprehensive guide, see GitHub's documentation on telling Git about your signing key.
- macOS:
brew install gnupg- Ubuntu/Debian:
sudo apt-get install gnupg- Windows: Install Gpg4win
gpg --full-generate-keySelect RSA and RSA, 4096 bits, and enter your name and email (must match your GitHub account email).
gpg --list-secret-keys --keyid-format=longThe key ID is the hex string after sec rsa4096/ on the sec line. For example, if the output shows sec rsa4096/3AA5C34371567BD2, then 3AA5C34371567BD2 is your key ID.
git config --global user.signingkey YOUR_KEY_ID
git config --global commit.gpgsign trueReplace 3AA5C34371567BD2 with your actual key ID from step 3.
gpg --armor --export YOUR_KEY_IDCopy the entire output (including -----BEGIN PGP PUBLIC KEY BLOCK----- and -----END PGP PUBLIC KEY BLOCK-----).
GitHub → Settings → SSH and GPG keys → New GPG key → paste the public key.
git commit -m "message"git log --show-signature -1