@@ -15,8 +15,8 @@ public class DocumentationRunner
15
15
{
16
16
private readonly BuildContext context ;
17
17
18
- private readonly DirectoryPath changelogDirectory ;
19
- private readonly DirectoryPath changelogSrcDirectory ;
18
+ public DirectoryPath ChangelogDirectory { get ; }
19
+ public DirectoryPath ChangelogSrcDirectory { get ; }
20
20
private readonly DirectoryPath changelogDetailsDirectory ;
21
21
private readonly DirectoryPath docsGeneratedDirectory ;
22
22
@@ -34,19 +34,19 @@ public DocumentationRunner(BuildContext context)
34
34
this . context = context ;
35
35
36
36
var docsDirectory = context . RootDirectory . Combine ( "docs" ) ;
37
- changelogDirectory = docsDirectory . Combine ( "changelog" ) ;
38
- changelogSrcDirectory = docsDirectory . Combine ( "_changelog" ) ;
39
- changelogDetailsDirectory = changelogSrcDirectory . Combine ( "details" ) ;
37
+ ChangelogDirectory = docsDirectory . Combine ( "changelog" ) ;
38
+ ChangelogSrcDirectory = docsDirectory . Combine ( "_changelog" ) ;
39
+ changelogDetailsDirectory = ChangelogSrcDirectory . Combine ( "details" ) ;
40
40
docsGeneratedDirectory = docsDirectory . Combine ( "_site" ) ;
41
41
42
42
redirectFile = docsDirectory . Combine ( "_redirects" ) . CombineWithFilePath ( "_redirects" ) ;
43
43
docfxJsonFile = docsDirectory . CombineWithFilePath ( "docfx.json" ) ;
44
44
readmeFile = context . RootDirectory . CombineWithFilePath ( "README.md" ) ;
45
45
rootIndexFile = docsDirectory . CombineWithFilePath ( "index.md" ) ;
46
- changelogIndexFile = changelogDirectory . CombineWithFilePath ( "index.md" ) ;
47
- changelogFullFile = changelogDirectory . CombineWithFilePath ( "full.md" ) ;
48
- changelogTocFile = changelogDirectory . CombineWithFilePath ( "toc.yml" ) ;
49
- lastFooterFile = changelogSrcDirectory . Combine ( "footer" )
46
+ changelogIndexFile = ChangelogDirectory . CombineWithFilePath ( "index.md" ) ;
47
+ changelogFullFile = ChangelogDirectory . CombineWithFilePath ( "full.md" ) ;
48
+ changelogTocFile = ChangelogDirectory . CombineWithFilePath ( "toc.yml" ) ;
49
+ lastFooterFile = ChangelogSrcDirectory . Combine ( "footer" )
50
50
. CombineWithFilePath ( "v" + context . VersionHistory . CurrentVersion + ".md" ) ;
51
51
}
52
52
@@ -132,6 +132,10 @@ private void GenerateIndexMd()
132
132
private void GenerateChangelogToc ( )
133
133
{
134
134
var content = new StringBuilder ( ) ;
135
+
136
+ content . AppendLine ( $ "- name: { context . VersionHistory . CurrentVersion } ") ;
137
+ content . AppendLine ( $ " href: { context . VersionHistory . CurrentVersion } .md") ;
138
+
135
139
foreach ( var version in context . VersionHistory . StableVersions . Reverse ( ) )
136
140
{
137
141
content . AppendLine ( $ "- name: { version } ") ;
@@ -153,6 +157,8 @@ private void GenerateChangelogFull()
153
157
content . AppendLine ( "" ) ;
154
158
content . AppendLine ( "# Full ChangeLog" ) ;
155
159
content . AppendLine ( "" ) ;
160
+ content . AppendLine (
161
+ $ "[!include[{ context . VersionHistory . CurrentVersion } ]({ context . VersionHistory . CurrentVersion } .md)]") ;
156
162
foreach ( var version in context . VersionHistory . StableVersions . Reverse ( ) )
157
163
content . AppendLine ( $ "[!include[{ version } ]({ version } .md)]") ;
158
164
@@ -168,6 +174,7 @@ private void GenerateChangelogIndex()
168
174
content . AppendLine ( "" ) ;
169
175
content . AppendLine ( "# ChangeLog" ) ;
170
176
content . AppendLine ( "" ) ;
177
+ content . AppendLine ( $ "* @changelog.{ context . VersionHistory . CurrentVersion } ") ;
171
178
foreach ( var version in context . VersionHistory . StableVersions . Reverse ( ) )
172
179
content . AppendLine ( $ "* @changelog.{ version } ") ;
173
180
content . AppendLine ( "* @changelog.full" ) ;
@@ -178,10 +185,10 @@ private void GenerateChangelogIndex()
178
185
private void DocfxChangelogGenerate ( string version )
179
186
{
180
187
EnsureChangelogDetailsExist ( ) ;
181
- var header = changelogSrcDirectory . Combine ( "header" ) . CombineWithFilePath ( version + ".md" ) ;
182
- var footer = changelogSrcDirectory . Combine ( "footer" ) . CombineWithFilePath ( version + ".md" ) ;
183
- var details = changelogSrcDirectory . Combine ( "details" ) . CombineWithFilePath ( version + ".md" ) ;
184
- var release = changelogDirectory . CombineWithFilePath ( version + ".md" ) ;
188
+ var header = ChangelogSrcDirectory . Combine ( "header" ) . CombineWithFilePath ( version + ".md" ) ;
189
+ var footer = ChangelogSrcDirectory . Combine ( "footer" ) . CombineWithFilePath ( version + ".md" ) ;
190
+ var details = ChangelogSrcDirectory . Combine ( "details" ) . CombineWithFilePath ( version + ".md" ) ;
191
+ var release = ChangelogDirectory . CombineWithFilePath ( version + ".md" ) ;
185
192
186
193
var content = new StringBuilder ( ) ;
187
194
content . AppendLine ( "---" ) ;
@@ -224,7 +231,7 @@ private void EnsureChangelogDetailsExist(bool forceClean = false)
224
231
new DeleteDirectorySettings { Force = true , Recursive = true } ) ;
225
232
226
233
if ( ! context . DirectoryExists ( changelogDetailsDirectory ) )
227
- context . Clone ( changelogDetailsDirectory , Repo . HttpsGitUrl , Repo . ChangelogDetailsBranch ) ;
234
+ context . GitRunner . Clone ( changelogDetailsDirectory , Repo . HttpsGitUrl , Repo . ChangelogDetailsBranch ) ;
228
235
}
229
236
230
237
private void DocfxChangelogDownload ( string version , string versionPrevious , string lastCommit = "" )
@@ -273,7 +280,7 @@ private void UpdateLastFooter()
273
280
var version = context . VersionHistory . CurrentVersion ;
274
281
var previousVersion = context . VersionHistory . StableVersions . Last ( ) ;
275
282
var date = context . VersionStable
276
- ? DateTime . Now . ToString ( "MMMM dd, yyyy" , CultureInfo . InvariantCulture )
283
+ ? DateTime . Now . ToString ( "MMMM dd, yyyy" , CultureInfo . InvariantCulture )
277
284
: "TBA" ;
278
285
279
286
var content = new StringBuilder ( ) ;
0 commit comments