dotfiles/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/scripts/generate-docs.js
Cyryl Płotnicki 280bcab25f VSCode update
2016-09-24 13:12:34 +02:00

21 lines
514 B
JavaScript
Executable file

#!/usr/bin/env node
require('../global');
echo('Appending docs to README.md');
cd(__dirname + '/..');
// Extract docs from shell.js
var docs = grep('//@', 'shell.js');
docs = docs.replace(/\/\/\@include (.+)/g, function(match, path) {
var file = path.match('.js$') ? path : path+'.js';
return grep('//@', file);
});
// Remove '//@'
docs = docs.replace(/\/\/\@ ?/g, '');
// Append docs to README
sed('-i', /## Command reference(.|\n)*/, '## Command reference\n\n' + docs, 'README.md');
echo('All done.');