[Top][All Lists]

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

website: texinfo macros for both ID and classes

From: Paul
Subject: website: texinfo macros for both ID and classes
Date: Mon, 5 Dec 2016 11:49:27 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1

For the website I'm thinking about adding a macro that can create a div with both an ID and classes. This would be good to have in general and more intuitive for those used to html. For example:

  @macro div {ID, CLASSES}
  <div id="\ID\" class="\CLASSES\">
  @end html
  @end macro

Used like so:

  @div {an-id,first-class second-class}

Currently we have divId and divClass that could be replaced by such a macro.

  @div {an-id}  -->   <div id="an-id" class="">

@div {,first-class second-class} --> <div id="" class="first-class second-class">

Unfortunately there seems to be no conditionals in texinfo macros so I don't see a way to avoid the empty id="" and class="" in that scenario. To avoid that we would have to keep divId and divClass and add divIdClass.[0] But I think having one macro for divs would be simpler and easier for contributors, which might be the best variable to optimize for.

If we did this for divs it would make sense to do the same for spans and our current spanClass.


[0] Maybe pluralize divIdClasses and divClasses to make it clear that you can have more than one.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]