Thread (1 message) 1 message, 1 author, 2016-06-15

Re: request for pre-generated git.info pages

From: Kalle Olavi Niemitalo <hidden>
Date: 2016-06-15 22:45:33
Subsystem: documentation, the rest · Maintainers: Jonathan Corbet, Linus Torvalds

Possibly related (same subject, not in this thread)

Kalle Olavi Niemitalo [off-list ref] writes:
However, the Info browser does not recognize cross-references
between them.  I am playing with some patches to fix those.
This seems to fix it, although the result isn't pretty.
Not signed off.
diff --git a/Documentation/Makefile b/Documentation/Makefile
index 62269e3..56e1cf5 100644
--- a/Documentation/Makefile
+++ b/Documentation/Makefile
@@ -184,12 +184,12 @@ git.info: user-manual.texi
 
 user-manual.texi: user-manual.xml
 	$(RM) $@+ $@
-	$(DOCBOOK2X_TEXI) user-manual.xml --to-stdout | $(PERL_PATH) fix-texi.perl >$@+
+	$(DOCBOOK2X_TEXI) -s texi.xsl user-manual.xml --to-stdout | $(PERL_PATH) fix-texi.perl >$@+
 	mv $@+ $@
 
 gitman.texi: $(MAN_XML) cat-texi.perl
 	$(RM) $@+ $@
-	($(foreach xml,$(MAN_XML),$(DOCBOOK2X_TEXI) --to-stdout $(xml);)) | \
+	($(foreach xml,$(MAN_XML),$(DOCBOOK2X_TEXI) -s texi.xsl --to-stdout $(xml);)) | \
 	$(PERL_PATH) cat-texi.perl $@ >$@+
 	mv $@+ $@
 
diff --git a/Documentation/texi.xsl b/Documentation/texi.xsl
new file mode 100644
index 0000000..5c6f4cd
--- /dev/null
+++ b/Documentation/texi.xsl
@@ -0,0 +1,17 @@
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                xmlns="http://docbook2x.sourceforge.net/xmlns/Texi-XML"
+                version="1.0">
+  <!-- docbook2x 0.8.3 recognizes sf.net but not sourceforge.net.  -->
+  <xsl:import href="http://docbook2x.sf.net/latest/xslt/texi/docbook.xsl"/>
+
+  <!-- In a man page, asciidoc.conf expands linkgit to citerefentry.
+       Each man page goes in gitman.texi so ref/@file is not needed.  -->
+  <xsl:template match="citerefentry[starts-with(refentrytitle, 'git')]">
+    <ref node="{refentrytitle}" />
+  </xsl:template>
+
+  <!-- In Git User's Manual, user-manual.conf expands linkgit to ulink.  -->
+  <xsl:template match="ulink[starts-with(@url, 'git') and substring(@url, string-length(@url) - 4) = '.html']">
+    <ref node="{substring(@url, 1, string-length(@url) - 5)}" file="gitman.info" />
+  </xsl:template>
+</xsl:stylesheet>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help