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

Re: [PATCH] doc: git-clone fix discrepancy between asciidoc and asciidoctor

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 23, 2024, 17:44 UTC
Message-ID
<xmqqv80w0zrx.fsf@gitster.g>
In-Reply-To
<xmqqv80w2ji8.fsf@gitster.g>
Junio C Hamano <gitster@pobox.com> writes:
Show 10 quoted lines
> In the meantime, I am tempted to
>
>  (1) apply Dscho's CSS change (but with fixes to avoid "make
>      distclean" issue) and leaving git-clone as-is.  or
> ...
> I'd probably do (1).  Even though chances of unintended regression
> might be smaller with (2), which would only affect clone and init
> manual pages (as opposed to anything that uses <code> inside <pre>),
> it's less work (and more work to validate the result visually, which
> may be a pain).

So, I decided to keep Dscho's latest CSS-workaround change intact, and queued a stupid and obvious workaround clearly marked as a tentative measure on top of it. I am planning to merge these two patches down for the release candidates.

Without your incremental update to git-clone.txt, git-clone.html rendered through asciidoctor will say wrong things, so we'd need to apply it anyway. So I cannot put your patch _on_ _hold_ for the purpose of the upcoming release, if we wanted to ship a set of source that produces correct version of git-clone.html.

So in the end, we'd need both ;-).
Thanks, both.
----- >8 ---------- >8 ---------- >8 ---------- >8 -----
Subject: [PATCH] Doc: fix Asciidoctor css workaround

The previous step introduced docinfo.html to be used to tweak the CSS used by the asciidoctor, that by default renders <code> inside <pre> as a block element, breaking the SYNOPSIS section of a few pages that adopted a new convention we use since Git 2.45.

But in this project, HTML files are all generated. We do not force any human to write HTML by hand, which is an unusual and cruel punishment. "*.html" is in the .gitignore file, and "make clean" removes them. Having a tracked .html file makes "make clean" make the tree dirty by removing the tracked docinfo.html file.

Let's do an obvious, minimum and stupid workaround to generate that file at runtime instead. The mark-up is being rethought in a major way for the next development cycle, so what the CSS workaround we added in the previous step may have to adjusted, possibly in a large way, anyway.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 Documentation/.gitignore                        | 1 -
 Documentation/Makefile                          | 5 +++++
 Documentation/{docinfo.html => docinfo-html.in} | 0
 3 files changed, 5 insertions(+), 1 deletion(-)
 rename Documentation/{docinfo.html => docinfo-html.in} (100%)
diff --git a/Documentation/.gitignore b/Documentation/.gitignore
index d11567fbbe..a48448de32 100644
--- a/Documentation/.gitignore
+++ b/Documentation/.gitignore
@@ -1,6 +1,5 @@
 *.xml
 *.html
-!/docinfo.html
 *.[1-8]
 *.made
 *.texi
diff --git a/Documentation/Makefile b/Documentation/Makefile
index 78e407e4bd..371d56eb5e 100644
--- a/Documentation/Makefile
+++ b/Documentation/Makefile
@@ -209,6 +209,8 @@ XMLTO_EXTRA += --skip-validation
 XMLTO_EXTRA += -x manpage.xsl
 endif
 
+ASCIIDOC_DEPS += docinfo.html
+
 SHELL_PATH ?= $(SHELL)
 # Shell quote;
 SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH))
@@ -337,6 +339,9 @@ clean:
 	$(RM) $(cmds_txt) $(mergetools_txt) *.made
 	$(RM) GIT-ASCIIDOCFLAGS
 
+docinfo.html: docinfo-html.in
+	$(QUIET_GEN)$(RM) $@ && cat $< >$@
+
 $(MAN_HTML): %.html : %.txt $(ASCIIDOC_DEPS)
 	$(QUIET_ASCIIDOC)$(TXT_TO_HTML) -d manpage -o $@ $<
 
diff --git a/Documentation/docinfo.html b/Documentation/docinfo-html.in
similarity index 100%
rename from Documentation/docinfo.html
rename to Documentation/docinfo-html.in
-- 
2.46.0-rc1-52-gda884b23f2
Previous: Junio C HamanoNext: Eric Sunshine
Message 8 of 10 in “doc: git-clone fix discrepancy between asciidoc and asciidoctor”
  1. doc: git-clone fix discrepancy between asciidoc and asciidoctorJean-Noël Avila via GitGitGadget, Jul 20, 2024
  2. Junio C HamanoJul 20, 2024
  3. Junio C HamanoJul 20, 2024
  4. Jean-Noël AVILAJul 21, 2024
  5. Junio C HamanoJul 22, 2024
  6. Jean-Noël AvilaJul 23, 2024
  7. Junio C HamanoJul 23, 2024
  8. Junio C HamanoJul 23, 2024
  9. Eric SunshineJul 23, 2024
  10. Junio C HamanoJul 23, 2024

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.