git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / mirror / code / Atom feed
From: "Martin Ågren" <martin.agren@gmail.com>
To: Felipe Contreras <felipe.contreras@gmail.com>
Cc: "brian m. carlson" <sandals@crustytoothpaste.net>,
	Bagas Sanjaya <bagasdotme@gmail.com>,
	Git Users <git@vger.kernel.org>
Subject: Re: [RFC suggestion] Generate manpage directly with Asciidoctor
Date: Sun, 9 May 2021 10:29:08 +0200	[thread overview]
Message-ID: <CAN0heSrbJQjzbwm3CiNh7UduKSYKogsHBh6RQszDuk2cGu=r=w@mail.gmail.com> (raw)
In-Reply-To: <6095ceb984401_cfc7208b9@natae.notmuch>

On Sat, 8 May 2021 at 01:40, Felipe Contreras
<felipe.contreras@gmail.com> wrote:
>
> brian m. carlson wrote:
> > On 2021-05-07 at 06:06:31, Bagas Sanjaya wrote:
> > > So completely migrating to Asciidoctor can eliminate xmlto requirement
> > > for generating manpage.
> > >
> > > What do you think about above?
> >
> > I didn't do this because it makes things very complicated in the
> > Makefile and my goal was to minimize the needed changes and divergence.
> > I'm not opposed to someone else doing it, but I expect it will be a
> > bunch of work.
>
> I don't think it would be that complicated.
>
> This patch seems to do the trick here:

This looks similar to Todd's wip [1]. Here's something
whitespace-damaged on top that improves some things, but I'm sure
there's more to do. I think in order to work on this, it would need to
be a separate switch so that we can use asciidoctor both the old-school
and the new-school way for a while.

[1] https://lore.kernel.org/git/20190317194431.GY31362@pobox.com/

diff --git a/Documentation/Makefile b/Documentation/Makefile
index 0cfa88a92b..9f73d2d033 100644
--- a/Documentation/Makefile
+++ b/Documentation/Makefile
@@ -192,7 +192,9 @@ ASCIIDOC_HTML = xhtml5
 ASCIIDOC_DOCBOOK = docbook5
 ASCIIDOC_EXTRA += -acompat-mode -atabsize=8
 ASCIIDOC_EXTRA += -I. -rasciidoctor-extensions
-ASCIIDOC_EXTRA += -alitdd='&\#x2d;&\#x2d;'
+ASCIIDOC_EXTRA += -alitdd='\--'
+ASCIIDOC_EXTRA += -aplus='+'
+ASCIIDOC_COMMON += -a mansource="Git $(GIT_VERSION)" -a manmanual="Git Manual"
 DBLATEX_COMMON =
 XMLTO_EXTRA += --skip-validation
 XMLTO_EXTRA += -x manpage.xsl
diff --git a/Documentation/asciidoctor-extensions.rb
b/Documentation/asciidoctor-extensions.rb
index d906a00803..fb74443241 100644
--- a/Documentation/asciidoctor-extensions.rb
+++ b/Documentation/asciidoctor-extensions.rb
@@ -10,11 +10,16 @@ module Git

       def process(parent, target, attrs)
         prefix = parent.document.attr('git-relative-html-prefix')
+        s = "#{target}(#{attrs[1]})"
         if parent.document.doctype == 'book'
           "<ulink url=\"#{prefix}#{target}.html\">" \
           "#{target}(#{attrs[1]})</ulink>"
+        elsif parent.document.basebackend? 'manpage'
+          # FIXME: boldness should respect NO_MAN_BOLD_LITERAL?
+          # -- should be doable using an attribute, similar
+          # to "prefix" above
+          create_inline(parent, :quoted, s, type: :strong).convert
         elsif parent.document.basebackend? 'html'
           %(<a href="#{prefix}#{target}.html">#{target}(#{attrs[1]})</a>)
         elsif parent.document.basebackend? 'docbook'
           "<citerefentry>\n" \
             "<refentrytitle>#{target}</refentrytitle>" \

  parent reply	other threads:[~2021-05-09  8:29 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-07  6:06 Bagas Sanjaya
2021-05-07 12:02 ` Randall S. Becker
2021-05-07 22:55   ` Felipe Contreras
2021-05-07 22:57   ` brian m. carlson
2021-05-08  1:42     ` Randall S. Becker
2021-05-07 12:27 ` Đoàn Trần Công Danh
2021-05-07 12:47   ` Bagas Sanjaya
2021-05-07 23:03   ` Felipe Contreras
2021-05-08  4:27     ` Bagas Sanjaya
2021-05-07 20:25 ` brian m. carlson
2021-05-07 22:19   ` Jeff King
2021-05-08  4:22     ` Bagas Sanjaya
2021-05-09  8:20     ` Martin Ågren
2021-05-09 18:46       ` Felipe Contreras
2021-05-10 18:43         ` Martin Ågren
2021-05-10 22:24       ` Jeff King
2021-05-11  4:27         ` Felipe Contreras
2021-05-11  6:13           ` Jeff King
2021-05-11  8:03             ` Felipe Contreras
2021-05-11 12:44               ` Ævar Arnfjörð Bjarmason
2021-05-11 19:00                 ` Felipe Contreras
2021-05-11 19:09                   ` Jeff King
2021-05-11 20:22                     ` Felipe Contreras
2021-05-11 23:14           ` brian m. carlson
2021-05-12  1:44             ` Felipe Contreras
2021-05-11 18:45         ` Martin Ågren
2021-05-11 19:07           ` Jeff King
2021-05-11 19:11             ` Martin Ågren
2021-05-11 20:14             ` Felipe Contreras
2021-05-11  9:04       ` Jean-Noël Avila
2021-05-11 18:54         ` Martin Ågren
2021-05-07 23:35   ` Felipe Contreras
2021-05-07 23:57     ` brian m. carlson
2021-05-08  3:10       ` Jeff King
2021-05-08  3:23         ` Jeff King
2021-05-09  0:22         ` brian m. carlson
2021-05-09  8:29     ` Martin Ågren [this message]
2021-05-07 22:48 ` Felipe Contreras

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAN0heSrbJQjzbwm3CiNh7UduKSYKogsHBh6RQszDuk2cGu=r=w@mail.gmail.com' \
    --to=martin.agren@gmail.com \
    --cc=bagasdotme@gmail.com \
    --cc=felipe.contreras@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=sandals@crustytoothpaste.net \
    --subject='Re: [RFC suggestion] Generate manpage directly with Asciidoctor' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Code repositories for project(s) associated with this inbox:

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).