Ddox: support assert to writeln rewrite#1551
Merged
wilzbach merged 2 commits intodlang:masterfrom Feb 17, 2017
Merged
Conversation
Contributor
Author
|
Current ddoc behavior - the pattern https://dlang.org/phobos-prerelease/std_algorithm_searching.html#.minElement Corresponding ddox page: |
PetarKirov
approved these changes
Jan 28, 2017
Member
|
This is a bit odd. But heck let's try it. |
Member
|
conflicts please rebase |
04dcb2c to
7e75b64
Compare
Contributor
Author
rebased ;-) |
Contributor
Author
(merging as rebased and approved) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
There's already some very naive support to rewrite
assert's statements towritelnfunction calls for the ddoc build.This just adds extend the RegExp for
ddox.This approach itself is pretty limited and of course it would be better to do this during compilation (e.g. as a plugin for ddox) and not via RegExp in Js. Moreover, the RegExp itself might catch some false positives and also doesn't support other common operations like
equalor a plain assert.So this is intended as temporary solution until someone has more time to invest into a proper solution.
Btw another reason which makes this complicated is that there are two code boxes (the editor and
codehighlighted produced by ddoc/ddox) and one can only edit the plain source code of the former. At the moment "reset" hides the editor and shows the originalcodefrom ddoc/ddox, but one could argue that there's no point in keeping thiscodebox generated by ddoc/ddox