From c1c72cbcfcbb90b903ae235dbaaec863d69d5015 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gracia=20P=C3=A9rez?= <50202128+dgptha@users.noreply.github.com> Date: Tue, 26 Nov 2024 18:38:26 +0100 Subject: [PATCH 1/4] Execute docker with user and group ids --- Makefile | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/Makefile b/Makefile index 2873286..850010e 100644 --- a/Makefile +++ b/Makefile @@ -20,19 +20,20 @@ VERSION ?= v0.0.0 REVMARK ?= Draft DOCKER_IMG := riscvintl/riscv-docs-base-container-image:latest ifneq ($(SKIP_DOCKER),true) - DOCKER_IS_PODMAN = \ - $(shell ! docker -v 2>&1 | grep podman >/dev/null ; echo $$?) - ifeq "$(DOCKER_IS_PODMAN)" "1" - DOCKER_VOL_SUFFIX = :z - endif - - DOCKER_CMD := \ - docker run --rm \ - -v ${PWD}:/build${DOCKER_VOL_SUFFIX} \ - -w /build \ - ${DOCKER_IMG} \ - /bin/sh -c - DOCKER_QUOTE := " + DOCKER_IS_PODMAN = \ + $(shell ! docker -v 2>&1 | grep podman >/dev/null ; echo $$?) + ifeq "$(DOCKER_IS_PODMAN)" "1" + DOCKER_VOL_SUFFIX = :z + endif + + DOCKER_CMD := \ + docker run --rm \ + -u `id -u`:`id -g` \ + -v ${PWD}:/build${DOCKER_VOL_SUFFIX} \ + -w /build \ + ${DOCKER_IMG} \ + /bin/sh -c + DOCKER_QUOTE := " endif SRC_DIR := src From c69bfb1304fa871b53545d933666b14d485aeb59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gracia=20P=C3=A9rez?= <50202128+dgptha@users.noreply.github.com> Date: Tue, 26 Nov 2024 18:42:14 +0100 Subject: [PATCH 2/4] Generate images in build folder The images generated by asciidoctor are now built into the created 'build' folder, more concretely in 'build/images'. Inside the 'build' folder the documents are now placed inside 'build/adoc' (previously they were created in 'build'). --- Makefile | 35 ++++++++++++++++++++++------------- src/fusa-whitepaper.adoc | 1 + 2 files changed, 23 insertions(+), 13 deletions(-) diff --git a/Makefile b/Makefile index 850010e..30e5d24 100644 --- a/Makefile +++ b/Makefile @@ -46,20 +46,29 @@ XTRA_ADOC_OPTS := ASCIIDOCTOR_PDF := asciidoctor-pdf ASCIIDOCTOR_HTML := asciidoctor OPTIONS := --trace \ - -a compress \ - -a mathematical-format=svg \ - -a revnumber=${VERSION} \ - -a revremark=${REVMARK} \ - -a revdate=${DATE} \ - -a pdf-fontsdir=docs-resources/fonts \ - -a pdf-theme=docs-resources/themes/riscv-pdf.yml \ - $(XTRA_ADOC_OPTS) \ - -D build \ - --failure-level=ERROR + -a compress \ + -a mathematical-format=svg \ + -a revnumber=${VERSION} \ + -a revremark=${REVMARK} \ + -a revdate=${DATE} \ + -a imagesoutdir=${BUILD_DIR}/images \ + -a pdf-fontsdir=docs-resources/fonts \ + -a pdf-theme=docs-resources/themes/riscv-pdf.yml \ + $(XTRA_ADOC_OPTS) \ + -D ${BUILD_DIR}/adoc \ + --failure-level=ERROR REQUIRES := --require=asciidoctor-bibtex \ - --require=asciidoctor-diagram \ - --require=asciidoctor-lists \ - --require=asciidoctor-mathematical + -a compress \ + -a mathematical-format=svg \ + -a revnumber=${VERSION} \ + -a revremark=${REVMARK} \ + -a revdate=${DATE} \ + -a imagesoutdir=${BUILD_DIR}/images \ + -a pdf-fontsdir=docs-resources/fonts \ + -a pdf-theme=docs-resources/themes/riscv-pdf.yml \ + $(XTRA_ADOC_OPTS) \ + -D ${BUILD_DIR}/adoc \ + --failure-level=ERROR .PHONY: all build clean build-container build-no-container build-docs diff --git a/src/fusa-whitepaper.adoc b/src/fusa-whitepaper.adoc index 95e08be..71d7b7e 100644 --- a/src/fusa-whitepaper.adoc +++ b/src/fusa-whitepaper.adoc @@ -17,6 +17,7 @@ include::../docs-resources/global-config.adoc[] :experimental: :reproducible: //:WaveDromEditorApp: app/wavedrom-editor.app +// imagesoutdir is overrided in Makefile :imagesoutdir: images //:srcdir: src :bibtex-file: src/fusa-whitepaper.bib From cc3372fe33b0dc27057a86ef8a7ffc18bbf3572c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gracia=20P=C3=A9rez?= <50202128+dgptha@users.noreply.github.com> Date: Tue, 26 Nov 2024 18:44:01 +0100 Subject: [PATCH 3/4] Avoid building default template (spec-sample.adoc) --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 30e5d24..00ebe60 100644 --- a/Makefile +++ b/Makefile @@ -13,7 +13,7 @@ # the Doc Template for RISC-V Extensions. DOCS := \ - spec-sample.adoc fusa-whitepaper.adoc + fusa-whitepaper.adoc DATE ?= $(shell date +%Y-%m-%d) VERSION ?= v0.0.0 From 5831bbd89097fbf8a6e18cacfb8add5f58cc27e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gracia=20P=C3=A9rez?= <50202128+dgptha@users.noreply.github.com> Date: Tue, 26 Nov 2024 18:45:57 +0100 Subject: [PATCH 4/4] Add Makefile message indicating the location of generated documents --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index 00ebe60..d52985b 100644 --- a/Makefile +++ b/Makefile @@ -93,6 +93,7 @@ build: echo "Docker is not available, building without Docker..."; \ $(MAKE) build-no-container; \ fi + @echo "Generated documents can be found in the 'build/adoc' folder." build-container: @echo "Starting build inside Docker container..."