Internal docstrings
These functions are not part of the MultiDocumenter public API.
MultiDocumenter.DocumenterTools.FileInfo
— Typestruct FileInfo
Objects of this type are passed as arguments to the callback of the walkdocs
function. See walkdocs
for information on how to interpret the docstrings.
MultiDocumenter.DocumenterTools.get_meta_redirect_url
— MethodParses the HTML file at indexhtml_path
and tries to extract the url=...
value of the redirect <meta http-equiv="refresh" ...>
tag.
MultiDocumenter.DocumenterTools.isdochtml
— Methodisdochtml(::Fileinfo) -> Bool
Checks if the file is a Documenter-generated HTML file.
MultiDocumenter.DocumenterTools.update_canonical_links
— MethodTakes the multi-versioned Documenter site in docs_directory
and updates the HTML canonical URLs to point to canonical
.
MultiDocumenter.DocumenterTools.update_canonical_links_for_version
— MethodDocumenterTools.update_canonical_links_for_build(
docs_directory::AbstractString;
canonical::AbstractString,
)
canonical
: corresponds to thecanonical
attribute ofDocumenter.HTML
, specifying the root of the canonical URL.
MultiDocumenter.DocumenterTools.walkdocs
— Functionwalkdocs(f, dir::AbstractString[, filter_cb]; collect::Bool=false)
Takes a directory dir
, which is assumed to contain Documenter-generated documentation, walks over all the files and calls f
on each of the files it find. Optionally, a filter_cb(::FileInfo)
function can be passed to only call f
on files for which it returns true
.
f
and filter_cb
will be called with a single object that has the following fields (all strings):
.root
: the root directory of the walk, i.e.dir
(but as an absolute path).filename
: file name.relpath
: path to the file, relative todir
.fullpath
: absolute path to the file
See also the FileInfo
struct.
If collect = true
is set, the function also "collects" all the return values from f
from each of the function calls, essentially making walkdocs
behave like a map
function applied on each of the HTML files.
walkdocs(directory_root, filter = isdochtml) do fileinfo
@show fileinfo.fullpath
end