Collecting data to be used for rendering
When a RakuDoc source is being processed, data is collected about numerous items, such as the Table of Contents, the Index, list and definition entries.
Many RakuDoc blocks allow for recursion, with blocks being embedded within each other. A ProcessState object is therefore created to contain all the intermediary data.
One ProcessState object can be added to another, and so once one block has been processed, it can be 'added' to the ProcessState object of the containing block.
Finally, when an entire RakuDoc source has been fully rendered, it is useful to retain all the intermediary data structures as well.
The overall RakuDoc::Processed object contains data related to the source as well as the rendered data.
By keeping track of the timestamps of the source file and the rendering, it will be possible to determine whether to render a source again, or not.
String of rendered source, may contain Promises during rendering
Index (from X<> markup) Hash entry => Hash of :refs, :sub-index :sub-index (maybe empty) is Hash of sub-entry => :refs, :sub-index :refs is Array of (Hash :target, :place, :is-header) :target is for link, :place is section name :is-header because X<> in headings treated differently to ordinary text
Footnotes (from N<> markup) Ordered Array of :$text, :$retTarget, :$fnNumber, :$fnTarget text is content of footnote, fnNumber is footNote number fnTarget is link to rendered footnote retTarget is link to where footnote is defined to link back form footnote
Semantic blocks (which includes TITLE & SUBTITLE) can be hidden Hash of SEMANTIC => [ PStr | Str ]
An array of warnings is generated and then rendered by the warnings template The warning template, by default is called by the wrap-source template RakuDoc warnings are generated as specified in the RakuDoc v2 document.
An array of accumulated rendered items, added to body when next non-item block encountered
An array of accumulated rendered definitions, added to body when next non-defn block encountered
An array of accumulated rendered numbered items, added to body when next non-item block encountered
An array of accumulated rendered numbered definitions, added to body when next non-defn block encountered
Hash of definition => rendered value for definitions
Array to signal when one or more inline defn are made in a Paragraph
All of the ProcessState attributes, and the following.
Information about the RakuDoc source, eg file name, path, modified, language
The output format that the source has been rendered into
Text between =TITLE and first header, used for place before first header
String value of TITLE.
Target of Title Line
String value of SUBTITLE, provides description of file
When RakuDoc Processed Object modified (source-data
target data generated from block names and :id metadata A set of unique targets inside the file, new targets must be unique
Links (from link-label markup) Hash of destination => :target, :type, :place, :link-label target = computed URL (for local files), place = anchor inside file type has following values:
Rendered version of the ToC
Rendered version of the Index