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
brian m. carlson <sandals@crustytoothpaste.net>
Date
Oct 16, 2014, 01:52 UTC
Message-ID
<20141016015253.GC146788@vauxhall.crustytoothpaste.net>
In-Reply-To
<xmqq61flvzay.fsf@gitster.dls.corp.google.com>
On Wed, Oct 15, 2014 at 01:43:49PM -0700, Junio C Hamano wrote:
Show 7 quoted lines
> 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

Looking at the code, it seems the most reusable unit is something like the following:

  TXT_TO_HTML = $(ASCIIDOC) -b xhtml11 $(ASCIIDOC_CONF)
  TXT_TO_XML = $(ASCIIDOC) -b docbook $(ASCIIDOC_CONF)

that is, omitting the -d argument from the variable. Using -d would mean we'd have to have a variable for each of the seven locations we call $(ASCIIDOC).

Show 23 quoted lines
> 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
> 
> >  $(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?

I'm on board with the $(ASCIIDOC_COMMON) idea, but to minimize the number of variables, I think we should leave the -d out of the macro itself. I'll re-roll over the next couple of days.

-- 
brian m. carlson / brian with sandals: Houston, Texas, US
+1 832 623 2791 | http://www.crustytoothpaste.net/~bmc | My opinion only
OpenPGP: RSA v4 4096b: 88AC E9B2 9196 305B A994 7552 F1BA 225C 0223 B187
Previous: Junio C HamanoNext: brian m. carlson
Message 7 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.