git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v2 05/12] Documentation: inline user-manual.conf

From
Patrick Steinhardt <ps@pks.im>
Date
Dec 27, 2024, 13:59 UTC
Message-ID
<20241227-b4-pks-meson-docs-v2-5-f61e63edbfa1@pks.im>
In-Reply-To
<20241227-b4-pks-meson-docs-v2-0-f61e63edbfa1@pks.im>

When generating our user manual we set up a bit of extra configuration compared to our normal configuration. This is done by having an extra "user-manual.conf" file that Asciidoc seems to pull in automatically due to matching filenames with "user-manual.txt". This dependency is quite hidden though and thus easy to miss. Furthermore, it seems that Asciidoc does not know to pull it in for out-of-tree builds where we use relative paths.

The setup in AsciiDoctor is somewhat different: instead of having two sets of configuration, we condition the use of manual-specific configs based on whether the document type is "book". And as we only build our user manual with that type this is sufficient.

Use the same trick for our user manual by inlining the configuration into "asciidoc.conf.in" and making it conditional on whether or not "doctype-book" is defined.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
---
 Documentation/Makefile         |  2 +-
 Documentation/asciidoc.conf.in | 10 ++++++++++
 Documentation/user-manual.conf | 11 -----------
 3 files changed, 11 insertions(+), 12 deletions(-)
diff --git a/Documentation/Makefile b/Documentation/Makefile
index a89823e1d1ee5042367bdcca6ed426196d49ce89..4f152077dded75bedd59abd56db5f6f0693908de 100644
--- a/Documentation/Makefile
+++ b/Documentation/Makefile
@@ -362,7 +362,7 @@ manpage-cmd = $(QUIET_XMLTO)$(XMLTO) -m $(MANPAGE_XSL) $(XMLTO_EXTRA) man $<
 %.xml : %.txt $(ASCIIDOC_DEPS)
 	$(QUIET_ASCIIDOC)$(TXT_TO_XML) -d manpage -o $@ $<
 
-user-manual.xml: user-manual.txt user-manual.conf $(ASCIIDOC_DEPS)
+user-manual.xml: user-manual.txt $(ASCIIDOC_DEPS)
 	$(QUIET_ASCIIDOC)$(TXT_TO_XML) -d book -o $@ $<
 
 technical/api-index.txt: technical/api-index-skel.txt \
diff --git a/Documentation/asciidoc.conf.in b/Documentation/asciidoc.conf.in
index b89bccf2309d782ba29ea716a132b888c1421669..f2aef6cb79f47cf132b97d88a7e74fb40da8ac8d 100644
--- a/Documentation/asciidoc.conf.in
+++ b/Documentation/asciidoc.conf.in
@@ -25,12 +25,22 @@ manmanual=Git Manual
 mansource=Git @GIT_VERSION@
 revdate=@GIT_DATE@
 
+ifdef::doctype-book[]
+[titles]
+	underlines="__","==","--","~~","^^"
+endif::doctype-book[]
+
 ifdef::backend-docbook[]
 [linkgit-inlinemacro]
+ifndef::doctype-book[]
 {0%{target}}
 {0#<citerefentry>}
 {0#<refentrytitle>{target}</refentrytitle><manvolnum>{0}</manvolnum>}
 {0#</citerefentry>}
+endif::doctype-book[]
+ifdef::doctype-book[]
+<ulink url="{target}.html">{target}{0?({0})}</ulink>
+endif::doctype-book[]
 
 [literal-inlinemacro]
 {eval:re.sub(r'(&lt;[-a-zA-Z0-9.]+&gt;)', r'<emphasis>\1</emphasis>', re.sub(r'([\[\s|()>]|^|\]|&gt;)(\.?([-a-zA-Z0-9:+=~@,\/_^\$]+\.?)+)',r'\1<literal>\2</literal>', re.sub(r'(\.\.\.?)([^\]$.])', r'<literal>\1</literal>\2', macros.passthroughs[int(attrs['passtext'][1:-1])] if attrs['passtext'][1:-1].isnumeric() else attrs['passtext'][1:-1])))}
diff --git a/Documentation/user-manual.conf b/Documentation/user-manual.conf
deleted file mode 100644
index 0148f126dcdf6aca15a5560fb5b122b85b022461..0000000000000000000000000000000000000000
--- a/Documentation/user-manual.conf
+++ /dev/null
@@ -1,11 +0,0 @@
-[titles]
-	underlines="__","==","--","~~","^^"
-
-[attributes]
-caret=^
-startsb=&#91;
-endsb=&#93;
-tilde=&#126;
-
-[linkgit-inlinemacro]
-<ulink url="{target}.html">{target}{0?({0})}</ulink>
-- 
2.48.0.rc0.311.gb6c66824c1.dirty
Previous: Patrick SteinhardtNext: Patrick Steinhardt
Message 23 of 33 in “meson: wire up missing HTML documentation”
  1. 00/10 meson: wire up missing HTML documentationPatrick Steinhardt, Dec 13, 2024
  2. 01/10 meson: wire up support for AsciiDoctorPatrick Steinhardt, Dec 13, 2024
  3. 02/10 meson: properly wire up dependencies for our docsPatrick Steinhardt, Dec 13, 2024
  4. 03/10 meson: fix generation of merge toolsPatrick Steinhardt, Dec 13, 2024
  5. 04/10 meson: generate HTML pages for all man page categoriesPatrick Steinhardt, Dec 13, 2024
  6. Toon ClaesDec 23, 2024
  7. Patrick SteinhardtDec 27, 2024
  8. 06/10 meson: generate user manualPatrick Steinhardt, Dec 13, 2024
  9. 05/10 Documentation: inline user-manual.confPatrick Steinhardt, Dec 13, 2024
  10. 07/10 Documentation: refactor "api-index.sh" for out-of-tree buildsPatrick Steinhardt, Dec 13, 2024
  11. 09/10 meson: generate articlesPatrick Steinhardt, Dec 13, 2024
  12. 08/10 Documentation: refactor "howto-index.sh" for out-of-tree buildsPatrick Steinhardt, Dec 13, 2024
  13. 10/10 meson: install static files for HTML documentationPatrick Steinhardt, Dec 13, 2024
  14. Toon ClaesDec 23, 2024
  15. Patrick SteinhardtDec 27, 2024
  16. Toon ClaesJan 3, 2025
  17. Patrick SteinhardtJan 3, 2025
  18. 00/12 meson: wire up missing HTML documentationPatrick Steinhardt, Dec 27, 2024
  19. 01/12 meson: wire up support for AsciiDoctorPatrick Steinhardt, Dec 27, 2024
  20. 02/12 meson: properly wire up dependencies for our docsPatrick Steinhardt, Dec 27, 2024
  21. 03/12 meson: fix generation of merge toolsPatrick Steinhardt, Dec 27, 2024
  22. 04/12 meson: generate HTML pages for all man page categoriesPatrick Steinhardt, Dec 27, 2024
  23. 05/12 Documentation: inline user-manual.confPatrick Steinhardt, Dec 27, 2024
  24. 06/12 meson: generate user manualPatrick Steinhardt, Dec 27, 2024
  25. 07/12 Documentation: refactor "api-index.sh" for out-of-tree buildsPatrick Steinhardt, Dec 27, 2024
  26. 08/12 Documentation: refactor "howto-index.sh" for out-of-tree buildsPatrick Steinhardt, Dec 27, 2024
  27. 09/12 meson: generate articlesPatrick Steinhardt, Dec 27, 2024
  28. 10/12 meson: install static files for HTML documentationPatrick Steinhardt, Dec 27, 2024
  29. 11/12 t/Makefile: make "check-meson" work with DashPatrick Steinhardt, Dec 27, 2024
  30. Jonathan NiederJan 2, 2025
  31. Junio C HamanoJan 2, 2025
  32. Junio C HamanoJan 3, 2025
  33. 12/12 Documentation: wire up sanity checks for MesonPatrick Steinhardt, Dec 27, 2024

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.