Skip to content

Commit ca8ca2e

Browse files
committed
add docs
1 parent 972ac7c commit ca8ca2e

File tree

3 files changed

+1665
-2
lines changed

3 files changed

+1665
-2
lines changed

build/build.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,16 @@ const hyperquest = require('hyperzip')(require('hyperdirect'))
88

99
, files = require('./files')
1010
, testReplace = require('./test-replacements')
11+
, docReplace = require('./doc-replacements')
1112

12-
, srcurlpfx = 'https://raw.githubusercontent.com/nodejs/io.js/v' + process.argv[2] + '/'
13+
, srcurlpfx = `https://raw.githubusercontent.com/nodejs/io.js/v${process.argv[2]}/`
1314
, libsrcurl = srcurlpfx + 'lib/'
1415
, testsrcurl = srcurlpfx + 'test/parallel/'
15-
, testlisturl = 'https://github.com/nodejs/io.js/tree/v' + process.argv[2] + '/test/parallel'
16+
, testlisturl = `https://github.com/nodejs/io.js/tree/v${process.argv[2]}/test/parallel`
1617
, libourroot = path.join(__dirname, '../lib/')
1718
, testourroot = path.join(__dirname, '../test/parallel/')
19+
, docurlpfx = `https://raw.githubusercontent.com/nodejs/io.js/v${process.argv[2]}/doc/api/`
20+
, docourroot = path.join(__dirname, '../doc')
1821

1922

2023
if (!/\d\.\d\.\d+/.test(process.argv[2])) {
@@ -89,6 +92,9 @@ hyperquest(testlisturl).pipe(bl(function (err, data) {
8992
})
9093
}))
9194

95+
processFile(docurlpfx + 'stream.markdown', path.join(docourroot, 'stream.markdown'), docReplace)
96+
97+
9298
//--------------------------------------------------------------------
9399
// Grab the joyent/node test/common.js
94100

build/doc-replacements.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module.exports = [
2+
[
3+
/\]([\:|\(]\W?)([^\#]\w+\.html(?:#\w+))/g,
4+
`]$1https://iojs.org/dist/v${process.argv[2]}/doc/api/$2`
5+
]
6+
]

0 commit comments

Comments
 (0)