mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-10 02:47:50 +00:00
Add scripts to generate the docs for lodash/fp.
This commit is contained in:
committed by
John-David Dalton
parent
fbfa578c11
commit
66d6e226a9
@@ -5,6 +5,9 @@ var _ = require('lodash'),
|
||||
fs = require('fs-extra'),
|
||||
path = require('path');
|
||||
|
||||
var mapping = require('../../fp/_mapping'),
|
||||
applyFPMapping = require('./apply-fp-mapping');
|
||||
|
||||
var basePath = path.join(__dirname, '..', '..'),
|
||||
docPath = path.join(basePath, 'doc'),
|
||||
readmePath = path.join(docPath, 'README.md'),
|
||||
@@ -46,7 +49,10 @@ function onComplete(error) {
|
||||
}
|
||||
}
|
||||
|
||||
function build(type) {
|
||||
function build(fpFlag, type) {
|
||||
if (fpFlag) {
|
||||
applyFPMapping(mapping);
|
||||
}
|
||||
var options = _.defaults({}, config.base, config[type]),
|
||||
markdown = docdown(options),
|
||||
filePath = fpFlag ? fpReadmePath : readmePath;
|
||||
@@ -54,4 +60,4 @@ function build(type) {
|
||||
fs.writeFile(filePath, postprocess(markdown), onComplete);
|
||||
}
|
||||
|
||||
build(_.last(process.argv));
|
||||
build(_.includes(process.argv, '--fp'), _.last(process.argv));
|
||||
|
||||
Reference in New Issue
Block a user