Sha256: 12ce8b5f2cf99485c0d4828f7f0333da3352b1c7d2fb861d90dc844995d67085

Contents?: true

Size: 674 Bytes

Versions: 45

Compression:

Stored size: 674 Bytes

Contents

#!/usr/bin/env node
/* globals cat, cd, echo, grep, sed */
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, '');

// Wipe out the old docs
cat('README.md').replace(/## Command reference(.|\n)*/, '## Command reference').to('README.md');

// Append new docs to README
sed('-i', /## Command reference/, '## Command reference\n\n' + docs, 'README.md');

echo('All done.');

Version data entries

45 entries across 45 versions & 2 rubygems

Version Path
govuk_publishing_components-18.0.0 node_modules/shelljs/scripts/generate-docs.js
govuk_publishing_components-17.21.0 node_modules/shelljs/scripts/generate-docs.js
govuk_publishing_components-17.20.0 node_modules/shelljs/scripts/generate-docs.js
govuk_publishing_components-17.19.1 node_modules/shelljs/scripts/generate-docs.js
govuk_publishing_components-17.19.0 node_modules/shelljs/scripts/generate-docs.js
govuk_publishing_components-17.18.0 node_modules/shelljs/scripts/generate-docs.js
govuk_publishing_components-17.17.0 node_modules/shelljs/scripts/generate-docs.js
govuk_publishing_components-17.16.0 node_modules/shelljs/scripts/generate-docs.js
govuk_publishing_components-17.15.0 node_modules/shelljs/scripts/generate-docs.js
govuk_publishing_components-17.14.0 node_modules/shelljs/scripts/generate-docs.js
govuk_publishing_components-17.13.0 node_modules/shelljs/scripts/generate-docs.js
govuk_publishing_components-17.12.2 node_modules/shelljs/scripts/generate-docs.js
govuk_publishing_components-17.12.1 node_modules/shelljs/scripts/generate-docs.js
govuk_publishing_components-17.12.0 node_modules/shelljs/scripts/generate-docs.js
govuk_publishing_components-17.11.0 node_modules/shelljs/scripts/generate-docs.js
govuk_publishing_components-17.10.0 node_modules/shelljs/scripts/generate-docs.js
govuk_publishing_components-17.9.0 node_modules/shelljs/scripts/generate-docs.js
govuk_publishing_components-17.8.0 node_modules/shelljs/scripts/generate-docs.js
govuk_publishing_components-17.7.0 node_modules/shelljs/scripts/generate-docs.js
govuk_publishing_components-17.6.1 node_modules/shelljs/scripts/generate-docs.js