API documentation
All you normally need to create markdown from a Jekyll source directory
UnifyJustTheDocs.composite
— FunctionCompose a single markdown string with all content of a Jekyll web site configured for the just-the-doc
theme.
composite(rootdir; pandoc_anchors)
Page structures
If you want to work with the parsed tree of pages, the main data structure you can use is:
UnifyJustTheDocs.JTDPage
— TypeA JDTPage
has markdown content, and four optional settings from its YAML header. If the page lacks properties for parent
or grand_parent
, their value will be nothing
; if no nav_order
is set, its value is 0.
Functions for creating and working with JTDPage
s:
UnifyJustTheDocs.readpages
— FunctionRecursively read directories of markdown files into a list of JTDPage
s.
readpages(starthere; anchors)
UnifyJustTheDocs.rootpages
— FunctionSelect from a list of pages all pages that are in the root level of the site.
UnifyJustTheDocs.childpages
— FunctionSelect children of a given page from a list of pages.
childpages(pg, pglist)
Utilities
UnifyJustTheDocs.rootpage
— FunctionFor a single page at the root level of the Jekyll site's content hierarchy, compose a markdown string with the content of the root page together with the content of all of its children and grandchildren pages.
rootpage(pg, pagelist)
UnifyJustTheDocs.stripquotes
— FunctionRemove any leading and trailing quotation marks.
stripquotes(s)
UnifyJustTheDocs.tidyvalue
— FunctionTidy up strings from YAML settings by stripping leading/trailing whitespace, and removing any outer quotes.
tidyvalue(propvalue)
UnifyJustTheDocs.pageparts
— FunctionSplit markdown file into YAML header and markdown body. Returns a tuple of 2 strings. If there is no YAML header, the first string will be empty.
pageparts(f)
UnifyJustTheDocs.adjustpaths
— FunctionRewrite markdown source in mdsrc
to account for relative links in embedded images and direct links to files.
adjustpaths(mdsrc, dir; relpath)
Relative paths in image links are converted to full file paths. If the relpath
parameter is included, elative links to file contents are converted to internal links to pandoc headers. See the docs for more details.