Skip to content
Determines which markup library to use to render a content file (e.g. README) on GitHub
Branch: master
Clone or download
Latest commit f3531a5 May 23, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin github-markup: display basename instead of entire $0 Nov 27, 2017
lib feat(commonmarker): add commonmarker_exts to options May 6, 2019
script reduce friction to create environment Nov 28, 2017
test
.dockerignore add testing Dockerfile Dec 10, 2018
.gitignore vend Pod::To::HTML Dec 11, 2018
.kick add .kick, i love it Oct 31, 2009
.travis.yml remove jvm from travis build matrix Dec 17, 2018
CODE_OF_CONDUCT.md Add Code of Conduct Aug 27, 2018
CONTRIBUTING.md Update CONTRIBUTING guide to point to Code of Conduct Aug 28, 2018
Dockerfile add testing Dockerfile Dec 10, 2018
Gemfile upgrade to Asciidoctor 2.0.x Apr 2, 2019
HISTORY.md 💎 bump to 3.0.4 Apr 2, 2019
LICENSE license Oct 31, 2009
README.md remove pod6 from supported list Feb 24, 2019
Rakefile Restore "test" as the default rake task Jan 16, 2015
github-markup.gemspec Update github-markup.gemspec May 23, 2019

README.md

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:

  1. github-markup selects an underlying library to convert the raw markup to HTML. See the list of supported markup formats below.
  2. The HTML is sanitized, aggressively removing things that could harm you and your kin—such as script tags, inline-styles, and class or id attributes.
  3. Syntax highlighting is performed on code blocks. See github/linguist for more information about syntax highlighting.
  4. The HTML is passed through other filters that add special sauce, such as emoji, task lists, named anchors, CDN caching for images, and autolinking.
  5. 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.

Installation

gem install github-markup

or

bundle install

from 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.

You can’t perform that action at this time.