@aaron-cw/markdown-generator 中文文档教程
Markdown Generator
从降价文件创建静态站点。
该软件仍在开发中,尚未准备好投入生产。
Installation
npm install markdown-generator --save-dev
API Usage
const markdownGenerator = require('markdown-generator');
markdownGenerator();
Configuration Options
用法:
const markdownGenerator = require('markdown-generator');
const configuration = {
// The directory where the generator will search for markdown files.
inputLocation: path.resolve(__dirname, '../documentation'),
// The directory where html will be output.
outputLocation: path.resolve(__dirname, '../deploy/docs'),
// The file to use as the template for rendering html
templateLocation: path.resolve(__dirname, './templates/index.html'),
// If true, do not output any files.
dryrun: false,
// If true, search will be enabled. If search is disabled, you may want to remove it from the default template.
enableSearch: true,
// The title to use for the static site.
title: 'Default Documentation',
};
markdownGenerator(configuration);
Markdown Format
markdown 生成器使用 GitHub Flavored Markdown 并使用 marked 进行解析。
备忘单可用:[https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet] Markdown
有一个非标准扩展。 Markdown Generator 能够内嵌代码文件。
这样做:
```javascript?./inline-example.js
\```
它呈现为:
Markdown Generator
Creates a static site from markdown files.
This software is still in development and not production ready.
Installation
npm install markdown-generator --save-dev
API Usage
const markdownGenerator = require('markdown-generator');
markdownGenerator();
Configuration Options
Usage:
const markdownGenerator = require('markdown-generator');
const configuration = {
// The directory where the generator will search for markdown files.
inputLocation: path.resolve(__dirname, '../documentation'),
// The directory where html will be output.
outputLocation: path.resolve(__dirname, '../deploy/docs'),
// The file to use as the template for rendering html
templateLocation: path.resolve(__dirname, './templates/index.html'),
// If true, do not output any files.
dryrun: false,
// If true, search will be enabled. If search is disabled, you may want to remove it from the default template.
enableSearch: true,
// The title to use for the static site.
title: 'Default Documentation',
};
markdownGenerator(configuration);
Markdown Format
markdown generator uses GitHub Flavored Markdown and is parsed with marked.
A cheatsheet is available: [https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet]
There is one non-standard extension to markdown. Markdown Generator has the ability to inclde code files inline.
To do so:
```javascript?./inline-example.js
\```
And it renders as: