Skip to content

Commit a687d9e

Browse files
wilzbach9il
authored andcommitted
Runnable examples: automatically inject the latest version
1 parent 1cc1526 commit a687d9e

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

doc/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
###########################################################
44

55
# tags
6-
LATEST:=$(git describe --abbrev=0 --tags | tr -d v)
6+
LATEST:=$(shell git describe --abbrev=0 --tags | tr -d v)
77

88
# binaries
99
DMD=dmd

doc/custom.ddoc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@ $(COMMON_HEADERS_DLANG)
5151
$(EXTRA_HEADERS)
5252
</head>
5353
<body id='$(TITLE)' class='$(BODYCLASS)'>
54-
$(SCRIPT document.body.className += ' have-javascript')
54+
$(SCRIPT document.body.className += ' have-javascript';
55+
var currentVersion = "$(LATEST)";
56+
)
5557
$(DIVID top, $(DIVC helper, $(DIVC helper expand-container,
5658
<a href="$(ROOT_DIR)menu.html" title="Menu" class="hamburger expand-toggle"><span>Menu</span></a>
5759
$(NAVIGATION)

doc/run_examples_custom.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ function wrapIntoMain(code) {
1111
var currentPackage = $('body')[0].id;
1212
// BUMP mir-algorithm image here: https://github.com/dlang-tour/core-exec/blob/master/Dockerfile
1313
// run.dlang.io frontend: https://github.com/dlang-tour/core/blob/master/public/static/js/tour-controller.js#L398
14-
var codeOut = '/+dub.sdl:\ndependency "mir-algorithm" version="~>0.6.14"\n+/\n';
14+
var codeOut = '/+dub.sdl:\ndependency "mir-algorithm" version="~>'+currentVersion+'"\n+/\n';
1515

1616
// dynamically wrap into main if needed
1717
if (code.indexOf("void main") >= 0) {

0 commit comments

Comments
 (0)