DLang Spec rewrite (?)

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Sun May 26 00:03:30 PDT 2013


On 5/26/13 2:03 AM, H. S. Teoh wrote:
> I don't know, to me DDoc is still lacking a major feature: a mechanism
> for per-character translation. The problem is that many output formats
> have a different scheme of metacharacters, and some (most notably LaTeX)
> require special transcription of certain characters. Right now, the only
> way to handle this correctly in DDoc is very painful: write macros for
> every special character and logical entity (like mdash, nbsp, and the
> like), which makes it very hard to write. Your text would look like:
>
> 	$(T)his is Mr$(DOT)$(NBSP)T$(APOS)s $(DOLLAR)0$(DOT)02
> 	recip$(EACUTE)$(MDASH)as seen on TV$(DOT)
>
> This problem is mostly evaded when you're targeting a single output
> format. Once you start targeting more than a single output format, the
> number of required macros grow exponentially. Making the DDoc source
> targetable to *arbitrary* output formats requires practically wrapping
> every character inside a macro, which is impractical.
>
> To work around this problem with the current version of DDoc, you'd need
> an external utility to do the transcriptions for you, which is a hassle.

ESCAPES has been recently defined to partially fix that.

Also, LaTeX has about the same limitation. Someone defined an 
"ActiveTeX" derivative in which each character was active (and therefore 
potentially definable as a macro). As far as I know it didn't catch up, 
which may be a sign that people were okay without that capability.


Andrei



More information about the Digitalmars-d mailing list