-
Notifications
You must be signed in to change notification settings - Fork 21
Closed
Description
Since a couple of days the dlang.org documentation allows to run unittest directly online, see e.g.
https://dlang.org/phobos-prerelease/std_algorithm_searching.html#.minElement
or for more details the PR.
This works because of this ddoc hack that allows to distinguish between unittest examples and full text examples:
DDOC_EXAMPLES = <span class="dlang_runnable"></span>$(DDOCKEYVAL Examples, $0)
I had a quick look at ddox and it seems that it's not as straight forward to distinguish unittest examples from full-text examples, because unittest examples get converted into full-text examples i:
last_decl["comment"] ~= format("Example:\n%s\n---\n%s\n---\n", comment.strip, source);
@s-ludwig what would be the nicest way to transfer the information that an example is runnable (i.e. originates from a unittest block)?
The quick solution would be sth. similar to the ddoc "hack":
last_decl["comment"] ~= format(`<span class="dlang_runnable">\nExample:\n%s\n---\n%s\n---\n</span>`, comment.strip, source);
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels