https://github.com/simplymichael/markdown-viewer
A simple development-time markdown to HTML renderer
https://github.com/simplymichael/markdown-viewer
contributing-md license-md markdown markdown-viewer readme-md
Last synced: 3 months ago
JSON representation
A simple development-time markdown to HTML renderer
- Host: GitHub
- URL: https://github.com/simplymichael/markdown-viewer
- Owner: simplymichael
- License: mit
- Created: 2020-12-24T09:12:40.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-12-24T10:00:08.000Z (over 4 years ago)
- Last Synced: 2025-02-08T09:45:37.930Z (4 months ago)
- Topics: contributing-md, license-md, markdown, markdown-viewer, readme-md
- Language: JavaScript
- Homepage:
- Size: 86.9 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Markdown Viewer
[](https://travis-ci.com/github/simplymichael/markdown-viewer)
[](https://codecov.io/gh/simplymichael/markdown-viewer)
[](https://npm.im/markdown-viewer)
[](https://github.com/simplymichael/markdown-viewer/LICENSE.md)A simple development-time markdown to HTML renderer.
Check that your markdown files (**README.md**, **LICENSE.md**, **CONTRIBUTING.md**)
are properly constructed on your local machine,
rather than waiting until you push to discover markdown errors.# Table of Contents
- **[Installation](#installation)**
- **[Features](#features)**
- **[Usage](#usage)**
- **[Options](#options)**
- **[Examples](#examples)**
- **[Using NPM scripts](#using-npm-scripts)**## Installation
`npm install --save-dev markdown-viewer`## Features
- Generate HTML files (***.html***) from markdown (***.md***) files
- Output generated HTML file to a default directory or specify a different output directory
- Option to open the generated HTML in the browser immediately after generating it## Usage
`/node_modules/.bin/markdown-viewer [OPTIONS]`
### Options
* `--file`, `-r`: markdown file path, relative to project root; defaults to ***README.md***
* `--output-dir`, `-o`: output directory, relative to project root; defaults to ***.markdown-viewer***.
Make sure to add ***.markdown-viewer*** to your ***.gitignore*** and ***.npmignore*** files
* `--open`, `-b`: if set, opens the generated HTML in the default browser
* `--help`, `-h`: show help document### Examples
- `$ /node_modules/.bin/markdown-viewer`: generate **README.html** from **README.md** and output to ***.markdown-viewer/README.html***
- `$ /node_modules/.bin/markdown-viewer --open`: generate **README.html**, output to ***.markdown-viewer/README.html***, and open in browser
- `$ /node_modules/.bin/markdown-viewer --file CONTRIBUTING.md --output-dir docs --open`: generate **CONTRIBUTING.html**, output to ***docs/CONTRIBUTING.html***, and open in browser### Using NPM scripts
You can add the following stanzas to the *scripts* section of your ***package.json*** file:
- `"view-readme": "./node_modules/.bin/markdown-viewer -b",`
- `"view-contributing": "./node_modules/.bin/markdown-viewer -f CONTRIBUTING.md -b",`
- `"view-license": "./node_modules/.bin/markdown-viewer -f LICENSE.md -b"`Then you can run:
- `npm run view-readme` to view the output of *README.md*
- `npm run view-contributing` to view the output of the *CONTRIBUTING.md* file
- `npm run view-license` to view the output of the *LICENSE.md* file