Skip to main content

Introduction

What is it?

Components to Markdown (C2M) came up with the need to document the API of components automatically, as is done in Storybook and Styleguidist, but that is independent and could be inserted anywhere, from the README.md of the project to any site generators that support markdown, such as Docusaurus for example.

It was designed from the ground up to be fully customizable, but keeping simplicity in mind. You can start using the default settings and have a complete and beautiful documentation, and then customize as needed.

Let's build amazing documentation?

Usage

You can use directly as command line tool or as a library.

CLI Usage

You can use it directly from NPX:

npx components-to-markdown --help

Use @latest after the script to enforce the latest stable release, example:

npx components-to-markdown@latest --version

Example:

npx components-to-markdown@latest -w -o ./output-path ./components-path

See API documentation for more details.

Library Usage

You can install it as a NPM package:

npm install components-to-markdown --save-dev

Import and use it:

comp2mark.js
import { componentsToMarkdown } from 'components-to-markdown';

componentsToMarkdown({
sources: ['./components-path'],
output: './output-path',
});

Then just run your script:

node comp2mark.js

See API documentation for more details.