Socket
Socket
Sign inDemoInstall

@capacitor/docgen

Package Overview
Dependencies
Maintainers
7
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@capacitor/docgen

Docs Readme Markdown and JSON Generator for Capacitor Plugins


Version published
Weekly downloads
28K
decreased by-5.99%
Maintainers
7
Weekly downloads
 
Created
Source

@capacitor/docgen

Docs Readme Markdown and JSON Generator for Capacitor Plugins.

  • Designed specifically for generating docs for Capacitor plugins using TypeScript
  • Gerenates docs data pulled from JSDocs within source code
  • Replaces placeholders within existing README.md markdown files with the generated docs
  • Outputs a json file of the raw docs data
  • Ideal for formatted docs within Github and NPM readme landing pages
  • If you're looking for an entire docs site generator we recommend TypeDoc instead
npm i @capacitor/docgen --save-dev

Example Readme File

# My Capacitor Plugin 🔌

The readme file can be formatted however you'd like. Just insert 
the  HTML placeholder comments where the Index of the API
methods, and the API docs should go.

Below is an index of all the methods available.

<!--DOCGEN_INDEX_START-->
<!--DOCGEN_INDEX_END-->

## Custom Content

Manage your readme content however you'd like, and on every docgen 
rebuild it will leave your original content as is, but update the 
HTML placeholder comments with the updated generated docs.

<!--DOCGEN_API_START-->
<!--DOCGEN_API_END-->

## Commit Your Readme 🚀

The benefit is that this readme file also acts as the landing page 
for Github and NPM, and the anchors within the docs can also be 
linked to and shared.

CLI

Easiest way to run docgen is to install @capacitor/docgen as a dev dependency and add the command to the package.json scripts. In the example below, HapticsPlugin is the primary interface:

docgen --api HapticsPlugin --output-readme README.md
FlagAliasDescription
--api-aThe name of the primary application programming interface. Required
--output-readme-rPath to the markdown file to update. Note that the file must already exist. Required
--output-json-jPath to write the raw docs data as a json file.
--project-pPath to the project's tsconfig.json file, same as the project flag for TypeScript's CLI. By default it'll attempt to find this file.
package.json script
{
  "scripts": {
    "docgen": "docgen --api HapticsPlugin --output-readme README.md"
  }
}

Keywords

FAQs

Package last updated on 30 Sep 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc