Skip to content

Commit c02337e

Browse files
committed
Add support for extracting the tags into JSON
1 parent 26ffcee commit c02337e

File tree

4 files changed

+15
-4
lines changed

4 files changed

+15
-4
lines changed

.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[submodule "docs-resources"]
22
path = docs-resources
3-
url = https://github.com/riscv/docs-resources
3+
url = https://github.com/Timmmm/docs-resources

Makefile

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,16 @@ BUILD_DIR := build
9393
DOCS_PDF := $(addprefix $(BUILD_DIR)/, $(addsuffix .pdf, $(DOCS)))
9494
DOCS_HTML := $(addprefix $(BUILD_DIR)/, $(addsuffix .html, $(DOCS)))
9595
DOCS_EPUB := $(addprefix $(BUILD_DIR)/, $(addsuffix .epub, $(DOCS)))
96+
DOCS_TAGS := $(addprefix $(BUILD_DIR)/, $(addsuffix .tags.json, $(DOCS)))
9697

9798
ENV := LANG=C.utf8
9899
XTRA_ADOC_OPTS :=
100+
99101
ASCIIDOCTOR_PDF := $(ENV) asciidoctor-pdf
100102
ASCIIDOCTOR_HTML := $(ENV) asciidoctor
101103
ASCIIDOCTOR_EPUB := $(ENV) asciidoctor-epub3
104+
ASCIIDOCTOR_TAGS := $(ENV) asciidoctor --backend tags --require=./docs-resources/converters/tags.rb
105+
102106
OPTIONS := --trace \
103107
-a compress \
104108
-a mathematical-format=svg \
@@ -108,6 +112,7 @@ OPTIONS := --trace \
108112
-a revnumber='$(DATE)' \
109113
-a revremark='$(RELEASE_DESCRIPTION)' \
110114
-a docinfo=shared \
115+
-a tags-prefix=qx_ \
111116
$(XTRA_ADOC_OPTS) \
112117
-D build \
113118
--failure-level=ERROR
@@ -116,7 +121,7 @@ REQUIRES := --require=asciidoctor-bibtex \
116121
--require=asciidoctor-lists \
117122
--require=asciidoctor-mathematical
118123

119-
.PHONY: all build clean build-container build-no-container build-docs build-pdf build-html build-epub submodule-check
124+
.PHONY: all build clean build-container build-no-container build-docs build-pdf build-html build-epub build-tags submodule-check
120125

121126
all: build
122127

@@ -132,6 +137,7 @@ build-docs: $(DOCS_PDF) $(DOCS_HTML) $(DOCS_EPUB)
132137
build-pdf: $(DOCS_PDF)
133138
build-html: $(DOCS_HTML)
134139
build-epub: $(DOCS_EPUB)
140+
build-tags: $(DOCS_TAGS)
135141

136142
ALL_SRCS := $(shell git ls-files $(SRC_DIR))
137143

@@ -150,6 +156,11 @@ $(BUILD_DIR)/%.epub: $(SRC_DIR)/%.adoc $(ALL_SRCS)
150156
$(DOCKER_CMD) $(DOCKER_QUOTE) $(ASCIIDOCTOR_EPUB) $(OPTIONS) $(REQUIRES) $< $(DOCKER_QUOTE)
151157
$(WORKDIR_TEARDOWN)
152158

159+
$(BUILD_DIR)/%.tags.json: $(SRC_DIR)/%.adoc $(ALL_SRCS) docs-resources/converters/tags.rb
160+
$(WORKDIR_SETUP)
161+
$(DOCKER_CMD) $(DOCKER_QUOTE) $(ASCIIDOCTOR_TAGS) $(OPTIONS) $(REQUIRES) $< $(DOCKER_QUOTE)
162+
$(WORKDIR_TEARDOWN)
163+
153164
build: submodule-check
154165
@echo "Checking if Docker is available..."
155166
@if command -v docker >/dev/null 2>&1 ; then \

src/docinfo.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
snippets via Asciidoc's docbook output and parsing the XML.
1212
* Linking documentation (e.g. the implementation defined parameter list)
1313
to the spec.
14-
14+
1515
This adds a subtle decoration to make it easier to find tagged text.
1616
*/
1717
[id^="qx_"]:hover {

0 commit comments

Comments
 (0)