Issue 8794 - Add DDOC_ANCHOR macro for qualified anchor links#1174
Issue 8794 - Add DDOC_ANCHOR macro for qualified anchor links#1174WalterBright merged 5 commits intodlang:masterfrom
Conversation
|
The ddoc tests will need to be updated. |
|
As @yebblies said, after fixing those this diff LGTM. |
|
Thanks for the comments. I've just now got the ddoc tests up & running on my system, so I will commit the |
How does this work for function overloads? Will all overloads get the same anchor? We have to decide whether this is OK or whether we want unique anchors for all symbols (which probably means we'd have to use the mangled names as anchors) |
|
@jpf91: All overloads get the same anchor. I quite like being able to easily guess the anchor name to use for links, which is harder to do when using the mangled name. I can see how using the mangled name neatly solves the overload problem though. If we merge this PR, we could still add the mangled name as argument |
This prevents repetition, using anchor names like TemplateClass instead of TemplateClass.TemplateClass, which is important for the Jump-to link section.
|
After fixing some issues, I've now committed the ddoc test changes. Note that I've only run the ddoc tests, not all compilable tests as I've had some trouble with the test suite - but hopefully the ddoc tests are the only ones really needed here. Unfortunately I have found that template symbols that are themselves members of a template get |
Issue 8794 - Add DDOC_ANCHOR macro for qualified anchor links
dlang/dmd#1174 pull adds `DDOC_ANCHOR` macro for qualified anchor links which we don't need because it's buggy (e.g. it doesn't support templates members). So we have to disable it for now and wait until it is fixed.
`DDOC_ANCHOR` was added by dlang#1174
http://d.puremagic.com/issues/show_bug.cgi?id=8794
Currently there is no way to generate qualified anchor links in DDoc output - i.e.
<a name="MyClass.myMember"></a>rather than justmyMember.This pull request adds a new DDoc macro,
DDOC_ANCHOR, which is expanded wherever a symbol declaration appears in the documentation. The qualified symbol name is passed as argument$1. This is in contrast toDDOC_PSYMBOL, which only passes the current identifier without any context, and does so wherever the symbol name occurs in the document output, including text descriptions.