GitLab Markup
This library is a fork of GitHub Markup, which is used to render all non Markdown markups:
- This library converts 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
script
tags, inline-styles, andclass
orid
attributes. See the sanitization filter for the full whitelist. - Syntax highlighting is performed on code blocks. See github/linguist for more information about syntax highlighting.
- The HTML is passed through other filters in the html-pipeline that add special sauce, such as emoji, task lists, named anchors, CDN caching for images, and autolinking.
- The resulting HTML is rendered.
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 (Python 3 required).
- .markdown, .mdown, .mkdn, .md --
gem install redcarpet
(https://github.com/vmg/redcarpet) - .textile --
gem install RedCloth
- .rdoc --
gem install rdoc -v 3.6.1
- .org --
gem install org-ruby
- .creole --
gem install creole
- .mediawiki, .wiki --
gem install wikicloth
- .rst --
pip install docutils
- .asciidoc, .adoc, .asc --
gem install asciidoctor
(http://asciidoctor.org) - .pod --
Pod::Simple::HTML
comes with Perl >= 5.10. Lower versions should install Pod::Simple from CPAN.
Installation
Ruby 2.6+ is highly recommended (Ruby 2.5 is still supported).
gem install gitlab-markup
Usage
require 'github/markup'
GitHub::Markup.render('README.markdown', "* One\n* Two")
Or, more realistically:
require 'github/markup'
GitHub::Markup.render(file, File.read(file))
Contributing
See Contributing