From f107f37c2bf82ad9c2891e9a6de1afecdd2ffd99 Mon Sep 17 00:00:00 2001 From: Charlike Mike Reagent Date: Thu, 1 Nov 2018 05:48:31 +0200 Subject: [PATCH] fix: add CLI docs / usage Signed-off-by: Charlike Mike Reagent --- .verb.md | 16 ++++++++++++++++ README.md | 17 +++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/.verb.md b/.verb.md index 66f3044..2f09a91 100644 --- a/.verb.md +++ b/.verb.md @@ -35,6 +35,22 @@ _We highly recommend to use Yarn when you think to contribute to this project._ $ yarn add {%= name %} ``` +## CLI + +For CLI usage install it globally or as devDependency. +To make it work, you should add <!-- docks-start --> and <!-- docks-end --> placeholders +in your existing file or provide non existing file to `--outfile` flag. +If no `--outfile` flag is given, then it will try to search those HTML comments on README.md +and add the API documentation there. + +```bash +docks # or docks --outfile docs/API.md +``` + +Also, by default it collects documentation from all `src/**/*.{js,jsx,ts,tsx}` files, +but you can give another glob pattern. For example run `docks bar/*.js`. Only block comments +with a `@public` tag are collected and used to render the docs. + ## API diff --git a/README.md b/README.md index 51f169c..9ca4da1 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,7 @@ Project is [semantically](https://semver.org) & automatically released on [Circl ## Table of Contents - [Install](#install) +- [CLI](#cli) - [API](#api) * [src/index.js](#srcindexjs) + [docks](#docks) @@ -53,6 +54,22 @@ _We highly recommend to use Yarn when you think to contribute to this project._ $ yarn add docks ``` +## CLI + +For CLI usage install it globally or as devDependency. +To make it work, you should add <!-- docks-start --> and <!-- docks-end --> placeholders +in your existing file or provide non existing file to `--outfile` flag. +If no `--outfile` flag is given, then it will try to search those HTML comments on README.md +and add the API documentation there. + +```bash +docks # or docks --outfile docs/API.md +``` + +Also, by default it collects documentation from all `src/**/*.{js,jsx,ts,tsx}` files, +but you can give another glob pattern. For example run `docks bar/*.js`. Only block comments +with a `@public` tag are collected and used to render the docs. + ## API