Show the version number with the website
parent
7abb948157
commit
2d6057d65f
11
gulpfile.js
11
gulpfile.js
|
@ -10,6 +10,16 @@ var httpServer = require('http-server');
|
|||
|
||||
var SAMPLES_MDOC_PATH = path.join(__dirname, 'website/playground/playground.mdoc');
|
||||
var WEBSITE_GENERATED_PATH = path.join(__dirname, 'website/playground/samples');
|
||||
var MONACO_EDITOR_VERSION = (function() {
|
||||
var packageJsonPath = path.join(__dirname, 'package.json');
|
||||
var packageJson = JSON.parse(fs.readFileSync(packageJsonPath).toString());
|
||||
var version = packageJson.version;
|
||||
if (!/\d+\.\d+\.\d+/.test(version)) {
|
||||
console.log('unrecognized package.json version: ' + version);
|
||||
process.exit(0);
|
||||
}
|
||||
return version;
|
||||
})();
|
||||
|
||||
gulp.task('clean-release', function(cb) { rimraf('release', { maxBusyTries: 1 }, cb); });
|
||||
gulp.task('release', ['clean-release'], function() {
|
||||
|
@ -344,6 +354,7 @@ gulp.task('website', ['clean-website', 'playground-samples'], function() {
|
|||
|
||||
var contents = data.contents.toString();
|
||||
contents = contents.replace(/\.\.\/release\/dev/g, 'node_modules/monaco-editor/min');
|
||||
contents = contents.replace(/{{version}}/g, MONACO_EDITOR_VERSION);
|
||||
// contents = contents.replace('© 2016 Microsoft', '© 2016 Microsoft [' + builtTime + ']');
|
||||
|
||||
data.contents = new Buffer(contents);
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
<li><a class="nav-item" href="https://github.com/Microsoft/monaco-editor">GitHub</a></li>
|
||||
<li><a class="nav-item" href="playground.html">Playground</a></li>
|
||||
<li><a class="nav-item" href="monarch.html">Monarch</a></li>
|
||||
<li><a class="nav-item" href="https://www.npmjs.com/package/monaco-editor">Download</a></li>
|
||||
<li><a class="nav-item" target="_blank" href="https://registry.npmjs.org/monaco-editor/-/monaco-editor-{{version}}.tgz">Download</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -56,11 +56,21 @@
|
|||
<p>It is licensed under the MIT License and supports IE 9/10/11, Edge, Chrome, Firefox, Safari and Opera.</p>
|
||||
|
||||
<p>The Monaco editor is <span style="font-weight:bold">not</span> supported in mobile browsers or mobile web frameworks. </p>
|
||||
|
||||
|
||||
<p>Find more information at the <a href="https://github.com/Microsoft/monaco-editor">Monaco Editor repo</a>.</p>
|
||||
</div>
|
||||
</div>
|
||||
<hr/>
|
||||
<h3>Download {{version}}</h3>
|
||||
<div class="row">
|
||||
<div class="span12">
|
||||
<br/>
|
||||
<p>The latest released version is <strong>{{version}}</strong>. <a href="https://www.npmjs.com/package/monaco-editor">Download from npm</a>:</p>
|
||||
<pre style="color:black">npm install monaco-editor@{{version}}</pre>
|
||||
or with this direct <a target="_blank" href="https://registry.npmjs.org/monaco-editor/-/monaco-editor-{{version}}.tgz">download link</a>.
|
||||
</div>
|
||||
</div>
|
||||
<hr/>
|
||||
<h3>Editor</h3>
|
||||
<div class="editor row">
|
||||
<div class="span3">
|
||||
|
|
|
@ -33,9 +33,10 @@
|
|||
<div class="nav-collapse collapse">
|
||||
<ul class="nav">
|
||||
<li><a class="nav-item" href="index.html">Home</a></li>
|
||||
<li><a class="nav-item" href="https://github.com/Microsoft/monaco-editor">GitHub</a></li>
|
||||
<li><a class="nav-item" href="playground.html">Playground</a></li>
|
||||
<li><a class="nav-item" href="monarch.html">Monarch</a></li>
|
||||
<li><a class="nav-item" href="https://www.npmjs.com/package/monaco-editor">Download</a></li>
|
||||
<li><a class="nav-item" target="_blank" href="https://registry.npmjs.org/monaco-editor/-/monaco-editor-{{version}}.tgz">Download</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -34,9 +34,10 @@
|
|||
<div class="nav-collapse collapse">
|
||||
<ul class="nav">
|
||||
<li><a class="nav-item" href="index.html">Home</a></li>
|
||||
<li><a class="nav-item" href="https://github.com/Microsoft/monaco-editor">GitHub</a></li>
|
||||
<li><a class="nav-item" href="playground.html">Playground</a></li>
|
||||
<li><a class="nav-item" href="monarch.html">Monarch</a></li>
|
||||
<li><a class="nav-item" href="https://www.npmjs.com/package/monaco-editor">Download</a></li>
|
||||
<li><a class="nav-item" target="_blank" href="https://registry.npmjs.org/monaco-editor/-/monaco-editor-{{version}}.tgz">Download</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue