On Thursday, 2 March 2017 at 00:06:17 UTC, Adam D. Ruppe wrote:
Though it is important to note that adrdox does NOT support
user-defined ddoc macros
But, it DOES now support a footnote kind of thing. Behold:
http://dpldocs.info/experimental-docs/test.html#footnotes
In ddoc, I was tempted to define a $(RANGE_CONCEPT Input) macro
or something like that, which would expand do $(REF
std,range,primitives,is$1Range, $1 range) or something along
those lines (of course, ddoc is so underpowered that wouldn't
even be that good..) because right now we repeat those references
a LOT.
(Actually, I don't love linking to isInputRange's function
definition. I'd prefer a higher-level overview of ranges when we
link it, but isInputRange is the best we have written right now
outside our various books.)
adrdox makes it a bit nicer, `[isInputRange|input range]` will do
what's needed, as long as `std.range.primitives` is imported in
scope (which it typically is for the constraint anyway), but what
if we write a new conceptual article and want to change the links?
That's what led me to the Link_References idea. By defining:
concept_input_range = [isInputRange|input range]
we can just reference text like `It must be an
[concept_input_range]` and be a bit more DRY (and btw
concept_input_range is easier on my autocomplete algorithms than
isInputRange|input range... and infinitely better than the ddoc
macro mess.)
So, I went ahead and implemented that today. And footnotes,
images, and popup text is easy to do in the same framework and
sometimes useful too, so I just did it all together.
My generator isn't just about reading more semantics out of D, it
is also about making something easier to use than ddoc.