-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add at-doc
and related code from Docile.
#8581
Conversation
oset = :($before = isdefined($qn) ? Set(methods($n)) : Set{Method}()) | ||
nset = :(setdiff(Set(methods($n)), $before)) | ||
|
||
esc(:($oset; $obj; Docstrings.setmeta!(current_module(), $nset, :method, $source, $(data...)))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than escaping the whole thing and then explicitly qualifying, it might be better just to escape specific parts.
Ok, I'm not sure about this It's much more flexible if the string macro used controls any necessary lazy evaluation. This is already implemented for the I also suspect that you're storing the parsed string (with default escapes, interpolation etc.) instead of the raw string, which will also cause issues (no one wants to have to double escape everything). Again, having the doc system trying to control parsing is unnecessary and brittle. |
It's worse than that, actually – having |
That sounds reasonable to me. It's worked out well in it's current form for Docile so as to not need to import Markdown just to document things. Adding both features to Base does change that though, and your approach makes sense. |
Fair enough, thanks. I think the approach you used in Docile makes a lot of sense for the limitations of 0.3, but yeah, best to take a different tack for Base. Anyway, I'll go ahead and add this tomorrow. |
Your new Markdown.jl readme page has sold me over. This will be really awesome once it's finished! |
This is some initial work to add
@doc
from Docile. I'm not sure if I've done theinclude
andexport
s correctly -- it does work fine when callingusing Base.Docstrings
.Only the module itself is exported from
Base
since I didn't feel adding additional exports was necessary.I've retained the metadata section for each documented object (as per Docile), but I'm aware about the debate regarding whether to include metadata or not.
Hopefully this PR can further the discussion regarding package documentation.
TODO