dlang / ddox

Advanced D documentation engine
MIT License
62 stars 21 forks source link

Access DDOC macros from within custom .dt? #189

Open Abscissa opened 6 years ago

Abscissa commented 6 years ago

When customizing DDOX's diet templates, is there a way to access DDOC macros? (Particularly custom-defined ones)

s-ludwig commented 6 years ago

You can access the .comment.macros field of the doc group, which will include user defined macros, but the macro rendering code is currently private. For simple "constant" macros it should work, tough.

Abscissa commented 6 years ago

The basic "constant" macros would be fine for my purposes.

I tried info.node.docGroup.comment.macros["SOME_DDOC_NAME_HERE"], but unfortunately, info.node.docGroup is null when generating the index page. And info.docGroups is zero-length on many pages. So I'm not sure how to get to a .comment.macros that will work on all pages (Using v0.16.6)