From f43495c165c61d70a8fb6a656dd58b99d45b44f3 Mon Sep 17 00:00:00 2001 From: Andrey Akinshin Date: Sat, 8 Jul 2023 04:12:11 +0200 Subject: [PATCH] Fix documentation generation --- .../BenchmarkDotNet.Build/ChangeLogBuilder.cs | 4 +-- .../Runners/DocumentationRunner.cs | 29 ++++++++++--------- docs/template/public/main.css | 4 +++ 3 files changed, 21 insertions(+), 16 deletions(-) diff --git a/build/BenchmarkDotNet.Build/ChangeLogBuilder.cs b/build/BenchmarkDotNet.Build/ChangeLogBuilder.cs index ce628d09d6..046c5fc728 100644 --- a/build/BenchmarkDotNet.Build/ChangeLogBuilder.cs +++ b/build/BenchmarkDotNet.Build/ChangeLogBuilder.cs @@ -136,11 +136,11 @@ string PresentContributor(GitHubCommit commit) .Distinct() .ToImmutableList(); - var milestoneHtmlUlr = $"https://github.com/{Repo.Owner}/{Repo.Name}/issues?q=milestone:{currentVersion}"; + var milestoneHtmlUlr = $"https://github.com/{Repo.Owner}/{Repo.Name}/issues?q=milestone:v{currentVersion}"; builder.AppendLine("## Milestone details"); builder.AppendLine(); - builder.AppendLine($"In the [{currentVersion}]({milestoneHtmlUlr}) scope, "); + builder.AppendLine($"In the [v{currentVersion}]({milestoneHtmlUlr}) scope, "); builder.Append(issues.Count + " issues were resolved and "); builder.AppendLine(pullRequests.Count + " pull requests were merged."); builder.AppendLine($"This release includes {commits.Count} commits by {contributors.Count} contributors."); diff --git a/build/BenchmarkDotNet.Build/Runners/DocumentationRunner.cs b/build/BenchmarkDotNet.Build/Runners/DocumentationRunner.cs index 10ea30f64f..a7cf31b1bd 100644 --- a/build/BenchmarkDotNet.Build/Runners/DocumentationRunner.cs +++ b/build/BenchmarkDotNet.Build/Runners/DocumentationRunner.cs @@ -133,13 +133,13 @@ private void GenerateChangelogToc() { var content = new StringBuilder(); - content.AppendLine($"- name: {context.VersionHistory.CurrentVersion}"); - content.AppendLine($" href: {context.VersionHistory.CurrentVersion}.md"); + content.AppendLine($"- name: v{context.VersionHistory.CurrentVersion}"); + content.AppendLine($" href: v{context.VersionHistory.CurrentVersion}.md"); foreach (var version in context.VersionHistory.StableVersions.Reverse()) { - content.AppendLine($"- name: {version}"); - content.AppendLine($" href: {version}.md"); + content.AppendLine($"- name: v{version}"); + content.AppendLine($" href: v{version}.md"); } content.AppendLine("- name: Full ChangeLog"); @@ -158,9 +158,9 @@ private void GenerateChangelogFull() content.AppendLine("# Full ChangeLog"); content.AppendLine(""); content.AppendLine( - $"[!include[{context.VersionHistory.CurrentVersion}]({context.VersionHistory.CurrentVersion}.md)]"); + $"[!include[v{context.VersionHistory.CurrentVersion}](v{context.VersionHistory.CurrentVersion}.md)]"); foreach (var version in context.VersionHistory.StableVersions.Reverse()) - content.AppendLine($"[!include[{version}]({version}.md)]"); + content.AppendLine($"[!include[v{version}](v{version}.md)]"); context.GenerateFile(changelogFullFile, content); } @@ -174,9 +174,9 @@ private void GenerateChangelogIndex() content.AppendLine(""); content.AppendLine("# ChangeLog"); content.AppendLine(""); - content.AppendLine($"* @changelog.{context.VersionHistory.CurrentVersion}"); + content.AppendLine($"* @changelog.v{context.VersionHistory.CurrentVersion}"); foreach (var version in context.VersionHistory.StableVersions.Reverse()) - content.AppendLine($"* @changelog.{version}"); + content.AppendLine($"* @changelog.v{version}"); content.AppendLine("* @changelog.full"); context.GenerateFile(changelogIndexFile, content); @@ -185,17 +185,18 @@ private void GenerateChangelogIndex() private void DocfxChangelogGenerate(string version) { EnsureChangelogDetailsExist(); - var header = ChangelogSrcDirectory.Combine("header").CombineWithFilePath(version + ".md"); - var footer = ChangelogSrcDirectory.Combine("footer").CombineWithFilePath(version + ".md"); - var details = ChangelogSrcDirectory.Combine("details").CombineWithFilePath(version + ".md"); - var release = ChangelogDirectory.CombineWithFilePath(version + ".md"); + var md = $"v{version}.md"; + var header = ChangelogSrcDirectory.Combine("header").CombineWithFilePath(md); + var footer = ChangelogSrcDirectory.Combine("footer").CombineWithFilePath(md); + var details = ChangelogSrcDirectory.Combine("details").CombineWithFilePath(md); + var release = ChangelogDirectory.CombineWithFilePath(md); var content = new StringBuilder(); content.AppendLine("---"); - content.AppendLine("uid: changelog." + version); + content.AppendLine("uid: changelog.v" + version); content.AppendLine("---"); content.AppendLine(""); - content.AppendLine("# BenchmarkDotNet " + version); + content.AppendLine("# BenchmarkDotNet v" + version); content.AppendLine(""); content.AppendLine(""); diff --git a/docs/template/public/main.css b/docs/template/public/main.css index e7541186f4..4eee5f9881 100644 --- a/docs/template/public/main.css +++ b/docs/template/public/main.css @@ -5,4 +5,8 @@ #breadcrumb { display: none; +} + +.affix { + display: none !important; } \ No newline at end of file