{"id":13903189,"url":"https://github.com/JamieMason/self-help","last_synced_at":"2025-07-18T00:33:41.674Z","repository":{"id":51723805,"uuid":"203332328","full_name":"JamieMason/self-help","owner":"JamieMason","description":"Interactive Q\u0026A Guides for Web and the Command Line.","archived":false,"fork":false,"pushed_at":"2023-02-16T23:24:47.000Z","size":7614,"stargazers_count":37,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-18T19:35:33.940Z","etag":null,"topics":["command-line","decision-tree","documentation","documentation-generator","helpdesk","interactive-tutorial","onboarding","q-and-a","walkthrough","walkthrough-help","wiki"],"latest_commit_sha":null,"homepage":"https://jamiemason.github.io/self-help/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JamieMason.png","metadata":{"files":{"readme":".github/README_CONTENT.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"JamieMason"}},"created_at":"2019-08-20T08:22:29.000Z","updated_at":"2024-08-15T10:12:31.000Z","dependencies_parsed_at":"2024-10-03T12:33:01.193Z","dependency_job_id":"b568d981-3b41-4e14-b74d-0bdf2ab0aa0b","html_url":"https://github.com/JamieMason/self-help","commit_stats":{"total_commits":19,"total_committers":2,"mean_commits":9.5,"dds":"0.10526315789473684","last_synced_commit":"9eec6c10ed3cb09c0c854f1b723ea8ce5c72682c"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JamieMason%2Fself-help","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JamieMason%2Fself-help/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JamieMason%2Fself-help/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JamieMason%2Fself-help/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JamieMason","download_url":"https://codeload.github.com/JamieMason/self-help/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226320948,"owners_count":17606379,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["command-line","decision-tree","documentation","documentation-generator","helpdesk","interactive-tutorial","onboarding","q-and-a","walkthrough","walkthrough-help","wiki"],"created_at":"2024-08-06T22:01:48.679Z","updated_at":"2024-11-25T11:31:24.995Z","avatar_url":"https://github.com/JamieMason.png","language":"TypeScript","readme":"## 🌩 Installation\n\n```\nnpm install --global self-help\n```\n\n## 🕹 Usage\n\n### Interactive CLI\n\nNavigate a Self-Help Document from the Command Line:\n\n```\nself-help interactive --source ./path/to/help-document.js\n```\n\n#### Example\n\n![screenshot](/static/self-help.gif)\n\n### Generate Markdown\n\nGenerate Markdown from a Self-Help Document:\n\n```\nself-help markdown --source ./path/to/help-document.js\n```\n\nMarkdown is written to [stdout](https://www.computerhope.com/jargon/s/stdout.htm) for you to pipe\ninto other Command Line Programs or write to a file.\n\n#### Example\n\nThe `self-help` RxJS Operator Decision Tree Example\n[exported as Markdown](https://github.com/JamieMason/self-help/wiki/RxJS-Operator-Decision-Tree).\n\n## 👩🏽‍💻 Writing Documents\n\nA **Help Document** is a JavaScript Module exporting a `getHelpDocument` method of type\n`GetHelpDocument`.\n\n```ts\ntype GetHelpDocument = () =\u003e Node | Promise\u003cNode\u003e;\n```\n\nIt returns a Nested Hierarchy of **Node** Objects.\n\n```ts\ntype Node = Leaf | Branch | AsyncBranch;\n```\n\nWhich form the **Decision Tree** a User will navigate.\n\n```ts\nexport const getHelpDocument = (): Node =\u003e ({\n  label: 'Welcome to Milk and Cookies, how can we help?',\n  children: [\n    {\n      label: `I'm Thirsty, and`,\n      children: () =\u003e http.get('/milks-walkthrough.json'),\n    },\n    {\n      label: `I'm Hungry, and`,\n      children: [\n        {\n          label: 'I love Cookies, so',\n          children: () =\u003e http.get('/cookies-walkthrough.json'),\n        },\n        {\n          label: `Cookies aren't my thing`,\n          value: fs.readFileSync('/GET-OUT.md', 'utf8'),\n        },\n      ],\n    },\n  ],\n});\n```\n\n### `Node` Types\n\n#### `Branch`\n\nA `Branch` presents multiple options to choose from in the form of its `children` Array. Children\ncan be a combination of other `Branch`, `AsyncBranch` or `Leaf` Nodes.\n\n```js\n{\n  label: 'I just cloned the project, and',\n  children: [...]\n}\n```\n\n#### `AsyncBranch`\n\nAn `AsyncBranch` is the same as a `Branch` except its `children` property is a Function which\nreturns a Promise.\n\nThis mechanism allows Help Documents to be combined and linked together, use it to **compose\nhigher-level guides which pull together other Help Documents hosted online** or **break down a large\nHelp Document into smaller files** that can be lazily-loaded at runtime.\n\n```js\n{\n  label: 'I just cloned the project, and',\n  children: () =\u003e Promise.resolve([])\n}\n```\n\n#### `Leaf`\n\nA **Leaf** represents the answer the User has been looking for as they have been navigating a given\nHelp Document. The value can be any String, but is **normally the contents of a Markdown Document**\nwhich explains the answer to the User.\n\n```js\n{\n  label: 'I want to install dependencies',\n  value: fs.readFileSync('/installation.md', 'utf8')\n}\n```\n","funding_links":["https://github.com/sponsors/JamieMason"],"categories":["📚 Learning \u0026 Resources","wiki"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJamieMason%2Fself-help","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FJamieMason%2Fself-help","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJamieMason%2Fself-help/lists"}