links to nested structure

Johannes Pfau spam at example.com
Wed Aug 24 02:33:31 PDT 2011


Adam D. Ruppe wrote:
>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.

Maybe toPrettyChars in dsymbol.c is useful here. AFAIK it's supposed to
output the full name of a symbol.

-- 
Johannes Pfau
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20110824/802ffb14/attachment.pgp>


More information about the Digitalmars-d-learn mailing list