Skip to content

Commit e57d616

Browse files
apazoscmuellner
authored andcommitted
Migration to RISC-V specifications template in asciidoc
1 parent 016d2ce commit e57d616

18 files changed

+1255
-711
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build/*

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "docs-resources"]
2+
path = docs-resources
3+
url = https://github.com/riscv/docs-resources.git

.pre-commit-config.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
repos:
3+
- repo: https://github.com/pre-commit/pre-commit-hooks
4+
rev: v4.5.0
5+
hooks:
6+
- id: check-json
7+
- id: check-symlinks
8+
- id: check-yaml
9+
- id: end-of-file-fixer
10+
- id: trailing-whitespace
11+
args: [--markdown-linebreak-ext=md]
12+
13+
- repo: local
14+
hooks:
15+
- id: forbidden-file-extensions
16+
name: forbidden-file-extensions
17+
entry: disallow these file extensions
18+
language: fail
19+
# Disallow other asciidoc extensions except .adoc
20+
files: .*\.(asciidoc|asc)$
21+
22+
- repo: https://github.com/jumanjihouse/pre-commit-hook-yamlfmt
23+
rev: 0.2.3
24+
hooks:
25+
- id: yamlfmt
26+
args: [--mapping, '2', --sequence, '4', --offset, '2']

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [Unreleased]

CODE_OF_CONDUCT.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# RISC-V Code of Conduct
2+
All RISC-V International projects are governed by the RISC-V Code of Conduct found at https://riscv.org/community/community-code-of-conduct/.

CONTRIBUTING.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Contribution Guidelines
2+
3+
As an open-source project, we appreciate and encourage community members to submit patches directly to the project. To maintain a well-organized development environment, we have established standards and methods for submitting changes. This document outlines the process for submitting patches to the project, ensuring that your contribution is swiftly incorporated into the codebase.
4+
5+
# Licensing
6+
7+
Licensing is crucial for open-source projects, as it guarantees that the software remains available under the conditions specified by the author.
8+
9+
This project employs the Creative Commons Attribution 4.0 International license, which can be found in the LICENSE file within the project's repository.
10+
11+
Licensing defines the rights granted to you as an author by the copyright holder. It is essential for contributors to fully understand and accept these licensing rights. In some cases, the copyright holder may not be the contributor, such as when the contributor is working on behalf of a company.
12+
13+
# Developer Certificate of Origin (DCO)
14+
To uphold licensing criteria and demonstrate good faith, this project mandates adherence to the Developer Certificate of Origin (DCO) process.
15+
16+
The DCO is an attestation appended to every contribution from each author. In the commit message of the contribution (explained in greater detail later in this document), the author adds a Signed-off-by statement, thereby accepting the DCO.
17+
18+
When an author submits a patch, they affirm that they possess the right to submit the patch under the designated license. The DCO agreement is displayed below and at https://developercertificate.org.
19+
20+
21+
Developer's Certificate of Origin 1.1
22+
23+
By making a contribution to this project, I certify that:
24+
25+
(a) The contribution was created in whole or in part by me and I
26+
have the right to submit it under the open source license
27+
indicated in the file; or
28+
29+
(b) The contribution is based upon previous work that, to the best
30+
of my knowledge, is covered under an appropriate open source
31+
license and I have the right under that license to submit that
32+
work with modifications, whether created in whole or in part
33+
by me, under the same open source license (unless I am
34+
permitted to submit under a different license), as indicated
35+
in the file; or
36+
37+
(c) The contribution was provided directly to me by some other
38+
person who certified (a), (b), or (c), and I have not modified
39+
it.
40+
41+
(d) I understand and agree that this project and the contribution
42+
are public and that a record of the contribution (including all
43+
personal information I submit with it, including my sign-off) is
44+
maintained indefinitely and may be redistributed consistent with
45+
this project or the open source license(s) involved.
46+
47+
# DCO Sign-Off Methods
48+
The DCO necessitates the inclusion of a sign-off message in the following format for each commit within the pull request:
49+
50+
Signed-off-by: Stephano Cetola <[email protected]>
51+
52+
Please use your real name in the sign-off message.
53+
54+
You can manually add the DCO text to your commit body or include either -s or --signoff in your standard Git commit commands. If you forget to incorporate the sign-off, you can also amend a previous commit with the sign-off by executing git commit --amend -s. If you have already pushed your changes to GitHub, you will need to force push your branch afterward using git push -f.
55+
56+
Note:
57+
58+
Ensure that the name and email address associated with your GitHub account match the name and email address in the Signed-off-by line of your commit message.

GOVERNANCE.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Governance
2+
This project is governed by the Toolchains SIG.
3+
4+
The group can be joined by RISC-V members at: https://lists.riscv.org/g/sig-toolchains.
5+
6+
Mailing list archives are available at: https://lists.riscv.org/g/sig-toolchains/topics.
7+
8+
Community meetings schedule at: https://tech.riscv.org/calendar.

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ exhaustive, and do not form part of our licenses.
4949
such as asking that all changes be marked or described.
5050
Although not required by our licenses, you are encouraged to
5151
respect those requests where reasonable. More_considerations
52-
for the public:
52+
for the public:
5353
wiki.creativecommons.org/Considerations_for_licensees
5454

5555
=======================================================================

MAINTAINERS.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Maintainers
2+
This project is maintained by the following people:
3+
4+
- Christoph Müllner ([cmuellner](https://github.com/cmuellner))
5+
- Ana Pazos ([apazos](https://github.com/apazos))

Makefile

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# Makefile for RISC-V C API Specification.
2+
#
3+
# This work is licensed under the Creative Commons Attribution-ShareAlike 4.0
4+
# International License. To view a copy of this license, visit
5+
# http://creativecommons.org/licenses/by-sa/4.0/ or send a letter to
6+
# Creative Commons, PO Box 1866, Mountain View, CA 94042, USA.
7+
#
8+
# SPDX-License-Identifier: CC-BY-SA-4.0
9+
#
10+
# Description:
11+
#
12+
# This Makefile is designed to automate the process of building and packaging
13+
# the RISC-V C API Specification.
14+
15+
DOCS := \
16+
riscv-c-api.adoc
17+
18+
DATE ?= $(shell date +%Y-%m-%d)
19+
DOCKER_IMG := riscvintl/riscv-docs-base-container-image:latest
20+
21+
ifneq ($(SKIP_DOCKER),true)
22+
DOCKER_CMD := docker run --rm -v ${PWD}:/build -w /build \
23+
${DOCKER_IMG} \
24+
/bin/sh -c
25+
DOCKER_QUOTE := "
26+
endif
27+
28+
SRC_DIR := src
29+
BUILD_DIR := build
30+
31+
DOCS_PDF := $(DOCS:%.adoc=%.pdf)
32+
DOCS_HTML := $(DOCS:%.adoc=%.html)
33+
34+
XTRA_ADOC_OPTS :=
35+
ASCIIDOCTOR_PDF := asciidoctor-pdf
36+
ASCIIDOCTOR_HTML := asciidoctor
37+
OPTIONS := --trace \
38+
-a compress \
39+
-a revdate=${DATE} \
40+
-a pdf-style=docs-resources/themes/risc-v_spec-pdf.yml \
41+
-a pdf-fontsdir=docs-resources/fonts \
42+
$(XTRA_ADOC_OPTS) \
43+
-D build \
44+
--failure-level=ERROR
45+
REQUIRES := --require=asciidoctor-lists
46+
47+
.PHONY: all build clean build-container build-no-container build-docs
48+
49+
all: build
50+
51+
build-docs: $(DOCS_PDF) $(DOCS_HTML)
52+
53+
vpath %.adoc $(SRC_DIR)
54+
55+
%.pdf: %.adoc
56+
$(DOCKER_CMD) $(DOCKER_QUOTE) $(ASCIIDOCTOR_PDF) $(OPTIONS) $(REQUIRES) $< $(DOCKER_QUOTE)
57+
58+
%.html: %.adoc
59+
$(DOCKER_CMD) $(DOCKER_QUOTE) $(ASCIIDOCTOR_HTML) $(OPTIONS) $(REQUIRES) $< $(DOCKER_QUOTE)
60+
61+
build:
62+
@echo "Checking if Docker is available..."
63+
@if command -v docker >/dev/null 2>&1 ; then \
64+
echo "Docker is available, building inside Docker container..."; \
65+
$(MAKE) build-container; \
66+
else \
67+
echo "Docker is not available, building without Docker..."; \
68+
$(MAKE) build-no-container; \
69+
fi
70+
71+
build-container:
72+
@echo "Starting build inside Docker container..."
73+
$(MAKE) build-docs
74+
@echo "Build completed successfully inside Docker container."
75+
76+
build-no-container:
77+
@echo "Starting build..."
78+
$(MAKE) SKIP_DOCKER=true build-docs
79+
@echo "Build completed successfully."
80+
81+
# Update docker image to latest
82+
docker-pull-latest:
83+
docker pull ${DOCKER_IMG}
84+
85+
clean:
86+
@echo "Cleaning up generated files..."
87+
rm -rf $(BUILD_DIR)
88+
@echo "Cleanup completed."

0 commit comments

Comments
 (0)