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

Re: [PATCH v2] Documentation: fix build with Asciidoctor 2

From
Jeff King <peff@peff.net>
Date
Sep 13, 2019, 05:06 UTC
Message-ID
<20190913050634.GB21172@sigill.intra.peff.net>
In-Reply-To
<20190913015240.686522-1-sandals@crustytoothpaste.net>
On Fri, Sep 13, 2019 at 01:52:40AM +0000, brian m. carlson wrote:
Show 7 quoted lines
> We also need to teach xmlto how to use the namespaced DocBook XSLT
> stylesheets instead of the non-namespaced ones it usually uses.
> Normally these stylesheets are interchangeable, but the non-namespaced
> ones have a bug that causes them not to strip whitespace automatically
> from certain elements when namespaces are in use.  This results in
> additional whitespace at the beginning of list elements, which is
> jarring and unsightly.

Thanks, this fixed most of the rendering problems I saw from the earlier patch.

Show 10 quoted lines
> We can do this by passing a custom stylesheet with the -x option that
> simply imports the namespaced stylesheets via a URL.  Any system with
> support for XML catalogs will automatically look this URL up and
> reference a local copy instead without us having to know where this
> local copy is located.  We know that anyone using xmlto will already
> have catalogs set up properly since the DocBook 4.5 DTD used during
> validation is also looked up via catalogs.  All major Linux
> distributions distribute the necessary stylesheets and have built-in
> catalog support, and Homebrew does as well, albeit with a requirement to
> set an environment variable to enable catalog support.

This did give me one minor hiccup: I had the debian docbook-xsl package installed, but not docbook-xsl-ns. The error message was pretty standard for XML: obvious if you know what catalogs are, and utterly confusing otherwise. :)

Everything worked fine after installing docbook-xsl-ns. I wonder if could/should provide some guidance somewhere (maybe in INSTALL, which discusses some catalog issues?).

> Finally, we need to filter out some messages from other stylesheets that
> when invoking dblatex in the CI job.  This tool strips namespaces much
s/that/that occur/ or something?
> like the unnamespaced DocBook stylesheets and prints similar messages.
> If we permit these messages to be printed to standard error, our
> documentation CI job will because we check standard error for unexpected
s/will/will fail/?
Show 6 quoted lines
> ---
>  Documentation/Makefile    | 4 +++-
>  Documentation/manpage.xsl | 3 +++
>  ci/test-documentation.sh  | 2 ++
>  3 files changed, 8 insertions(+), 1 deletion(-)
>  create mode 100644 Documentation/manpage.xsl

Running with this patch on asciidoctor 2.0.10, plus Martin's recent literal-block cleanups, plus his refmiscinfo fix, I get pretty decent output from:

  ./doc-diff --from-asciidoc --to-asciidoctor origin HEAD

The header/footer are still a little funny (but I think Martin said that he needs to update the refmiscinfo patches for later versions of asciidoctor, which is probably what's going on here):

  --- a/f1d4a28250629ae469fc5dd59ab843cb2fd68e12-asciidoc/home/peff/share/man/man1/git-add.1
  +++ b/6c08635fd1d38c83d3765ff05fabbfbd25ef4943-asciidoctor/home/peff/share/man/man1/git-add.1
  @@ -1,4 +1,4 @@
  -GIT-ADD(1)                        Git Manual                        GIT-ADD(1)
  +GIT-ADD(1)                                                          GIT-ADD(1)
   
   NAME
          git-add - Add file contents to the index
  @@ -356,4 +356,4 @@ SEE ALSO
   GIT
          Part of the git(1) suite
   
  -Git omitted                       01/01/1970                        GIT-ADD(1)
  +  omitted                         1970-01-01                        GIT-ADD(1)

One curiosity is that any ``smart-quotes'' now get two spaces between them and the period of the last sentence (whereas in asciidoc they got only one):

  -           <start> and <end> are optional. “-L <start>” or “-L <start>,” spans
  -           from <start> to end of file. “-L ,<end>” spans from start of file
  -           to <end>.
  +           <start> and <end> are optional.  “-L <start>” or “-L <start>,”
  +           spans from <start> to end of file.  “-L ,<end>” spans from start of
  +           file to <end>.

I don't think this is a big deal, but I think most of these should actually be backticks these days (the text above is from git-annotate.txt, which hasn't been touched in quite a while).

There are other miscellaneous indentation fixes. Most of them look better in asciidoctor, IMHO. For example, some lists now wrap more neatly (it looks like it's usually lists after an indented listing block? Maybe a continuation thing?):

  -           1. This step and the next one could be combined into a single step
  -           with "checkout -b my2.6.14 v2.6.14".
  +            1. This step and the next one could be combined into a single
  +               step with "checkout -b my2.6.14 v2.6.14".

Another curiosity is that single-quote `smart-quotes' are rendered as real smart-quotes by asciidoctor:

  -           The following features from ‘svn log’ are supported:
  +           The following features from “svn log” are supported:

The only other case I found was this one, where I think the asciidoctor version is better (the source has literal backticks, so there shouldn't be a visible quote; I'm guessing asciidoc got confused by the apostrophe in "variable's"):

  -           The ‘merge.*.driver` variable’s value is used to construct a
  +           The merge.*.driver variable’s value is used to construct a command
So overall, I think we're getting very close to parity.
-Peff
Previous: brian m. carlsonNext: Junio C Hamano
Message 50 of 71 in “asciidoctor-extensions: provide `<refmiscinfo/>`”
  1. asciidoctor-extensions: provide `<refmiscinfo/>`Martin Ågren, Mar 17, 2019
  2. Todd ZullingerMar 17, 2019
  3. Martin ÅgrenMar 17, 2019
  4. Martin ÅgrenMar 19, 2019
  5. Todd ZullingerMar 20, 2019
  6. Martin ÅgrenMar 22, 2019
  7. Todd ZullingerMar 23, 2019
  8. Jeff KingMar 24, 2019
  9. Todd ZullingerMar 24, 2019
  10. Jeff KingMar 25, 2019
  11. Todd ZullingerMar 25, 2019
  12. Todd ZullingerMar 27, 2019
  13. SZEDER GáborMar 27, 2019
  14. brian m. carlsonMar 28, 2019
  15. Todd ZullingerMar 30, 2019
  16. brian m. carlsonMar 30, 2019
  17. Todd ZullingerApr 5, 2019
  18. Jeff KingApr 5, 2019
  19. Jeff KingMar 28, 2019
  20. Jeff KingMar 28, 2019
  21. Jeff KingMar 19, 2019
  22. Jeff KingMar 19, 2019
  23. Junio C HamanoMar 19, 2019
  24. Martin ÅgrenMar 19, 2019
  25. Martin ÅgrenMar 19, 2019
  26. 0/2 asciidoctor-extensions: provide `<refmiscinfo/>`Martin Ågren, Sep 3, 2019
  27. 1/2 asciidoctor-extensions: provide `<refmiscinfo/>`Martin Ågren, Sep 3, 2019
  28. 2/2 doc-diff: replace --cut-header-footer with --cut-footerMartin Ågren, Sep 3, 2019
  29. brian m. carlsonSep 3, 2019
  30. Martin ÅgrenSep 5, 2019
  31. Jeff KingSep 4, 2019
  32. Martin ÅgrenSep 5, 2019
  33. Jeff KingSep 7, 2019
  34. Martin ÅgrenSep 7, 2019
  35. Jeff KingSep 8, 2019
  36. brian m. carlsonSep 6, 2019
  37. Jeff KingSep 7, 2019
  38. brian m. carlsonSep 7, 2019
  39. Documentation: fix build with Asciidoctor 2brian m. carlson, Sep 7, 2019
  40. Jeff KingSep 8, 2019
  41. brian m. carlsonSep 8, 2019
  42. Jeff KingSep 8, 2019
  43. brian m. carlsonSep 8, 2019
  44. Junio C HamanoSep 9, 2019
  45. Jeff KingSep 10, 2019
  46. brian m. carlsonSep 11, 2019
  47. SZEDER GáborSep 8, 2019
  48. Jeff KingSep 8, 2019
  49. Documentation: fix build with Asciidoctor 2brian m. carlson, Sep 13, 2019
  50. Jeff KingSep 13, 2019
  51. Junio C HamanoSep 13, 2019
  52. Martin ÅgrenSep 16, 2019
  53. Junio C HamanoSep 16, 2019
  54. SZEDER GáborSep 14, 2019
  55. brian m. carlsonSep 14, 2019
  56. Documentation: fix build with Asciidoctor 2brian m. carlson, Sep 14, 2019
  57. SZEDER GáborSep 15, 2019
  58. brian m. carlsonSep 15, 2019
  59. SZEDER GáborSep 15, 2019
  60. brian m. carlsonSep 15, 2019
  61. Martin ÅgrenSep 16, 2019
  62. Documentation: fix build with Asciidoctor 2brian m. carlson, Sep 15, 2019
  63. 0/3 asciidoctor-extensions: provide `<refmiscinfo/>`Martin Ågren, Sep 16, 2019
  64. 1/3 Doc/Makefile: give mansource/-version/-manual attributesMartin Ågren, Sep 16, 2019
  65. 2/3 asciidoctor-extensions: provide `<refmiscinfo/>`Martin Ågren, Sep 16, 2019
  66. 3/3 doc-diff: replace --cut-header-footer with --cut-footerMartin Ågren, Sep 16, 2019
  67. Jeff KingMar 19, 2019
  68. Martin ÅgrenMar 19, 2019
  69. Jeff KingMar 19, 2019
  70. Todd ZullingerMar 20, 2019
  71. Martin ÅgrenMar 19, 2019

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.