self-help
Interactive Q&A Guides for Web and the Command Line
Table of Contents
🌩 Installation
npm install --global self-help
🕹 Usage
Interactive CLI
Navigate a Self-Help Document from the Command Line:
self-help interactive --source ./path/to/help-document.js
Example
Generate Markdown
Generate Markdown from a Self-Help Document:
self-help markdown --source ./path/to/help-document.js
Markdown is written to stdout for you to pipe into other Command Line Programs or write to a file.
Example
The self-help
RxJS Operator Decision Tree Example exported as Markdown.
👩🏽💻 Writing Documents
A Help Document is a JavaScript Module exporting a getHelpDocument
method of type GetHelpDocument
.
;
It returns a Nested Hierarchy of Node Objects.
;
Which form the Decision Tree a User will navigate.
;
Node
Types
Branch
A Branch
presents multiple options to choose from in the form of its children
Array. Children can be a combination of other Branch
, AsyncBranch
or Leaf
Nodes.
label: 'I just cloned the project, and' children: ...
AsyncBranch
An AsyncBranch
is the same as a Branch
except its children
property is a Function which returns a Promise.
This mechanism allows Help Documents to be combined and linked together, use it to compose higher-level guides which pull together other Help Documents hosted online or break down a large Help Document into smaller files that can be lazily-loaded at runtime.
label: 'I just cloned the project, and' Promise
Leaf
A Leaf represents the answer the User has been looking for as they have been navigating a given Help Document. The value can be any String, but is normally the contents of a Markdown Document which explains the answer to the User.
label: 'I want to install dependencies' value: fs
🙋🏿♂️ Getting Help
Get help with issues by creating a Bug Report or discuss ideas by opening a Feature Request.
👀 Other Projects
If you find my Open Source projects useful, please share them ❤️
- eslint-formatter-git-log
ESLint Formatter featuring Git Author, Date, and Hash - eslint-plugin-move-files
Move and rename files while keeping imports up to date - eslint-plugin-prefer-arrow-functions
Convert functions to arrow functions - ImageOptim-CLI
Automates ImageOptim, ImageAlpha, and JPEGmini for Mac to make batch optimisation of images part of your automated build process. - Jasmine-Matchers
Write Beautiful Specs with Custom Matchers - karma-benchmark
Run Benchmark.js over multiple Browsers, with CI compatible output - syncpack
Manage multiple package.json files, such as in Lerna Monorepos and Yarn Workspaces
🤓 Author
I'm Jamie Mason from Leeds in England, I began Web Design and Development in 1999 and have been Contracting and offering Consultancy as Fold Left Ltd since 2012. Who I've worked with includes Sky Sports, Sky Bet, Sky Poker, The Premier League, William Hill, Shell, Betfair, and Football Clubs including Leeds United, Spurs, West Ham, Arsenal, and more.