You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Moves a small docsystem component into coreimg which helps simplify the docs bootstrapping.
`@doc`, `@__doc__`, and `@doc_str` are now defined in `Core` rather than in both `Core` and
`Base`. From some adhoc timings compiling base it seems to have reduced it slightly somehow.
Bare docstrings are parsed as
Core.@doc "..." f
rather than
@doc "..." f
This avoids the unlikely case of a user redefining `@doc` in their own module. Seems like
something that could be classed as surprising behaviour and should be disallowed.
Adjusts the keyword docs in `basedocs.jl` to use `@doc` rather than side-stepping it entirely.
Improves the file and line info captured by `@doc` so that docs can be located correctly in
both `Base` and packages.
Interpolation in docstrings is now lazy and only occurs during display; though cached for
repeated calls. Instead of storing the raw string it is stored as a `SimpleVector`
containing the string parts and interpolated values. This allows for context dependent
autogenerated content in docstrings, such as method signatures, etc. by defining methods of
`Docs.formatdoc` as follows:
immutable __SIGNATURE__ end
function Docs.formatdoc(buffer, d, part::Type{__SIGNATURE__})
# inspect the source code stored in docstring `d` and generate a user-friendly
# signature to replace `part` in the final docstring.
# ...
end
and used as
"""
$__SIGNATURE__
...
"""
function foo(x, y, z = 1)
# ...
end
Other possibilities aside from `__SIGNATURE__` might be `__FIELDS__` for embedding the field
docs of a type into the main docstring. Neither of these are included in this commit.
0 commit comments