UNPKG

1.92 kBMarkdownView Raw
1![Grayson Logo](assets/Grayson-Logo.png)
2***HTML Generator***
3
4![ci status](https://travis-ci.org/earthtone/grayson-generator.svg?branch=master)
5
6### Installation
7
8```sh
9npm install -g @earthtone/grayson-generator
10```
11
12### Usage
13
14```sh
15grayson [options]
16```
17
18### Options
19
20```
21 --help, -h Output help info
22 --version, -v Output version number
23
24 --input, -i Source directory or file (defaults to current directory)
25 --output, -o Target directory (defaults to current directory)
26
27 --mode, -m Generation mode (defaults to "page")
28```
29
30Default options and metadata are overwritten by any options or additional metadata available in a project's `package.json` file via the `grayson` node.
31
32```json
33{
34 "name": "example-project",
35 "version": "1.2.0",
36 "description": "Example package.json File",
37 "main": "index.js",
38 "author": "Joe Schmoe",
39 "license": "ISC",
40 "grayson": {
41 "input": "./md",
42 "metadata": {
43 "stylesheets": [
44 "reset.css",
45 "debug.css",
46 "main.css"
47 ],
48 "scripts": [ "bundle.js" ]
49 }
50 }
51}
52```
53
54Additionally, any options passed in via the command-line, overwrite options passed in via `package.json`.
55
56### Modes
57
58#### Pages
59
60Grayson's default mode presumes input will be a directory path to multiple MD files, and will generate one HTML file per MD file in the target directory. If a single MD file is given as input, Grayson will still generate one HTML file per MD file in the given directory. Each HTML file is prepended with a `<nav>` element, hyperlinked to all other generated HTML output.
61
62#### Blog
63
64If the `--mode` option is set to "blog", an additional `index.html` file will be generated (if none already exists), with a `<nav>` element.
65
66#### Slides
67
68If the `--mode` option is set to "slides", all MD files are concatenated into a single HTML file, housed in individual `.slide` containers. No `<nav>` element is prepended to the generated document.