From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS31976 209.132.180.0/23 X-Spam-Status: No, score=-5.5 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID shortcircuit=no autolearn=ham autolearn_force=no version=3.4.0 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by dcvr.yhbt.net (Postfix) with ESMTP id D8A2A1F89C for ; Sat, 21 Jan 2017 21:59:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751483AbdAUV7w (ORCPT ); Sat, 21 Jan 2017 16:59:52 -0500 Received: from castro.crustytoothpaste.net ([75.10.60.170]:38738 "EHLO castro.crustytoothpaste.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751404AbdAUV7k (ORCPT ); Sat, 21 Jan 2017 16:59:40 -0500 Received: from genre.crustytoothpaste.net (unknown [IPv6:2001:470:b978:101:254c:7dd1:74c7:cde0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by castro.crustytoothpaste.net (Postfix) with ESMTPSA id 5F1A9280B1; Sat, 21 Jan 2017 21:59:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=crustytoothpaste.net; s=default; t=1485035966; bh=EsrSQmtbPhyio8QoF5MFlxL7MU/lcw4OpIoak/9VpQM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KvSrW+LnXJ8hOeryVYhbNjmJoM4cC6i+39A5zywC6zdAF999kdWrWqE76ZVqS96Mu xRTJU+zWt1og5YzS56d5cBLgcAXkLqid5zjicOqyiwK8J7jKofurbRvSEue1i+WoO9 wS/clt8DwWFWQAesWJ19o7YKXXjc1X1AVh+fOx/c1sedcyruuqpH3Q5VMwT1tqOJ9V StHqXb3worhbHbsEWkKNb26kklc9iJ992oOnL7veNhdZ8Hxkc6qbkW+4/7rUJ927gh u3x21bFIZjoNKgKfrzf3kw9QdrwaXk1/E1kO80I715rAN4CidMRZlDjOrJ+EzsVDIj YiwilNnnNUMGNb2LqSKb0FpO/Mkz5UErM6+NsR1B0PZI8RmS5HcLpEiB9LEZcWbbK1 BoUcdMoRVjeL/pUnmqfrwobeLKhu0hDqJ8byGyFzWvhF+JzTBoq5cL4ppyGFcgQ4Yc DuVp9w5akAYQkp1m+4s58Ov6G+qtgTpSF6Py1zN1HBqOxnEZ8nv From: "brian m. carlson" To: git@vger.kernel.org Cc: Johannes Schindelin , Jeff King Subject: [PATCH 5/7] Documentation: add XSLT to fix DocBook for Texinfo Date: Sat, 21 Jan 2017 21:59:10 +0000 Message-Id: <20170121215912.246691-6-sandals@crustytoothpaste.net> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170121215912.246691-1-sandals@crustytoothpaste.net> References: <20170121215912.246691-1-sandals@crustytoothpaste.net> Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org There are two ways to create a section in a reference document (i.e., manpage) in DocBook 4: refsection elements and refsect, refsect2, and refsect3 elements. Either form is acceptable as of DocBook 4.2, but they cannot be mixed. Prior to DocBook 4.2, only the numbered forms were acceptable. docbook2texi only accepts the numbered forms, and this has not generally been a problem, since AsciiDoc produces the numbered forms. Asciidoctor, on the other hand, uses a shared backend for DocBook 4 and 5, and uses the unnumbered refsection elements instead. If we don't convert the unnumbered form to the numbered form, docbook2texi omits section headings, which is undesirable. Add an XSLT stylesheet to transform the unnumbered forms to the numbered forms automatically, and preprocess the DocBook XML as part of the transformation to Texinfo format. Note that this transformation is only necessary for Texinfo, since docbook2texi provides its own stylesheets. The DocBook stylesheets, which we use for other formats, provide the full range of DocBook 4 and 5 compatibility, and don't have this issue. Signed-off-by: brian m. carlson --- Documentation/Makefile | 7 ++++--- Documentation/texi.xsl | 26 ++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 3 deletions(-) create mode 100644 Documentation/texi.xsl diff --git a/Documentation/Makefile b/Documentation/Makefile index 6e6c82409..76be7017c 100644 --- a/Documentation/Makefile +++ b/Documentation/Makefile @@ -371,10 +371,11 @@ user-manual.pdf: user-manual.xml $(DBLATEX) -o $@+ -p $(ASCIIDOC_DBLATEX_DIR)/asciidoc-dblatex.xsl -s $(ASCIIDOC_DBLATEX_DIR)/asciidoc-dblatex.sty $< && \ mv $@+ $@ -gitman.texi: $(MAN_XML) cat-texi.perl +gitman.texi: $(MAN_XML) cat-texi.perl texi.xsl $(QUIET_DB2TEXI)$(RM) $@+ $@ && \ - ($(foreach xml,$(sort $(MAN_XML)),$(DOCBOOK2X_TEXI) --encoding=UTF-8 \ - --to-stdout $(xml) &&) true) > $@++ && \ + ($(foreach xml,$(sort $(MAN_XML)),xsltproc -o $(xml)+ texi.xsl $(xml) && \ + $(DOCBOOK2X_TEXI) --encoding=UTF-8 --to-stdout $(xml)+ && \ + rm $(xml)+ &&) true) > $@++ && \ $(PERL_PATH) cat-texi.perl $@ <$@++ >$@+ && \ rm $@++ && \ mv $@+ $@ diff --git a/Documentation/texi.xsl b/Documentation/texi.xsl new file mode 100644 index 000000000..0f8ff07ec --- /dev/null +++ b/Documentation/texi.xsl @@ -0,0 +1,26 @@ + + + + + + + refsect + + + + + + + + + + + + +