bug-texinfo
[Top][All Lists]
Advanced

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

extensible text styles


From: Per Bothner
Subject: extensible text styles
Date: Mon, 7 Mar 2016 09:13:38 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0

Has anyone considered some mechanism for extensible text styles?
I'm especially interested in being to control the 'class' attribute
in HTML output, but setting other attributes is also useful.

One application is syntax-colorizing programs.
Another is using different styles for terminal prompts,
inputs, and output (though one can use @kdb for the input).

One possible syntax is:
  @span{keyword, contents}
which could be translated to:
  <span class="keyword">contents</span>

A more general format is:
  @span{class=keyword, contents}
That would allow multiple text attributes:
  @span{class=definition, kind=variable, input-file}
translated to:
  <span class="definition" kind="variable">input-file</span>

The "contents" should allow embedded commas; I don't know if that
is a complication.

Typically, you would define a macro so for example @prompt{foo>} would expand
to @span{class=prompt,foo>}.  Again, I don't know if there are macro-related 
gotchas.

I believe there are TeX/LaTeX packages that support colors and
more flexible style changes, though that's not a priority for me personally.

This could be a possible Google Summer of Code project, assuming
we can get consensus on the feature and its syntax.
--
        --Per Bothner
address@hidden   http://per.bothner.com/



reply via email to

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