Skip to content

Commit aba693b

Browse files
authored
Merge pull request #2496 from wilzbach/changelog
Improve the dlang.org changelog setup
2 parents e2574c6 + 2607264 commit aba693b

File tree

4 files changed

+11
-6
lines changed

4 files changed

+11
-6
lines changed

changelog/prerelease.ddoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ $4
88
)
99

1010
PHOBOS_PATH=$(ROOT_DIR)phobos-prerelease/
11-
CHANGELOG_SOURCE_FILE=$(DIVC changelog-source-edit-btn, $(LINK2 https://github.com/dlang/$1/edit/master/$2, $(TC i, fa fa-edit)))
11+
CHANGELOG_SOURCE_FILE=$(DIVC changelog-source-edit-btn, $(LINK2 https://github.com/dlang/$1/edit/stable/$2, $(TC i, fa fa-edit)))
1212
EXTRA_HEADERS=$(T style,
1313
.changelog-source-edit-btn {
1414
float: right;

ddoc/dub.sdl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ description "Preprocesses source code before running Ddoc over it"
33
dependency "libdparse" version="~>0.8.7"
44
dependency "dmd" path="../../dmd"
55
versions "DdocOptions"
6+
buildRequirements "disallowDeprecations"
67
configuration "executable" {
78
versions "IsExecutable"
89
targetType "executable"

ddoc/source/assert_writeln_magic.d

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -196,10 +196,9 @@ private auto assertWritelnModuleImpl(string fileText)
196196
{
197197
import std.string : representation;
198198
auto fl = FileLines(fileText);
199-
auto visitor = new TestVisitor!(typeof(fl))(fl);
199+
scope visitor = new TestVisitor!(typeof(fl))(fl);
200200
// libdparse doesn't allow to work on immutable source code
201201
parseString(cast(ubyte[]) fileText.representation, visitor);
202-
delete visitor;
203202
return fl;
204203
}
205204

@@ -274,9 +273,8 @@ version(unittest)
274273
{
275274
import std.string : representation;
276275
auto mock = FileLinesMock(sourceCode.split("\n"));
277-
auto visitor = new TestVisitor!(typeof(mock))(mock);
276+
scope visitor = new TestVisitor!(typeof(mock))(mock);
278277
parseString(sourceCode.representation.dup, visitor);
279-
delete visitor;
280278
return mock;
281279
}
282280
}

ddoc/source/preprocessor.d

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,13 @@ auto genChangelogVersion(string fileName, string fileText)
346346
}
347347
else
348348
{
349-
macros ~="\n$(CHANGELOG_NAV %s, %s)".format(versions[el.index - 1], versions[el.index + 1]);
349+
const prevVersion = versions[el.index - 1].to!string;
350+
auto nextVersion = versions[el.index + 1].to!string;
351+
// the next version is the beta release
352+
if (el.index == versions.length - 2 && hasPrerelease)
353+
nextVersion = std.array.replace(nextVersion, "_pre", "");
354+
355+
macros ~="\n$(CHANGELOG_NAV %s, %s)".format(prevVersion, nextVersion);
350356
}
351357
macros ~= "\n_=";
352358
}

0 commit comments

Comments
 (0)