Skip to content

Commit

Permalink
Fix documentation generation
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreyAkinshin committed Jul 8, 2023
1 parent 3b361e3 commit f43495c
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 16 deletions.
4 changes: 2 additions & 2 deletions build/BenchmarkDotNet.Build/ChangeLogBuilder.cs
Expand Up @@ -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.");
Expand Down
29 changes: 15 additions & 14 deletions build/BenchmarkDotNet.Build/Runners/DocumentationRunner.cs
Expand Up @@ -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");
Expand All @@ -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);
}
Expand All @@ -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);
Expand All @@ -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("");

Expand Down
4 changes: 4 additions & 0 deletions docs/template/public/main.css
Expand Up @@ -5,4 +5,8 @@

#breadcrumb {
display: none;
}

.affix {
display: none !important;
}

0 comments on commit f43495c

Please sign in to comment.