Docile.Collector
Functions [Internal]
isdocstring ¶
Does the expression represent a docstring?
source: Docile/src/Collector/utilities.jl:159
name ¶
Extract the symbol identifying an expression.
source: Docile/src/Collector/utilities.jl:307
process! ¶
Extract all docstrings and metadata from a given file
source: Docile/src/Collector/docstrings.jl:38
recheck ¶
Convert category from :symbol
to either :module
or :function
.
source: Docile/src/Collector/utilities.jl:101
Methods [Internal]
definedmodules!(out, expr::Expr) ¶
Return the set of toplevel modules that are defined in an expression.
source: Docile/src/Collector/utilities.jl:280
docstrings(m::Docile.Collector.ModuleData) ¶
Extract all docstrings and basic metadata (file, line, & code) from a module.
source: Docile/src/Collector/docstrings.jl:16
findexternal(docs) ¶
Check whether a docstring is acutally a file path. Read that instead if it is.
source: Docile/src/Collector/utilities.jl:226
findmodule(expr::Expr, mod::Module) ¶
Extract the module expression corresponding to a Module
object.
source: Docile/src/Collector/utilities.jl:242
findpackages(rootfiles::Set{UTF8String}) ¶
Return the PackageData
objects associated with a set of files.
source: Docile/src/Collector/utilities.jl:259
get_aside!(output, moddata, state, file, block) ¶
Extract the comment block from expressions and capture metadata.
source: Docile/src/Collector/docstrings.jl:75
get_docs!(output, moduledata, state, file, block) ¶
Extract a docstring and associated object(s) as well as metadata.
source: Docile/src/Collector/docstrings.jl:92
getcategory(x) ¶
The category of an expression. :symbol
is resolved at a later stage by recheck
.
source: Docile/src/Collector/utilities.jl:112
getdotfile(dir::AbstractString) ¶
Check for a .docile
configuration file in the directory dir
.
Load the file if it is found. The file should end with a Dict{Symbol, Any}
and can contain any additional Julia code such as method extensions for
the metamacro
function and custom docstring formatters.
import Docile: Formats
immutable MyCustomFormatter <: Formats.AbstractFormatter end
Formats.parsedocs(::Formats.Format, raw, mod, obj) = # ...
function Formats.metamacro(::Formats.MetaMacro{:custom}, body, mod, obj)
# ...
end
# Provide additional metadata to package and its modules. Must be last in file.
Dict(
:format => MyCustomFormatter,
# ...
)
source: Docile/src/Collector/utilities.jl:342
getobject(::Docile.Utilities.Head{:macro}, moduledata, state, expr, ::Any) ¶
Get the (anonymous function)
object defined by a macro expression.
Used to associate docstrings with macros
" ... "
macro mac(args...)
end
source: Docile/src/Collector/utilities.jl:48
getobject(::Docile.Utilities.Head{:method}, moduledata, state, expr, codesource) ¶
Find all Method
objects defined by a given expression.
Used to associate a docstring with one or more methods or inner constructors of a type.
" ... "
f(x, y = 1) = x + y
type T
x :: Int
" ... "
T(x, y) = new(x + y)
end
source: Docile/src/Collector/utilities.jl:25
getobject(::Docile.Utilities.Head{:tuple}, ::Any, state, expr, ::Any) ¶
Find group of methods that match a provided signature.
Syntax example
" ... "
(a, Any, Vararg{Int})
defines a docstring " ... "
for all Method
objects of Function
a
that match the signature (Any, Int...)
.
If a
is not yet defined at the point where the docstring is placed, then quote
the function name as follows:
" ... "
(:a, Any, Vararg{Int})
source: Docile/src/Collector/utilities.jl:69
getobject(::Union{Docile.Utilities.Head{:vcat}, Docile.Utilities.Head{:vect}}, ::Any, state, expr, ::Any) ¶
Find a set of methods and a set of functions that match the provided vector.
Syntax example
" ... "
[a, :b, (d, Any, Int)]
will associate the docstring " ... "
with the functions a
and b
as well as
all methods of function d
matching the signature (Any, Int)
.
This syntax is a generalisation of the single symbol syntax
" ... "
a
or
" ... "
:b
and the method syntax using a tuple
" ... "
(d, Any, Int)
source: Docile/src/Collector/utilities.jl:98
getobject(cat::Symbol, moduledata, state, expr, codesource) ¶
Find all objects described by an expression.
source: Docile/src/Collector/utilities.jl:6
includedfiles(mod::Module, candidates::Set{T}) ¶
Which source files are known to be included in a module.
Note: files with only constants will not be detected.
source: Docile/src/Collector/search.jl:25
is_aside(block) ¶
Is the tuple a valid comment block?
source: Docile/src/Collector/utilities.jl:182
isdocblock(block) ¶
Does the tuple of expressions represent a valid docstring and associated object?
source: Docile/src/Collector/utilities.jl:173
isrootfile(mod::Symbol, parsed::Expr) ¶
Is the file the root for a module mod
. Check for Expr(:module, ...)
.
Note: Assumes that all submodules have unique names.
source: Docile/src/Collector/search.jl:60
isrootmodule(m::Module) ¶
Is the module a toplevel one not including the module Main
?
source: Docile/src/Collector/utilities.jl:298
location(object::Method) ¶
Path to definition of a julia object, only methods are searched for.
source: Docile/src/Collector/search.jl:51
postprocess!(cat::Symbol, metadata, ex) ¶
Add some additional metadata for macros and method definitions.
source: Docile/src/Collector/docstrings.jl:121
samemodule(expr, mod) ¶
Does the expression expr
represent the module name mod
?
source: Docile/src/Collector/utilities.jl:304
skipexpr(x) ¶
Blacklist some expressions so search doesn't decend into them.
source: Docile/src/Collector/utilities.jl:130
store!(output, object, docs, metadata) ¶
Save docstrings and metadata for the objects that have been found.
source: Docile/src/Collector/docstrings.jl:138
submodules(mod::Module) ¶
Return the set of all submodules of a given module mod
.
source: Docile/src/Collector/search.jl:6
Types [Internal]
Docile.Collector.Output ¶
Temporary container used for docstring processing. Not the final storage.