git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Felipe Contreras <felipe.contreras@gmail.com>
Cc: git@vger.kernel.org, "Junio C Hamano" <gitster@pobox.com>,
	"Martin Ågren" <martin.agren@gmail.com>
Subject: Re: [PATCH] doc: remove custom callouts format
Date: Tue, 18 Apr 2023 02:17:13 -0400	[thread overview]
Message-ID: <20230418061713.GA169940@coredump.intra.peff.net> (raw)
In-Reply-To: <643e2aeae0515_217cdb29473@chronos.notmuch>

On Mon, Apr 17, 2023 at 11:30:18PM -0600, Felipe Contreras wrote:

> If we do this then the parser has no trouble understanding what we are trying
> to do:
> 
>   --- a/Documentation/git-checkout.txt
>   +++ b/Documentation/git-checkout.txt
>   @@ -523,36 +523,37 @@ EXAMPLES
>      the `Makefile` to two revisions back, deletes `hello.c` by
>      mistake, and gets it back from the index.
>    +
>   +--
>    ------------
>    $ git checkout master             <1>
>    $ git checkout master~2 Makefile  <2>
>    $ rm -f hello.c
>    $ git checkout hello.c            <3>
>    ------------
>   -+
>    <1> switch branch
>    <2> take a file out of another commit
>    <3> restore `hello.c` from the index
>   -+

Ah, that makes sense. I tried something like this, but asciidoc was
unhappy with the "+" continuation between the example and the callout
inside the block (which makes sense as there is no "list" to continue
within that block).

Just putting the example and its callouts in a block is sufficient, but
I agree that putting all of the "The following sequence..." list item's
content into a single block makes the source easier to read.

> I don't see why we insist on creating such complex list items though.
> 
> Creating a subsection is much clearer for everyone: the reader, the writer, and
> the parser:

Unless the subsection has a meaningful title, the formatting of the
result looks a bit odd to me:

  EXAMPLES
     1
         The following sequence checks out the master branch, reverts
         the Makefile to two revisions back, deletes hello.c by mistake,
         and gets it back from the index.

as opposed to:

          1. The following sequence checks out the master branch,
             reverts the Makefile to two revisions back, deletes hello.c
             by mistake, and gets it back from the index.

If each example had a short section title, it would make more sense.

At any rate, IMHO it is probably best to start with purely syntactic
fixes that don't change the output, as that is uncontroversial and
addresses the issue with your original patch (which is otherwise making
most spots look nicer). And then any conversation about sections versus
lists can proceed independently.

> > It's probably still worth moving forward with your patch, as I think it
> > takes us in the direction we want long-term (and which builds with
> > asciidoctor are already using). But we may want to pair it with a patch
> > to work around the issue with git-checkout.1 using asciidoc to avoid
> > regressing that section. It may require re-wording or re-organizing to
> > work around the bug.
> 
> I can add that patch depending what we want:
> 
> Open block:
> 
>   1. foo
>   +
>   --
>   bar
> 
>   roo
>   --
> 
> Or subsection:
> 
>   === 1
> 
>   foo
> 
>   bar
> 
>   roo

So I'd prefer the open block.

-Peff

  reply	other threads:[~2023-04-18  6:17 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-18  1:18 [PATCH] doc: remove custom callouts format Felipe Contreras
2023-04-18  4:00 ` Jeff King
2023-04-18  4:41   ` Jeff King
2023-04-18  7:25     ` Felipe Contreras
2023-04-18  5:30   ` Felipe Contreras
2023-04-18  6:17     ` Jeff King [this message]
2023-04-18  7:15       ` Felipe Contreras
2023-04-18  9:03         ` Jeff King
2023-04-18  9:50           ` 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

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

  git send-email \
    --in-reply-to=20230418061713.GA169940@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=felipe.contreras@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=martin.agren@gmail.com \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 NNTP newsgroup(s).