links to nested structure

Adam D. Ruppe destructionator at gmail.com
Tue Aug 23 13:38:48 PDT 2011


Jonathan M Davis wrote:
> I'm fairly certain that the anchors are generated by ddoc, not std.ddoc

Well, it's a bit of both.

DDOC_PSYMBOL = <a name="$0"></a>$(U $0)

Looking at doc.c, DDOC_PSYMBOL is used in the toDocBuffer() methods.
The paramater to it is always this.toChars().

I'm not sure how to do it best. It could probably just do a
parent.toChars() ~ "." ~ toChars() (conceptually) but then it
would output stuff like:

struct <u>Outer.Inner</u>

which still isn't ideal.

But, I think this might be ideal:

("$(DDOC_PSYMBOL %s %s)", toChars(), parent.toChars() ~ [...]);


Then, the macro in std.ddoc can be changed to be like this:

DDOC_PSYMBOL = <a name="$2"></a>$(U $1)


So you keep the simple info and the more detailed name.


I've gotta look at the dmd source to see what's there for the
parent member, but I'm sure there's something.


Maybe I'll do up a pull request this weekend if nothing else
comes up on my schedule.


More information about the Digitalmars-d-learn mailing list