Skip to content

Commit 0818e17

Browse files
dschomjcheetham
authored andcommitted
asciidoctor: fix synopsis rendering
Since 76880f0 (doc: git-clone: apply new documentation formatting guidelines, 2024-03-29), the synopsis of `git clone`'s manual page is rendered differently than before; Its parent commit did the same for `git init`. The result looks quite nice. When rendered with AsciiDoc, that is. When rendered using AsciiDoctor, the result is quite unpleasant to my eye, reading something like this: SYNOPSIS git clone [ --template= <template-directory>] [ -l ] [ -s ] [ --no-hardlinks ] [ -q ] [ [... continuing like this ...] Even on the Git home page, where AsciiDoctor's default stylesheet is not used, this change results in some unpleasant rendering where not only the font is changed for the `<code>` sections of the synopsis, but padding and a different background color make the visual impression quite uneven: compare https://git-scm.com/docs/git-clone/2.45.0 to https://git-scm.com/docs/git-clone/2.44.0. To fix this, let's apply the method recommended by AsciiDoctor in https://docs.asciidoctor.org/asciidoctor/latest/html-backend/default-stylesheet/#customize-docinfo to partially override AsciiDoctor's default style sheet so that the `<code>` sections of the synopsis are no longer each rendered on their own, individual lines. This fixes #5063. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 7536f15 commit 0818e17

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

Documentation/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,7 @@ ASCIIDOC_DOCBOOK = docbook5
204204
ASCIIDOC_EXTRA += -acompat-mode -atabsize=8
205205
ASCIIDOC_EXTRA += -I. -rasciidoctor-extensions
206206
ASCIIDOC_EXTRA += -alitdd='&\#x2d;&\#x2d;'
207+
ASCIIDOC_EXTRA += -adocinfo=shared
207208
ASCIIDOC_DEPS = asciidoctor-extensions.rb GIT-ASCIIDOCFLAGS
208209
DBLATEX_COMMON =
209210
XMLTO_EXTRA += --skip-validation

Documentation/docinfo.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<style>
2+
pre>code {
3+
display: inline;
4+
}
5+
</style>

0 commit comments

Comments
 (0)