IncludeExpander Pennington.Markdown
Expands DocFX-style [!INCLUDE [title](path)] directives by splicing the referenced Markdown file's content in place. Targets are resolved relative to the referencing file and expanded recursively; a missing or cyclic target collapses to an HTML comment so the build still completes. Directives inside fenced code blocks are left verbatim so syntax can be documented.
Methods
Expand
#public static string Expand(string markdown, FilePath sourceFile, IFileSystem fileSystem)
Expands every include directive in markdown. Paths resolve relative to sourceFile; relative links inside included content are not rebased, so they resolve as if written in the host page.
Parameters
markdownstringsourceFileFilePathfileSystemIFileSystem
Returns
stringPennington.Markdown.IncludeExpander
namespace Pennington.Markdown;
/// Expands DocFX-style [!INCLUDE [title](path)] directives by splicing the referenced Markdown file's content in place. Targets are resolved relative to the referencing file and expanded recursively; a missing or cyclic target collapses to an HTML comment so the build still completes. Directives inside fenced code blocks are left verbatim so syntax can be documented.
public class IncludeExpander
{
/// Expands every include directive in markdown. Paths resolve relative to sourceFile; relative links inside included content are not rebased, so they resolve as if written in the host page.
public static string Expand(string markdown, FilePath sourceFile, IFileSystem fileSystem)
;
}