public MarkupResult Markup(string content, string path)
        {
            var context = new MarkdownContextBuilder()
                          .WithFilePath(path)
                          .WithBasePath(_parameters.BasePath)
                          .WithMvb(_mvb)
                          .WithContent(content)
                          .Build();

            var dependency = new HashSet <string>();
            var compositor = new MarkdigCompositor(dependency);

            return(new MarkupResult
            {
                Html = compositor.Markup(context, _parameters),
                Dependency = dependency.ToImmutableArray()
            });
        }
示例#2
0
 public static MarkdownPipelineBuilder UseDfmExtensions(
     this MarkdownPipelineBuilder pipeline,
     MarkdigCompositor compositor,
     MarkdownContext context,
     MarkdownServiceParameters parameters)
 {
     return(pipeline
            .UseHeadingIdRewriter()
            .UseIncludeFile(compositor, context, parameters)
            .UseCodeSnippet(compositor, context)
            .UseYamlHeader()
            .UseDFMCodeInfoPrefix()
            .UseQuoteSectionNote(parameters)
            .UseXref()
            //.UseEmojiAndSmiley(false)
            .UseTabGroup()
            .UseInineParserOnly(context)
            .UseLineNumber(context, parameters)
            .UseMonikerRange()
            .UseValidators(context, parameters));
 }
示例#3
0
 public static MarkdownPipelineBuilder UseCodeSnippet(this MarkdownPipelineBuilder pipeline, MarkdigCompositor compositor, MarkdownContext context)
 {
     pipeline.Extensions.Insert(0, new CodeSnippetExtension(compositor, context));
     return(pipeline);
 }
示例#4
0
 public static MarkdownPipelineBuilder UseIncludeFile(this MarkdownPipelineBuilder pipeline, MarkdigCompositor compositor, MarkdownContext context, MarkdownServiceParameters parameters)
 {
     pipeline.Extensions.Insert(0, new InclusionExtension(compositor, context, parameters));
     if (context.InclusionSet != null && !context.InclusionSet.IsEmpty)
     {
         pipeline.DocumentProcessed += InclusionExtension.GetProcessDocumentDelegate(context);
     }
     return(pipeline);
 }