DDoc with cross-references

Jonathan M Davis jmdavisProg at gmx.com
Sun Apr 1 21:39:51 PDT 2012


On Monday, April 02, 2012 12:20:31 Ary Manzana wrote:
> I'm planning to add cross-references to the default ddoc output. At
> least that's the simplest thing I could do right now that might improve
> ddoc somehow.
> 
> I see the documentation generated for phobos, for example:
> 
> http://dlang.org/phobos/std_array.html#Appender
> 
> has anchors to the many symbols (in fact, now I notice it's flawed,
> because they are not fully-qualified).
> 
> Does anyone know where can I get the macros for generating such output?
> I will need it for generating the cross-links.
> 
> But a more appropriate question is: why the default ddoc output doesn't
> generate such anchors by default? At least putting an ID to the
> generated DT...

Phobos' macros are in

https://github.com/D-Programming-Language/d-programming-
language.org/blob/master/std.ddoc

As for linking macros,

LREF is used for references within a module.
XREF is used for references to std modules.
CXREF is used for references to core modules.
ECXREF is used for references to etc.c modules.

As for Appender, I don't see any links at all, so I don't know what you're 
talking about. The generic D macro (which just designates D code) is used by 
it in some places, and ddoc does put some stuff in italics in some cases (e.g. 
the name of a function's parameter in the documentation for that function), 
but there are no links in Appender's documentation.

- Jonathan M Davis


More information about the Digitalmars-d-learn mailing list