-
-
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
Move docs for Base.Pkg into source file. #11912
Conversation
Segfault on travis seems unrelated. Tests are passing locally. |
Formatting should match up with the previous |
This is great to see! About syntax, the docstrings are going to be parsed as Markdown and we (hopefully only temporarily) have an RST output backend, so yeah, we'll want to have single quotes for backticks. I'll try and track down the errors you've found. |
c0fcede
to
93b735f
Compare
Fine by me. Switched out for single quotes, though the CommonMark Spec does allow for any number of consecutive backticks if I'm reading correctly. |
@one-more-minute, it seems to be a dict rehashing problem and needs $ git diff
diff --git a/base/docs/Docs.jl b/base/docs/Docs.jl
index ce76e31..6c8ffb5 100644
--- a/base/docs/Docs.jl
+++ b/base/docs/Docs.jl
@@ -75,11 +75,11 @@ end
type FuncDoc
main
order::Vector{Method}
- meta::Dict{Method, Any}
- source::Dict{Method, Any}
+ meta::ObjectIdDict
+ source::ObjectIdDict
end
-FuncDoc() = FuncDoc(nothing, [], Dict(), Dict())
+FuncDoc() = FuncDoc(nothing, [], ObjectIdDict(), ObjectIdDict())
function doc!(f::Function, data)
fd = get!(meta(), f, FuncDoc())
@@ -127,7 +127,7 @@ catdoc(xs...) = vcat(xs...)
isdoc(x) = isexpr(x, :string, AbstractString) ||
(isexpr(x, :macrocall) && endswith(string(x.args[1]), "_str"))
-dict_expr(d) = :(Dict($([:($(Expr(:quote, f)) => $d) for (f, d) in d]...)))
+dict_expr(d) = :(ObjectIdDict($([:($(Expr(:quote, f)) => $d) for (f, d) in d]...)))
function field_meta (def)
meta = Dict()
@@ -145,12 +145,12 @@ end
type TypeDoc
main
- fields::Dict{Symbol, Any}
+ fields::ObjectIdDict
order::Vector{Method}
- meta::Dict{Method, Any}
+ meta::ObjectIdDict
end
-TypeDoc() = TypeDoc(nothing, Dict(), [], Dict())
+TypeDoc() = TypeDoc(nothing, ObjectIdDict(), [], ObjectIdDict())
function doc!(t::DataType, data, fields)
td = get!(meta(), t, TypeDoc()) Fixes the
|
Great! Can you PR that? I think the |
Will do, yeah I went a bit overboard with it, |
With #11926 merged I'll close this and revisit later on once those problems have be solved. |
Yeah sorry about that, thanks a lot for the effort though. |
That's fine, it managed to shake out a bug so not a wasted effort. |
A first pass at moving the docs for
Pkg
into the source file.I've hit two bugs when trying this:
For
Pkg.rm
andPkg.edit
I've been gettingwhen placing the docstrings above the methods, hence the use of
function rm end
.I believe there's already an issue open for that, but can't find it at the moment (edit: probably #11798).
Second one:
but I have confirmed that all the docs are in
Base.Pkg.META
. Not sure what the trouble is there.I've just copy-pasted what was inhelpdb.jl
straight into the docstrings, so formatting could still use some work.