git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: "brian m. carlson" <sandals@crustytoothpaste.net>
Cc: Junio C Hamano <gitster@pobox.com>,
	Jean-Noel Avila <jn.avila@free.fr>,
	git@vger.kernel.org
Subject: Re: [PATCH 0/8] asciidoc fixups
Date: Thu, 14 May 2015 00:25:44 -0400	[thread overview]
Message-ID: <20150514042544.GA9351@peff.net> (raw)
In-Reply-To: <20150513224131.GC425227@vauxhall.crustytoothpaste.net>

On Wed, May 13, 2015 at 10:41:31PM +0000, brian m. carlson wrote:

> I've been in contact with Dan Allen, the lead on the Asciidoctor
> project.  There are a few things that he pointed out.

Thanks. I was hoping you would get involved. :)

> >   - asciidoctor does not render {litdd}, which is our invention; locally
> >     this may be because I did not have the right incantation, but it is
> >     also broken on git-scm.com. I think the right fix is to define that
> >     attribute for the site renderer (so not a bug in our sources, and
> >     not an asciidoctor bug)
> 
> I passed this as a command-line argument when using asciidoctor to
> generate the docs: -a litdd=--.  For the site, I would recommend just
> defining it there, as you suggested.

Yeah, I tried what you wrote earlier in [1], but it didn't work. But I
just realized it has misplaced quotes. Doing:

  make ... ASCIIDOC_EXTRA="-a 'litdd=&#45;&#45;'"

seems to work OK.

[1] <1413764438-297386-1-git-send-email-sandals@crustytoothpaste.net>
    (sorry no link, gmane seems down)

> >   - in the '[verse]' section of the SYNOPSIS of each man page, AsciiDoc
> >     renders 'git add' in the usual way (with emphasis). Whereas
> >     AsciiDoctor renders it normally, with the literal quotes included.
> 
> What you want here is [verse,subs=normal].  As of Asciidoctor 1.5.0,
> this allows substitutions and markup within verse blocks.  I believe old
> versions of AsciiDoc did not render substitutions and markup in verse
> blocks, despite claiming to, and Asciidoctor picked up that behavior.

That does work for AsciiDoctor, but sadly it seems to break rendering
for AsciiDoc, where it puts:

    <div class="attribution">
    &#8212; subs=normal
    </div>

in the middle of the SYNOPSIS. Yuck. Is there a way to make it work
under both? Or a way to configure AsciiDoctor verses to always use
"subs=normal"?

> >   - We use "{attr? foo}" to display "foo" only when "attr" is set.
> >     AsciiDoctor does not seem to understand this and renders the whole
> >     string.
> 
> Yes, currently Asciidoctor doesn't support this.  Outside of
> asciidoc.conf, which Asciidoctor doesn't read, it looks like there's
> exactly two uses in diff-options.txt.  We could probably rewrite those
> using an attribute.

I think they're already attributes, and it's just a magic syntax; I have
a trivial patch I'll send in a moment.

> >   - Lots of places where we backslash-escape some syntax for AsciiDoc
> >     ends up rendered by AsciiDoctor with the backslashes included.
> [...]
> 
> This is an under-defined area.  AsciiDoc and Asciidoctor both use
> regexes instead of real parsers, and apparently there's some
> disagreement on how these should be interpreted.  (The real solution is
> to use a grammar and parser.) I think in some cases it might be
> sufficient to use backticks, as those prevent further interpretation.

I actually prefer backticks in many cases, but they do come with their
own formatting. Surely there is a way in AsciiDoctor to say "do not
interpret this magically, but also do not format it as monospace"?

I guess the nuclear option is using attributes like {litdd} everywhere
to avoid quoting. But it makes the source so ugly and hard to read.

-Peff

  reply	other threads:[~2015-05-14  4:25 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-12 17:23 [PATCH] doc: fix unmatched code fences Jean-Noel Avila
2015-05-12 18:45 ` Junio C Hamano
2015-05-13  2:15   ` Jeff King
2015-05-13  3:43     ` Junio C Hamano
2015-05-13  3:45       ` Jeff King
2015-05-13  4:32         ` Junio C Hamano
2015-05-13  4:36           ` Jeff King
2015-05-13 22:22             ` brian m. carlson
2015-05-13  4:56     ` [PATCH 0/8] asciidoc fixups Jeff King
2015-05-13  4:57       ` [PATCH 1/8] doc: fix misrendering due to `single quote' Jeff King
2015-05-13  4:58       ` [PATCH 2/8] doc: fix unquoted use of "{type}" Jeff King
2015-05-13  4:58       ` [PATCH 3/8] doc: fix hanging "+"-continuation Jeff King
2015-05-13  4:58       ` [PATCH 4/8] doc: fix length of underlined section-title Jeff King
2015-05-13  4:58       ` [PATCH 5/8] doc/add: reformat `--edit` option Jeff King
2015-05-13  5:01       ` [PATCH 6/8] doc: convert \--option to --option Jeff King
2015-05-13  9:48         ` John Keeping
2015-05-14  4:32           ` Jeff King
2015-05-17 18:34             ` Junio C Hamano
2015-05-13  5:02       ` [PATCH 7/8] doc: drop backslash quoting of some curly braces Jeff King
2015-05-13  5:06       ` [PATCH 8/8] doc: put example URLs and emails inside literal backticks Jeff King
2015-05-13  5:09       ` [PATCH 0/8] asciidoc fixups Jeff King
2015-05-13  5:23       ` Junio C Hamano
2015-05-13  5:37         ` Jeff King
2015-05-13  7:43           ` Johannes Schindelin
2015-05-14  4:29             ` Jeff King
2015-05-13 22:41       ` brian m. carlson
2015-05-14  4:25         ` Jeff King [this message]
2015-05-14  4:34           ` [PATCH 9/8] doc: convert AsciiDoc {?foo} to ifdef::foo[] Jeff King
2015-05-14  7:43           ` [PATCH 0/8] asciidoc fixups Johannes Schindelin
2015-05-14 17:38             ` Jeff King
2015-05-14 18:20               ` Johannes Schindelin
2015-05-14 21:10                 ` Junio C Hamano
2015-05-14 21:17                   ` Jeff King
2015-05-14 21:40                     ` Junio C Hamano
2015-05-14 21:56                       ` David Turner
2015-05-15  2:52           ` brian m. carlson
2015-05-15  4:01             ` Jeff King

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=20150514042544.GA9351@peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jn.avila@free.fr \
    --cc=sandals@crustytoothpaste.net \
    /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).