From ca300998d6800cc29b95d4e138739e55f9629c72 Mon Sep 17 00:00:00 2001 From: Jeff Scheel Date: Tue, 25 Jan 2022 12:30:58 -0500 Subject: [PATCH] Convert project to RISC-V template (#84) Signed-off-by: Jeff Scheel --- .gitmodules | 3 +++ Makefile | 10 ++++++++-- README.adoc | 33 ++++++++++++++++++++++++++++++++ docs-resources | 1 + riscv-sbi.adoc | 51 ++++++++++++++++++++++++++++++++++++++++++++++---- 5 files changed, 92 insertions(+), 6 deletions(-) create mode 100644 .gitmodules create mode 160000 docs-resources diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..cde1eb5 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "docs-resources"] + path = docs-resources + url = https://github.com/riscv/docs-resources.git diff --git a/Makefile b/Makefile index 044dd89..378be4a 100644 --- a/Makefile +++ b/Makefile @@ -3,6 +3,7 @@ # ASCIIDOCTOR = asciidoctor +ASCIIDOCTOR_PDF = $(ASCIIDOCTOR)-pdf DITAA = ditaa IMAGES = riscv-sbi-intro1.png IMAGES += riscv-sbi-intro2.png @@ -20,8 +21,13 @@ all: $(IMAGES) $(TARGETS) %.html: %.adoc $(IMAGES) $(ASCIIDOCTOR) -d book -b html $< -%.pdf: %.adoc $(IMAGES) riscv-sbi-theme.yml - $(ASCIIDOCTOR) -d book -r asciidoctor-pdf -a pdf-style=riscv-sbi-theme.yml -b pdf $< +%.pdf: %.adoc $(IMAGES) docs-resources/themes/riscv-pdf.yml + $(ASCIIDOCTOR_PDF) \ + -a toc \ + -a compress \ + -a pdf-style=docs-resources/themes/riscv-pdf.yml \ + -a pdf-fontsdir=docs-resources/fonts \ + -o $@ $< .PHONY: clean clean: diff --git a/README.adoc b/README.adoc index 9b5ef04..7f762a1 100644 --- a/README.adoc +++ b/README.adoc @@ -22,6 +22,39 @@ The files in this repository are licensed under the Creative Commons Attribution 4.0 International License (CC-BY 4.0). The full license text is available at https://creativecommons.org/licenses/by/4.0/. += Dependencies +The PDF built in this project uses AsciiDoctor (Ruby). For more information +on AsciiDoctor, specification guidelines, or building locally, see the +https://github.com/riscv/docs-dev-guide[RISC-V Documentation Developer Guide]. + += Cloning the Project +This project uses +https://git-scm.com/book/en/v2/Git-Tools-Submodules[GitHub Submodules] to +include the RISC-V +https://github.com/riscv/docs-resources[docs-resources project] +to achieve a common look and feel. + +When cloning this repository for the first time, you must either use +`git clone --recurse-submodules` or execute `git submodule init` and +`git submodule update` after the clone to populate the `docs-resources` +directory. Failure to clone the submodule, will result in the PDF build +fail with an error message like the following: + +.... +$ make +asciidoctor-pdf \ +-a toc \ +-a compress \ +-a pdf-style=docs-resources/themes/riscv-pdf.yml \ +-a pdf-fontsdir=docs-resources/fonts \ +--failure-level=ERROR \ +-o profiles.pdf profiles.adoc +asciidoctor: ERROR: could not locate or load the built-in pdf theme `docs-resources/themes/riscv-pdf.yml'; reverting to default theme +No such file or directory - notoserif-regular-subset.ttf not found in docs-resources/fonts + Use --trace for backtrace +make: *** [Makefile:7: profiles.pdf] Error 1 +.... + = Building Documents The final specification in form of PDF and HTML can be generated using diff --git a/docs-resources b/docs-resources new file mode 160000 index 0000000..6a2d5b1 --- /dev/null +++ b/docs-resources @@ -0,0 +1 @@ +Subproject commit 6a2d5b1f929e0e25df0c832b522ed1fc0c78e325 diff --git a/riscv-sbi.adoc b/riscv-sbi.adoc index 4b876a9..196baf2 100644 --- a/riscv-sbi.adoc +++ b/riscv-sbi.adoc @@ -1,12 +1,50 @@ // SPDX-License-Identifier: CC-BY-4.0 +[[riscv-doc-template]] +:description: RISC-V SBI definition specification +:company: RISC-V +:revdate: February 4, 2022 +:revnumber: 1.0-rc2 +:revremark: This document is in Frozen state. Change is extremely unlikely. +:url-riscv: http://riscv.org +:doctype: book +:preface-title: Preamble +:colophon: +:appendix-caption: Appendix +:title-logo-image: image:docs-resources/images/risc-v_logo.svg[pdfwidth=3.25in,align=center] +// Settings: +:experimental: +:reproducible: +:WaveDromEditorApp: wavedrom-cli +:icons: font +:lang: en +:listing-caption: Listing +:sectnums: +:sectnumlevels: 5 +:toclevels: 5 +:toc: left +:source-highlighter: pygments +ifdef::backend-pdf[] +:source-highlighter: coderay +endif::[] +:data-uri: +:hide-uri-scheme: +:stem: latexmath +:footnote: +:xrefstyle: short = RISC-V Supervisor Binary Interface Specification :author: RISC-V Platform Specification Task Group :email: tech-unixplatformspec@lists.riscv.org -:revnumber: 1.0-rc1 -:sectnums: -:xrefstyle: short -:toc: macro + +// Preamble +[WARNING] +.This document is in the link:http://riscv.org/spec-state[Frozen state] +==== +Change is extremely unlikely. A high threshold will be used, and a change +will only occur because of some truly critical issue being identified during +the public review cycle. Any other desired or needed changes can be the subject +of a follow-on new extension. +==== // table of contents toc::[] @@ -27,6 +65,11 @@ https://creativecommons.org/licenses/by/4.0/. [preface] == Change Log +=== Version 1.0-rc2 +* Update to RISC-V formatting +* Improved the introduction +* Removed all references to RV32 + === Version 1.0-rc1 * A typo fix