Skip to content

Commit 9b0b8cb

Browse files
committed
fix local documentation problems; closes #3157 [ci skip]
- update `Gemfile.lock` - rename `prebuild-docs.js` to `docs-update-toc.js` - fix `buildDocs` and `serveDocs` options and ensure TOC is updated - trim extra newlines from EOF in `index.md` after TOC update is run
1 parent 325fd4d commit 9b0b8cb

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

Gemfile.lock

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
GEM
2+
remote: https://rubygems.org/
23
specs:
34
addressable (2.5.2)
45
public_suffix (>= 2.0.2, < 4.0)

package.json

+4-3
Original file line numberDiff line numberDiff line change
@@ -304,9 +304,10 @@
304304
"test": "make clean && make test",
305305
"prepublishOnly": "npm test && make clean && make mocha.js",
306306
"coveralls": "nyc report --reporter=text-lcov | coveralls",
307-
"prebuildDocs": "node scripts/pre-build-docs.js",
308-
"buildDocs": "bundle exec jekyll build --source docs --destination docs/_site --layouts docs/_layouts --safe --drafts",
309-
"serveDocs": "bundle exec jekyll serve --config docs/_config.yml --safe --drafts --watch"
307+
"prebuildDocs": "node scripts/docs-update-toc.js",
308+
"buildDocs": "bundle exec jekyll build --source ./docs --destination ./docs/_site --config ./docs/_config.yml --safe --drafts",
309+
"prewatchDocs": "node scripts/docs-update-toc.js",
310+
"watchDocs": "bundle exec jekyll serve --source ./docs --destination ./docs/_site --config ./docs/_config.yml --safe --drafts --watch"
310311
},
311312
"dependencies": {
312313
"browser-stdout": "1.3.0",

scripts/pre-build-docs.js renamed to scripts/docs-update-toc.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,10 @@ fs.createReadStream(docsFilepath)
2424
.on('close', () => {
2525
console.log('Done.');
2626
})
27-
.pipe(utils.concat(
28-
input => fs.writeFileSync(docsFilepath, toc.insert(String(input), {
27+
.pipe(utils.concat(input => {
28+
const output = toc.insert(String(input), {
2929
bullets: '-',
3030
maxdepth: 2
31-
}))));
31+
}).replace(/\n\n$/, '\n');
32+
return fs.writeFileSync(docsFilepath, output);
33+
}));

0 commit comments

Comments
 (0)