SplitYamlHtml() public static method

public static SplitYamlHtml ( MarkupResult origin ) : IList
origin Microsoft.DocAsCode.Plugins.MarkupResult
return IList
示例#1
0
 private static IEnumerable <YamlHtmlPart> MarkupMultiple(IHostService host, string markdown, FileAndType ft)
 {
     try
     {
         var html  = host.Markup(markdown, ft, true);
         var parts = YamlHtmlPart.SplitYamlHtml(html);
         foreach (var part in parts)
         {
             var mr = host.Parse(part.ToMarkupResult(), ft);
             part.Conceptual      = mr.Html;
             part.LinkToFiles     = mr.LinkToFiles;
             part.LinkToUids      = mr.LinkToUids;
             part.YamlHeader      = mr.YamlHeader;
             part.FileLinkSources = mr.FileLinkSources;
             part.UidLinkSources  = mr.UidLinkSources;
         }
         return(parts);
     }
     catch (Exception ex)
     {
         Debug.Fail("Markup failed!");
         var message = $"Markup failed: {ex.Message}.";
         throw new DocumentException(message, ex);
     }
 }
示例#2
0
 private static IEnumerable <YamlHtmlPart> MarkupMultiple(IHostService host, string markdown, FileAndType ft)
 {
     try
     {
         var html  = host.Markup(markdown, ft, true);
         var parts = YamlHtmlPart.SplitYamlHtml(html);
         foreach (var part in parts)
         {
             var mr = host.Parse(part.ToMarkupResult(), ft);
             part.Conceptual      = mr.Html;
             part.LinkToFiles     = mr.LinkToFiles;
             part.LinkToUids      = mr.LinkToUids;
             part.YamlHeader      = mr.YamlHeader;
             part.FileLinkSources = mr.FileLinkSources;
             part.UidLinkSources  = mr.UidLinkSources;
         }
         return(parts);
     }
     catch (Exception ex)
     {
         System.Diagnostics.Debug.Fail("Markup failed!");
         Logger.LogWarning($"Markup failed:{Environment.NewLine}  Markdown: {markdown}{Environment.NewLine}  Details:{ex.ToString()}");
         return(Enumerable.Empty <YamlHtmlPart>());
     }
 }