Skip to content

Commit 6e8debc

Browse files
committed
Use the BranchName when linking back to source
This commit changes the generated docs to use the branch name when linking back to the source document.
1 parent b7496a7 commit 6e8debc

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/CodeGeneration/DocGenerator/AsciiDoc/GeneratedAsciidocVisitor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public override void VisitDocument(Document document)
7373
_newDocument.Attributes.Add(new AttributeEntry("nuget", "https://www.nuget.org/packages"));
7474

7575
var originalFile = Regex.Replace(_source.FullName.Replace("\\", "/"), @"^(.*Tests/)",
76-
$"{github}/tree/{Program.DocVersion}/src/Tests/Tests/");
76+
$"{github}/tree/{Program.BranchName}/src/Tests/Tests/");
7777

7878
_newDocument.Insert(0, new Comment
7979
{

src/CodeGeneration/DocGenerator/AsciiDoc/RawAsciidocVisitor.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ public override void VisitDocument(Document document)
2929
if (directoryAttribute != null) document.Attributes.Remove(directoryAttribute);
3030

3131
var github = "https://github.com/elastic/elasticsearch-net";
32-
var originalFile = Regex.Replace(_source.FullName.Replace("\\", "/"), @"^(.*Tests/)", $"{github}/tree/master/src/Tests/Tests/");
32+
var originalFile = Regex.Replace(_source.FullName.Replace("\\", "/"),
33+
@"^(.*Tests/)", $"{github}/tree/{Program.BranchName}/src/Tests/Tests/");
3334
document.Insert(0, new Comment
3435
{
3536
Style = CommentStyle.MultiLine,

0 commit comments

Comments
 (0)