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

Re: [PATCH] doc: use asciidoctor to build man pages directly

From
Felipe Contreras <felipe.contreras@gmail.com>
Date
May 12, 2021, 00:58 UTC
Message-ID
<609b2828309fc_678ff2082@natae.notmuch>
In-Reply-To
<YJsSuAscwHwRo84R@camp.crustytoothpaste.net>
brian m. carlson wrote:
Show 25 quoted lines
> On 2021-05-11 at 22:27:54, Felipe Contreras wrote:
> > There's no need to use xmlto to build the man pages when modern
> > asciidoctor can do it by itself.
> > 
> > This new mode will be active only when USE_ASCIIDOCTOR is set.
> > 
> > Suggested-by: Bagas Sanjaya <bagasdotme@gmail.com>
> > Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
> > ---
> >  Documentation/Makefile | 8 ++++++++
> >  1 file changed, 8 insertions(+)
> > 
> > diff --git a/Documentation/Makefile b/Documentation/Makefile
> > index 2aae4c9cbb..0cfa88a92b 100644
> > --- a/Documentation/Makefile
> > +++ b/Documentation/Makefile
> > @@ -196,6 +196,7 @@ ASCIIDOC_EXTRA += -alitdd='&\#x2d;&\#x2d;'
> >  DBLATEX_COMMON =
> >  XMLTO_EXTRA += --skip-validation
> >  XMLTO_EXTRA += -x manpage.xsl
> > +TXT_TO_MAN = $(ASCIIDOC_COMMON) -b manpage
> >  endif
> 
> As I mentioned elsewhere, this breaks the linkgit functionality since we
> don't have a patch for the asciidoctor-extensions.rb file
That's an easy fix:
--- a/Documentation/asciidoctor-extensions.rb
+++ b/Documentation/asciidoctor-extensions.rb
@@ -15,6 +15,8 @@ module Git
           "#{target}(#{attrs[1]})</ulink>"
         elsif parent.document.basebackend? 'html'
           %(<a href="#{prefix}#{target}.html">#{target}(#{attrs[1]})</a>)
+        elsif parent.document.basebackend? 'manpage'
+          "\e\\fB%s\e\\fR(%s)" % [target, attrs[1]]
         elsif parent.document.basebackend? 'docbook'
           "<citerefentry>\n" \
             "<refentrytitle>#{target}</refentrytitle>" \

> and it also doesn't honor GNU_ROFF, which means that copying and
> pasting from manual pages is problematic on systems which use groff.

My system uses groff, I don't see any issues copy-pasting from manual
pages.

How exactly can I reproduce this issue?

> I'd prefer if we put this behind an option so that just because someone
> like me who builds with Asciidoctor doesn't have to get this behavior.
> We may by default enable that option if the issues I mentioned above are
> addressed, but it would still be nice to have an option to enable the
> legacy behavior, if only for those people who may be using older
> versions of Asciidoctor.

Sure, that would be nice, but that's not not an itch I personally have
right now.

At the moment I'm finding too many areas of improvement with the
documentation build system. Perhaps, I'll do this after I've addressed
those. Or somebody else could volunteer.

Cheers.
-- 
Felipe Contreras
Previous: brian m. carlsonNext: brian m. carlson
Message 3 of 45 in “doc: use asciidoctor to build man pages directly”
  1. doc: use asciidoctor to build man pages directlyFelipe Contreras, May 11, 2021
  2. brian m. carlsonMay 11, 2021
  3. Felipe ContrerasMay 12, 2021
  4. 1/2 doc: add an option to have Asciidoctor build man pages directlybrian m. carlson, May 12, 2021
  5. 2/2 doc: remove GNU_ROFF optionbrian m. carlson, May 12, 2021
  6. Eric SunshineMay 12, 2021
  7. brian m. carlsonMay 12, 2021
  8. Felipe ContrerasMay 12, 2021
  9. brian m. carlsonMay 14, 2021
  10. Felipe ContrerasMay 15, 2021
  11. Martin ÅgrenMay 13, 2021
  12. Bagas SanjayaMay 12, 2021
  13. Felipe ContrerasMay 12, 2021
  14. brian m. carlsonMay 13, 2021
  15. Felipe ContrerasMay 14, 2021
  16. Felipe ContrerasMay 15, 2021
  17. Felipe ContrerasMay 12, 2021
  18. brian m. carlsonMay 13, 2021
  19. Felipe ContrerasMay 14, 2021
  20. Bagas SanjayaMay 12, 2021
  21. brian m. carlsonMay 13, 2021
  22. Jeff KingMay 12, 2021
  23. Jeff KingMay 12, 2021
  24. Jeff KingMay 12, 2021
  25. Felipe ContrerasMay 12, 2021
  26. Martin ÅgrenMay 13, 2021
  27. Felipe ContrerasMay 13, 2021
  28. Eric SunshineMay 12, 2021
  29. Jeff KingMay 12, 2021
  30. Martin ÅgrenMay 14, 2021
  31. 0/2 Asciidoctor native manpage buildsbrian m. carlson, May 14, 2021
  32. 1/2 doc: add an option to have Asciidoctor build man pages directlybrian m. carlson, May 14, 2021
  33. Junio C HamanoMay 14, 2021
  34. Jeff KingMay 14, 2021
  35. Felipe ContrerasMay 14, 2021
  36. brian m. carlsonMay 14, 2021
  37. Felipe ContrerasMay 14, 2021
  38. Felipe ContrerasMay 14, 2021
  39. Felipe ContrerasMay 14, 2021
  40. brian m. carlsonMay 14, 2021
  41. Felipe ContrerasMay 14, 2021
  42. 2/2 doc: remove GNU_ROFF optionbrian m. carlson, May 14, 2021
  43. Felipe ContrerasMay 14, 2021
  44. brian m. carlsonMay 14, 2021
  45. Felipe ContrerasMay 14, 2021

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.