• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

sojournerc/gulp-markdown-docs: Turn markdown and yaml into a navigable documenta ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

sojournerc/gulp-markdown-docs

开源软件地址(OpenSource Url):

https://github.com/sojournerc/gulp-markdown-docs

开源编程语言(OpenSource Language):

JavaScript 50.5%

开源软件介绍(OpenSource Introduction):

gulp-markdown-docs

Parse markdown into an navigable HTML document with themed code syntax highlighting (via highlight.js), navigation menu (via yaml meta information), and flexible templating and styling.

Install

$ npm install --save-dev gulp-markdown-docs

Usage

var gulp = require('gulp');
var markdownDocs = require('gulp-markdown-docs');

gulp.task('default', function () {
  return gulp.src('docs/*.md')
	.pipe(markdownDocs('index.html', {
    ... options ...
  }))
	.pipe(gulp.dest('./documentation/'));
});

OPTIONS (defaults shown)

Meta Information

yamlMeta: true

Required in order to construct the navigation menu. When set to true, each document given to gulp-markdown-docs should have a YAML header providing needed information about the document.

---
label: Nav Label
id: unique_slug
categorySlug:
categoryLabel: 
categoryRank: 
documentRank: 

# Your Content
...

Sorting (yamlMeta must be true)

If you wanted a document or category to always be at the end you could set this to 10000, or beginning -10000.

All sorting is done on a last-in basis, so the last rank seen is the value used for the category

NOTE slugs/ids need to be unique between categories and documents TODO: !!

categorySort: 'alphabetical', // 'alphabetical' || 'rank' 
documentSort: 'alphabetical', // 'alphabetical' || 'rank'

External Stylesheet

stylesheetUrl: ''

Relative or absolute URL pointing to an external CSS resource. If defined will be added to the document in a link tag.

Layout Stylesheet

layoutStylesheetUrl: __dirname + '/resources/layout.css'

gulp-markdown-docs includes a simple layout by default. false will prevent it from including that layout

Template HTML

templatePath: __dirname + '/resources/index.html'

gulp-markdown-docs includes a simple HTML document by default. Passing a path to a different HTML file allows you to customize the resulting documentation page. NOTE This module looks for <head>...</head> to add stylesheets to, and .doc-nav and .doc-content to append the navigation items and documentation respectively.

Highlight theme

highlightTheme: 'solarized_dark'

see highlight.js for available themes

Markdown

markdown: {
  highlight: function (code) {
    return highlight.highlightAuto(code).value;
  },
  renderer: new marked.Renderer(),
  gfm: true,
  tables: true,
  breaks: false,
  pedantic: false,
  sanitize: true,
  smartLists: true,
  smartypants: false
}

Defaults shown. See documentation for marked for additional details.

License

MIT © Christopher Meyer




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap