Ⅰ. 插件描述
Determines which markup library to use to render a content file (e.g. README) on GitHubⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'github/markup'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'github/markup'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'github/markup'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/github/markup
Ⅳ. 文档说明
GitHub Markup
This library is the first step of a journey that every markup file in a repository goes on before it is rendered on GitHub.com:
github-markupselects an underlying library to convert the raw markup to HTML. See the list of supported markup formats below.- The HTML is sanitized, aggressively removing things that could harm you and your kin—such as
scripttags, inline-styles, andclassoridattributes. - Syntax highlighting is performed on code blocks. See github/linguist for more information about syntax highlighting.
- The HTML is passed through other filters that add special sauce, such as emoji, task lists, named anchors, CDN caching for images, and autolinking.
- The resulting HTML is rendered on GitHub.com.
Please note that only the first step is covered by this gem — the rest happens on GitHub.com. In particular, markup itself does no sanitization of the resulting HTML, as it expects that to be covered by whatever pipeline is consuming the HTML.
Please see our contributing guidelines before reporting an issue.
Markups
The following markups are supported. The dependencies listed are required if
you wish to run the library. You can also run script/bootstrap to fetch them all.
- .markdown, .mdown, .mkdn, .md --
gem install commonmarker(https://github.com/gjtorikian/commonmarker) - .textile --
gem install RedCloth(https://github.com/jgarber/redcloth) - .rdoc --
gem install rdoc -v 3.6.1 - .org --
gem install org-ruby(https://github.com/wallyqs/org-ruby) - .creole --
gem install creole(https://github.com/larsch/creole) - .mediawiki, .wiki --
gem install wikicloth(https://github.com/nricciar/wikicloth) - .rst --
pip install docutils - .asciidoc, .adoc, .asc --
gem install asciidoctor(http://asciidoctor.org) - .pod --
Pod::Simple::XHTML
comes with Perl >= 5.10. Lower versions should install Pod::Simple from CPAN.
Installation
gem install github-markupor
bundle installfrom this directory.
Usage
Basic form:
require 'github/markup'
GitHub::Markup.render('README.markdown', "* One\n* Two")More realistic form:
require 'github/markup'
GitHub::Markup.render(file, File.read(file))And a convenience form:
require 'github/markup'
GitHub::Markup.render_s(GitHub::Markups::MARKUP_MARKDOWN, "* One\n* Two")Contributing
See Contributing.