forked from iansinnott/date-fns-dash-docset
-
Notifications
You must be signed in to change notification settings - Fork 0
/
trim-readme.js
33 lines (26 loc) · 952 Bytes
/
trim-readme.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
33
const { trim, replace } = require('ramda');
const { fromReadableStream } = require('./utils.js');
/**
* I use this file just for trimming the dev stuff off the readme. I would have
* liked to use something like sed for this, but I guess my bash-fu is not yet
* there. There was know readily available answer to how to do a multiline
* replacement with sed.
*/
const replacement = `
**Author:** Ian Sinnott [@ian_sinn](https://twitter.com/ian_sinn) [github.com/iansinnott](https://github.com/iansinnott)
For...
* Instructions on how to generate
* Screenshots
* More info
Check out the README at [iansinnott/date-fns-dash-docset](https://github.com/iansinnott/date-fns-dash-docset)
`.trim();
fromReadableStream(process.stdin)
.map(trim)
.map(replace(/---[\s\S]+/gm, replacement))
.subscribe(
result => process.stdout.write(result),
err => {
process.exitCode = 1;
console.log('Error trimming stdin', err);
}
);