Code Monkey home page Code Monkey logo

action-docs's Introduction

example workflow npm Maintainability Rating Coverage

Action docs

A CLI to generate and update documentation for GitHub actions, based on the action definition .yml. To update your README in a GitHub workflow you can use the action-docs-action.

TL;DR

Add the following comment blocks to your README.md

<!-- action-docs-description -->

<!-- action-docs-inputs -->

<!-- action-docs-outputs -->

<!-- action-docs-runs -->

Generate docs via CLI.

npm install -g action-docs
cd <your github action>

# write docs to console
action-docs

# update reamde
action-docs --update-readme

Run the cli

action-docs -u

CLI

Options

The following options are available via the CLI

Options:
      --help           Show help                                       [boolean]
      --version        Show version number                             [boolean]
  -t, --toc-level      TOC level used for markdown         [number] [default: 2]
  -a, --action         GitHub action file       [string] [default: "action.yml"]
      --no-banner      Print no banner
  -u, --update-readme  Update readme file.                              [string]
  -l, --line-breaks    Used line breaks in the generated docs.
                          [string] [choices: "CR", "LF", "CRLF"] [default: "LF"]

Update the README

Action-docs can update your README based on the action.yml. The following sections can be updated: description, inputs, outputs and runs. Add the following tags to your README and run action-docs -u.

<!-- action-docs-description -->

<!-- action-docs-inputs -->

<!-- action-docs-outputs -->

<!-- action-docs-runs -->

For updating other Markdown files add the name of the file to the command action-docs -u <file>.

Examples

Print action markdown docs to console

action-docs

Update README.md

action-docs --update-readme

Print action markdown for non default action file

action-docs --action ./action.yaml

Update readme, custom action file and set TOC level 3, custom readme

action-docs --action ./some-dir/action.yml --toc-level 3 --update-readme docs.md

API

import { generateActionMarkdownDocs } from 'action-docs'

await generateActionMarkdownDocs({
  actionFile: 'action.yml'
  tocLevel: 2
  updateReadme: true
  readmeFile: 'README.md'
});

Contribution

We welcome contributions, please checkout the contribution guide.

License

This project is released under the MIT License.

action-docs's People

Contributors

bartgolsteijn avatar dependabot[bot] avatar jeroenknoops avatar npalm avatar semantic-release-bot avatar thomashagebols avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.