Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions PSPublishModule/PSPublishModule.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
<PackageReference Include="System.Reflection.MetadataLoadContext" Version="8.0.0" />
<PackageReference Include="Spectre.Console" Version="0.55.2" />
<PackageReference Include="Spectre.Console.Json" Version="0.55.2" />
<PackageReference Include="HtmlForgeX" Version="0.44.0" />
<PackageReference Include="HtmlForgeX.Markdown" Version="0.20.12" />
<PackageReference Include="OfficeIMO.Markdown" Version="0.6.29" />
<PackageReference Include="HtmlForgeX" Version="0.50.0" />
<PackageReference Include="HtmlForgeX.Markdown" Version="0.21.0" />
<PackageReference Include="OfficeIMO.Markdown" Version="0.6.42" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net8.0' ">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ private static void ConfigureDocumentDefaults(Document document)

private static void ConfigureMarkdownTheme(Document document)
{
document.Head.AddCssInline("""
document.Head.AddCssInline(TrustedCss.FromTrustedSource("""
/* hfx-module-docs-markdown */
.hfx-md {
color: var(--tblr-body-color, #1f2937);
Expand Down Expand Up @@ -175,7 +175,7 @@ private static void ConfigureMarkdownTheme(Document document)
background: rgba(var(--tblr-info-rgb, 66, 153, 225), .12);
border-left-color: rgba(var(--tblr-info-rgb, 66, 153, 225), .7);
}
""");
"""));
}

private static void ConfigureNestedTabs(TablerTabs tabs, string navWidth = "18rem", string navMaxHeight = "70vh")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ private static void RenderStructuredReleases(TablerTabsPanel panel, IEnumerable<

if (releaseList.Count == 0)
{
panel.Markdown("No releases available.", new MarkdownOptions { HeadingsBaseLevel = 2, Sanitize = true });
panel.Markdown("No releases available.", new MarkdownOptions { HeadingsBaseLevel = 2 });
return;
}

Expand Down Expand Up @@ -125,18 +125,12 @@ private static void RenderStructuredReleases(TablerTabsPanel panel, IEnumerable<
{
HeadingsBaseLevel = 2,
AutolinkBareUrls = true,
Sanitize = true,
AllowRawHtmlInline = true,
AllowRawHtmlBlocks = true
});
body.Markdown(release.Body.Trim(), new MarkdownOptions
{
HeadingsBaseLevel = 3,
AutolinkBareUrls = true,
OpenLinksInNewTab = false,
Sanitize = true,
AllowRawHtmlInline = true,
AllowRawHtmlBlocks = true,
AllowRelativeLinks = true,
TableMode = MarkdownTableMode.DataTables,
DataTables = new MarkdownDataTablesOptions
Expand All @@ -154,7 +148,6 @@ private static void RenderStructuredReleases(TablerTabsPanel panel, IEnumerable<
body.Markdown("### Assets", new MarkdownOptions
{
HeadingsBaseLevel = 2,
Sanitize = true
});

var assetRows = release.Assets.Select(asset => new
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,11 +218,8 @@ string NormalizeForCompare(string s)
HeadingsBaseLevel = 2,
TableMode = MarkdownTableMode.DataTables,
OpenLinksInNewTab = true,
Sanitize = true,
AutolinkBareUrls = true,
AllowRelativeLinks = true,
AllowRawHtmlInline = true,
AllowRawHtmlBlocks = true,
BaseUri = it.BaseUri,
DataTables = new MarkdownDataTablesOptions {
Responsive = true,
Expand Down Expand Up @@ -258,7 +255,7 @@ string NormalizeForCompare(string s)
inner.AddTab(name ?? string.Empty, p =>
{
var md = s.Content ?? string.Empty; // already fenced with powershell
var options = new MarkdownOptions { HeadingsBaseLevel = 2, AutolinkBareUrls = true, Sanitize = true, AllowRawHtmlInline = true, AllowRawHtmlBlocks = true };
var options = new MarkdownOptions { HeadingsBaseLevel = 2, AutolinkBareUrls = true };
p.Markdown(PrepareMarkdown(module, md), options);
});
}
Expand Down Expand Up @@ -291,7 +288,7 @@ string NormalizeForCompare(string s)
inner.AddTab(name ?? string.Empty, pp =>
{
var md = d.Content ?? string.Empty;
var options = new MarkdownOptions { HeadingsBaseLevel = 2, AutolinkBareUrls = true, Sanitize = true, AllowRawHtmlInline = true, AllowRawHtmlBlocks = true, AllowRelativeLinks = true, BaseUri = d.BaseUri, TableMode = MarkdownTableMode.DataTables, DataTables = new MarkdownDataTablesOptions { Responsive = true, Export = true, ExportFormats = new[] { DataTablesExportFormat.Excel, DataTablesExportFormat.CSV, DataTablesExportFormat.Copy }, StateSave = true } };
var options = new MarkdownOptions { HeadingsBaseLevel = 2, AutolinkBareUrls = true, AllowRelativeLinks = true, BaseUri = d.BaseUri, TableMode = MarkdownTableMode.DataTables, DataTables = new MarkdownDataTablesOptions { Responsive = true, Export = true, ExportFormats = new[] { DataTablesExportFormat.Excel, DataTablesExportFormat.CSV, DataTablesExportFormat.Copy }, StateSave = true } };
pp.Markdown(PrepareMarkdown(module, md), options);
});
}
Expand All @@ -307,7 +304,7 @@ string NormalizeForCompare(string s)
inner.AddTab(name ?? string.Empty, pp =>
{
var md = d.Content ?? string.Empty;
var options = new MarkdownOptions { HeadingsBaseLevel = 2, AutolinkBareUrls = true, Sanitize = true, AllowRawHtmlInline = true, AllowRawHtmlBlocks = true, AllowRelativeLinks = true, BaseUri = d.BaseUri, TableMode = MarkdownTableMode.DataTables, DataTables = new MarkdownDataTablesOptions { Responsive = true, Export = true, ExportFormats = new[] { DataTablesExportFormat.Excel, DataTablesExportFormat.CSV, DataTablesExportFormat.Copy }, StateSave = true } };
var options = new MarkdownOptions { HeadingsBaseLevel = 2, AutolinkBareUrls = true, AllowRelativeLinks = true, BaseUri = d.BaseUri, TableMode = MarkdownTableMode.DataTables, DataTables = new MarkdownDataTablesOptions { Responsive = true, Export = true, ExportFormats = new[] { DataTablesExportFormat.Excel, DataTablesExportFormat.CSV, DataTablesExportFormat.Copy }, StateSave = true } };
pp.Markdown(PrepareMarkdown(module, md), options);
});
}
Expand All @@ -326,7 +323,7 @@ string NormalizeForCompare(string s)
inner.AddTab(name ?? string.Empty, pp =>
{
var md = d.Content ?? string.Empty;
var options = new MarkdownOptions { HeadingsBaseLevel = 2, AutolinkBareUrls = true, Sanitize = true, AllowRawHtmlInline = true, AllowRawHtmlBlocks = true, AllowRelativeLinks = true, BaseUri = d.BaseUri, TableMode = MarkdownTableMode.DataTables, DataTables = new MarkdownDataTablesOptions { Responsive = true, Export = true, ExportFormats = new[] { DataTablesExportFormat.Excel, DataTablesExportFormat.CSV, DataTablesExportFormat.Copy }, StateSave = true } };
var options = new MarkdownOptions { HeadingsBaseLevel = 2, AutolinkBareUrls = true, AllowRelativeLinks = true, BaseUri = d.BaseUri, TableMode = MarkdownTableMode.DataTables, DataTables = new MarkdownDataTablesOptions { Responsive = true, Export = true, ExportFormats = new[] { DataTablesExportFormat.Excel, DataTablesExportFormat.CSV, DataTablesExportFormat.Copy }, StateSave = true } };
pp.Markdown(PrepareMarkdown(module, md), options);
});
}
Expand Down Expand Up @@ -360,9 +357,6 @@ void RenderSourceTabs(TablerTabs innerTabs, IEnumerable<DocumentItem> itemsToRen
{
HeadingsBaseLevel = 2,
AutolinkBareUrls = true,
Sanitize = true,
AllowRawHtmlInline = true,
AllowRawHtmlBlocks = true
});
});
}
Expand Down Expand Up @@ -419,7 +413,7 @@ void RenderSourceTabs(TablerTabs innerTabs, IEnumerable<DocumentItem> itemsToRen
{
md = $"```text\n{File.ReadAllText(a.Path)}\n```";
}
p.Markdown(PrepareMarkdown(module, md), new MarkdownOptions { HeadingsBaseLevel = 2, AutolinkBareUrls = true, Sanitize = true, AllowRawHtmlInline = true, AllowRawHtmlBlocks = true });
p.Markdown(PrepareMarkdown(module, md), new MarkdownOptions { HeadingsBaseLevel = 2, AutolinkBareUrls = true });
});
}
});
Expand Down Expand Up @@ -450,7 +444,7 @@ void RenderSourceTabs(TablerTabs innerTabs, IEnumerable<DocumentItem> itemsToRen
md = NormalizeSourceLikeMarkdown(md);
}

p.Markdown(PrepareMarkdown(module, md), new MarkdownOptions { HeadingsBaseLevel = 2, AutolinkBareUrls = true, Sanitize = true, AllowRawHtmlInline = true, AllowRawHtmlBlocks = true });
p.Markdown(PrepareMarkdown(module, md), new MarkdownOptions { HeadingsBaseLevel = 2, AutolinkBareUrls = true });
});
}
});
Expand All @@ -476,7 +470,7 @@ void RenderSourceTabs(TablerTabs innerTabs, IEnumerable<DocumentItem> itemsToRen
{
md = File.ReadAllText(c.Path);
}
p.Markdown(PrepareMarkdown(module, md), new MarkdownOptions { HeadingsBaseLevel = 2, AutolinkBareUrls = true, Sanitize = true, AllowRawHtmlInline = true, AllowRawHtmlBlocks = true });
p.Markdown(PrepareMarkdown(module, md), new MarkdownOptions { HeadingsBaseLevel = 2, AutolinkBareUrls = true });
});
}
});
Expand All @@ -497,7 +491,7 @@ void RenderSourceTabs(TablerTabs innerTabs, IEnumerable<DocumentItem> itemsToRen
}
else
{
panel.Markdown(PrepareMarkdown(module, rel.Content), new MarkdownOptions { HeadingsBaseLevel = 2, AutolinkBareUrls = true, Sanitize = true, AllowRawHtmlInline = true, AllowRawHtmlBlocks = true });
panel.Markdown(PrepareMarkdown(module, rel.Content), new MarkdownOptions { HeadingsBaseLevel = 2, AutolinkBareUrls = true });
}
});
}
Expand Down Expand Up @@ -631,11 +625,11 @@ void RenderSourceTabs(TablerTabs innerTabs, IEnumerable<DocumentItem> itemsToRen
if (module.HelpAsCode && !entry.Structured)
{
var fenced = $"```powershell\n{content}\n```";
p.Markdown(PrepareMarkdown(module, fenced), new MarkdownOptions { HeadingsBaseLevel = 2, AutolinkBareUrls = true, Sanitize = true, AllowRawHtmlInline = true, AllowRawHtmlBlocks = true });
p.Markdown(PrepareMarkdown(module, fenced), new MarkdownOptions { HeadingsBaseLevel = 2, AutolinkBareUrls = true });
}
else
{
p.Markdown(PrepareMarkdown(module, content), new MarkdownOptions { HeadingsBaseLevel = 2, AutolinkBareUrls = true, Sanitize = true, AllowRawHtmlInline = true, AllowRawHtmlBlocks = true });
p.Markdown(PrepareMarkdown(module, content), new MarkdownOptions { HeadingsBaseLevel = 2, AutolinkBareUrls = true });
}
});
}
Expand Down
Loading
Loading