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

Re: [PATCH 3/4] Documentation: move some AsciiDoc parameters into variables

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 15, 2014, 20:43 UTC
Message-ID
<xmqq61flvzay.fsf@gitster.dls.corp.google.com>
In-Reply-To
<1413070656-241955-4-git-send-email-sandals@crustytoothpaste.net>
"brian m. carlson" <sandals@crustytoothpaste.net> writes:
Show 8 quoted lines
> Asciidoctor takes slightly different arguments from AsciiDoc in some
> cases.  It has a different name for the HTML backend and the "docbook"
> backend produces DocBook 5, not DocBook 4.5.  Also, Asciidoctor does not
> accept the -f option.  Move these values into variables so that they can
> be overridden by users wishing to use Asciidoctor instead of Asciidoc.
>
> Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
> ---

I think it makes sense to make these customizable, but I wonder if it makes the result easier to maintain if we make units of logical definitions larger, e.g.

	ASCIIDOC = asciidoc
        TXT_TO_MANHTML = $(ASCIIDOC) -b xhtml11 -d manpage $(ASCIIDOC_CONF)
        TXT_TO_ARTICLE = $(ASCIIDOC) -b docbook -d article
	...

ASCIIDOC_EXTRA may want to apply all of them, even though I see that we do not feed it to OBSOLETE_HTML right now. It may also be that $(ASCIIDOC_CONF) and -agit_version=$(GIT_VERSION) could be shared among the ones that currently do not have.

Then the above would become something like:
	ASCIIDOC = asciidoc
	ASCIIDOC_COMMON = $(ASCIIDOC) \
        	$(ASCIIDOC_EXTRA) $(ASCIIDOC_CONF) -agit_version=$(GIT_VERSION)
        TXT_TO_MANHTML = $(ASCIIDOC_COMMON) -b xhtml11 -d manpage
        ...
and would further simplify this part
Show 5 quoted lines
>  $(MAN_HTML): %.html : %.txt asciidoc.conf
>  	$(QUIET_ASCIIDOC)$(RM) $@+ $@ && \
> -	$(ASCIIDOC) -b xhtml11 -d manpage -f asciidoc.conf \
> +	$(ASCIIDOC) -b $(ASCIIDOC_HTML) -d manpage $(ASCIIDOC_CONF) \
>  		$(ASCIIDOC_EXTRA) -agit_version=$(GIT_VERSION) -o $@+ $< && \
into just
	$(TXT_TO_MANHTML) -o $@+ $<

After all, our output formats are fairly limited, I would think. Are there too many different variants and exceptions to make such an approach infeasible?

Previous: brian m. carlsonNext: brian m. carlson
Message 6 of 19 in “Allow building Git with Asciidoctor”
  1. 0/4 Allow building Git with Asciidoctorbrian m. carlson, Oct 11, 2014
  2. 1/4 Documentation: adjust document title underliningbrian m. carlson, Oct 11, 2014
  3. Junio C HamanoOct 13, 2014
  4. 2/4 Documentation: fix mismatched delimiters in git-imap-sendbrian m. carlson, Oct 11, 2014
  5. 3/4 Documentation: move some AsciiDoc parameters into variablesbrian m. carlson, Oct 11, 2014
  6. Junio C HamanoOct 15, 2014
  7. brian m. carlsonOct 16, 2014
  8. 4/4 Documentation: implement linkgit macro for Asciidoctorbrian m. carlson, Oct 11, 2014
  9. Junio C HamanoOct 13, 2014
  10. brian m. carlsonOct 14, 2014
  11. Jakub NarębskiOct 14, 2014
  12. brian m. carlsonOct 14, 2014
  13. Jeff KingOct 14, 2014
  14. Junio C HamanoOct 14, 2014
  15. brian m. carlsonOct 15, 2014
  16. Junio C HamanoOct 15, 2014
  17. Thomas BraunOct 15, 2014
  18. brian m. carlsonOct 15, 2014
  19. Philip OakleyOct 16, 2014

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.