auto-readme
v1.0.1
Published
A component library and cli for building automated project readme docs
Downloads
8
Maintainers
Readme
Auto Readme
A component library and cli for building automated project readme docs
Install instructions
npm
npm install auto-readme
yarn
yarn add auto-readme
Usage
This module is intended to be used to help make creating and maintaining readmes easy. It uses a react component approach to building readme templates and provides all the primitive components you might need to do so. You can of course create additional components in order to extend what this module does. If you do so, please consider contributing them back to the project.
Basic usage
Define a template file
// readme.js
import { Readme, Title, Description } from 'auto-readme'
export default () => (
<Readme>
<Title>
<Description>
</Readme>
)
auto-readme ./readme.js README.md
This will generate a README.md file with the the following contents:
# my-project-name
This is a description of my project taken from package.json
Components
While any react component can be created and used, we provide the following components out of the box.
Readme
Wrapper component. This component should be returned at the top level
Title
Title display component. Determines the title from package.json
. Additionally the title can be formatted by passing the component the following properties.
- capitalize
- dasherize
- humanize
- titleCase
- underscore
Example
<Title titleCase humanize />;
Description
Description display component. Determines description from package.json
.
Badges
Badge display. Displays desired badges as specified in component properties. Uses package.json
to determine values to generate badges from. Currently only supports the following badges:
- travisci
- npmversion
- daviddm
- daviddmdev
Example
<Badges travisci npmversion daviddm daviddmdev />;
Install
Install instructions display component. Includes a configurable section title.
Component properties are:
title
Allows overriding of the section titlenpm
(default) Specifies that install instructions for npm should be includedyarn
Specifies that install instructions for yarn should be included
Example
<Install />;
Example
<Install title="Install instructions" yarn npm />;
License
License information display component. Determines license from package.json
license field. Can display inline in the README file or externally in a license file with link from README.md.
Example Creates an external LICENSE.md file and links to it.
<License />;
Example Inlines license content
<License inline />;
Markdown
Component for including markdown content from external files. Useful so that you can write chunks of markdown such as guides for usage
or contributing
.
Example
<Markdown file="usage.md" />;
Contributing
We use semantic-release etc.
License
View the License file here