The CodeBlockProcessor utility provides three main methods, traverseLinePart which traverses a line part and applies highlighting, highlightCodeBlock which applies pending highlighting to code block, and setCodeLineNumbers which appends the line-numbers class depending on global settings.
The main function exported by this utility is the processUlNode, called to process a list ul node and its child elements (li nodes).
The Context class is used to manage the state and control flow when processing files that may have references to each other. It tracks the current file being processed, the call stack of files, and variables that are relevant for the processing. The class is particularly useful for situations where the program might encounter cyclic dependencies or references, which is where the CyclicReferenceError class comes into play.
Responsible for managing state and flow of file processing while preventing infinite recursion caused by cyclic references.
The FootnoteProcessor class is designed to handle the processing of footnotes within a MarkBind project. It stores footnotes, processes them, and eventually combines them into a structured block of HTML content. This class helps in rendering footnotes, including handling <include> elements that may also have footnotes.
The HeaderProcessor utility provides two main functions, setHeadingId which increments the counter for same heading text, and sets id of the heading node.
It also provides assignPanelId, which assigns an id to the root element of a panel using the heading specified in the header slot if any.
IncludePanelProcessor utility provides 3 main functions:
processPanelSrc, processInclude, processPopoverSrcThe mechanism of all 3 functions are quite similar.
They do file/source validation, rendering, handling hashes, cyclic reference checks, updating node content, logging.
Differences being that the focus are different on either panel, include or popover elements, with special handling for element-specific logic.
This LinkProcessor utility has a few main functions, including isIntraLink, convertRelativeLinks, validateIntraLink, collectSource etc. It provides utility on processing links, validating and resolving sources.
MarkdownProcessor is a class to use the methods from markdown-it. markdown-it is an external library that does the Markdown parsing and rendering, and some custom plugins are used and customized together with markdown-it.
Class that is responsible for rendering markdown-in-attributes. Process markdown attributes of element, and insert <slot> child as needed. etc.
This exports the utility function to remove every script and style node that may be written by the user, hoist to after <body> at a later stage to prevent Vue compilation of the tags.
This exports the classes PageNavProcessor, which replaces and stores a uuid identifier to the only page-nav element if there is one.
It also exports the function renderSiteNav.
The class is responsible for managing and validating intra-site links within the system.
NodeProcessorConfig type, which is used to configure the behavior of the SiteLinkManager.MbNode type, which represents a node in the document tree.setHeadingId function, which is used to set IDs for heading tags.NodeProcessorConfig that holds configuration settings.Map that stores sets of resource paths keyed by the current working file (CWF). This is used to collect intra-links that need to be validated.Map that stores sets of hashes (IDs) keyed by file paths. This is used to maintain a mapping of reachable sections within files.config, intralinkCollection, and filePathToHashesMap properties.intralinkCollection, ensuring each pair is unique.intralinkCollection if intra-site link validation is enabled.filePathToHashesMap.filePathToHashesMap for validation.