@@ -72,18 +72,23 @@ BUILD_DIR := build
72
72
DOCS_PDF := $(addprefix $(BUILD_DIR ) /, $(addsuffix .pdf, $(DOCS ) ) )
73
73
DOCS_HTML := $(addprefix $(BUILD_DIR ) /, $(addsuffix .html, $(DOCS ) ) )
74
74
DOCS_EPUB := $(addprefix $(BUILD_DIR ) /, $(addsuffix .epub, $(DOCS ) ) )
75
+ DOCS_TAGS := $(addprefix $(BUILD_DIR ) /, $(addsuffix .tags.json, $(DOCS ) ) )
75
76
76
77
ENV := LANG=C.utf8
77
78
XTRA_ADOC_OPTS :=
79
+
78
80
ASCIIDOCTOR_PDF := $(ENV ) asciidoctor-pdf
79
81
ASCIIDOCTOR_HTML := $(ENV ) asciidoctor
80
82
ASCIIDOCTOR_EPUB := $(ENV ) asciidoctor-epub3
83
+ ASCIIDOCTOR_TAGS := $(ENV ) asciidoctor --backend tags --require=./docs-resources/converters/tags.rb
84
+
81
85
OPTIONS := --trace \
82
86
-a compress \
83
87
-a mathematical-format=svg \
84
88
-a pdf-fontsdir=docs-resources/fonts \
85
89
-a pdf-theme=docs-resources/themes/riscv-pdf.yml \
86
90
-a docinfo=shared \
91
+ -a tags-prefix=qx_ \
87
92
$(XTRA_ADOC_OPTS ) \
88
93
-D build \
89
94
--failure-level=ERROR
@@ -92,7 +97,7 @@ REQUIRES := --require=asciidoctor-bibtex \
92
97
--require=asciidoctor-lists \
93
98
--require=asciidoctor-mathematical
94
99
95
- .PHONY : all build clean build-container build-no-container build-docs build-pdf build-html build-epub submodule-check
100
+ .PHONY : all build clean build-container build-no-container build-docs build-pdf build-html build-epub build-tags submodule-check
96
101
97
102
all : build
98
103
@@ -108,6 +113,7 @@ build-docs: $(DOCS_PDF) $(DOCS_HTML) $(DOCS_EPUB)
108
113
build-pdf : $(DOCS_PDF )
109
114
build-html : $(DOCS_HTML )
110
115
build-epub : $(DOCS_EPUB )
116
+ build-tags : $(DOCS_TAGS )
111
117
112
118
ALL_SRCS := $(shell git ls-files $(SRC_DIR ) )
113
119
@@ -126,6 +132,11 @@ $(BUILD_DIR)/%.epub: $(SRC_DIR)/%.adoc $(ALL_SRCS)
126
132
$(DOCKER_CMD ) $(DOCKER_QUOTE ) $(ASCIIDOCTOR_EPUB ) $(OPTIONS ) $(REQUIRES ) $< $(DOCKER_QUOTE )
127
133
$(WORKDIR_TEARDOWN )
128
134
135
+ $(BUILD_DIR ) /% .tags.json : $(SRC_DIR ) /% .adoc $(ALL_SRCS ) docs-resources/converters/tags.rb
136
+ $(WORKDIR_SETUP )
137
+ $(DOCKER_CMD ) $(DOCKER_QUOTE ) $(ASCIIDOCTOR_TAGS ) $(OPTIONS ) $(REQUIRES ) $< $(DOCKER_QUOTE )
138
+ $(WORKDIR_TEARDOWN )
139
+
129
140
build : submodule-check
130
141
@echo " Checking if Docker is available..."
131
142
@if command -v docker > /dev/null 2>&1 ; then \
0 commit comments