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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Oct 15, 2014 at 01:43:49PM -0700, Junio C Hamano wrote:
> 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).

> 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

Attachment: signature.asc
Description: Digital signature


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]