ddoc: Can I escape a colon?

Ali Çehreli via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Feb 23 13:34:00 PST 2017


On 02/23/2017 01:04 PM, Nick Sabalausky (Abscissa) wrote:
> Suppose I want ddoc output to include this line:
>
> --------------
> Note: Blah blabbety blah
> --------------
>
> But the colon causes "Note" to be considered a section header. Is there
> a way to escape the ":" so that it's displayed as expected, but doesn't
> trigger a section?

DDoc has the following syntax as in "$ should be replaced with $" at

   http://dlang.org/spec/ddoc.html

(None of the following is tested.)

a) Try using the following macro:

     COLON = :

And then use "Note$(COLON) Blah".

b) Perhaps easier:

     COLON = :
     NOTE = Note$(COLON)

Then use "$(NOTE) Blah"

c) Another option:

     NOTE = Note: $0

Then use "$(NOTE Blah)"

Ali



More information about the Digitalmars-d-learn mailing list