forked from kurokikaze/nodejs-docs-rus
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Jakefile.js
32 lines (31 loc) · 1.33 KB
/
Jakefile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
var sys = require('sys'),
fs = require('fs');
desc('Create online version.');
task('default', [], function(params) {
console.log('Creating online version...');
fs.readFile('api.htm', 'utf-8', function(err, data) {
if (err) throw err;
data = data.replace('api-files/logo.png', 'http://nodejs.org/logo.png');
data = data.replace('api-files/jquery.js',
'http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js');
data = data.replace('api-files/sh_main.js',
'http://nodejs.org/sh_main.js');
data = data.replace('api-files/sh_javascript.min.js',
'http://nodejs.org/sh_javascript.min.js');
data = data.replace('api-files/doc.js',
'http://nodejs.org/doc.js');
data = data.replace('<!-- Yandex.Metrika -->',
'<!-- Yandex.Metrika -->\n' +
'<script src="//mc.yandex.ru/metrika/watch.js" type="text/javascript"></script>\n' +
'<script type="text/javascript">\n' +
'try { var yaCounter612423 = new Ya.Metrika(612423); } catch(e){}\n' +
'</script>\n' +
'<noscript><div style="position: absolute;"><img src="//mc.yandex.ru/watch/612423" ' +
'alt="" /></div></noscript>\n' +
'<!-- /Yandex.Metrika -->\n');
fs.writeFile('api.html', data, function (err) {
if (err) throw err;
console.log('Online version successfully created!');
});
});
});