Determines which markup library to use to render a content file (e.g. README) on GitHub
Перейти к файлу
Carl Brasic 4230afedbb Add changelog entry 2021-03-31 10:14:35 -05:00
bin github-markup: display basename instead of entire $0 2017-11-27 15:16:15 +11:00
lib Remove -S flag for python3 2021-03-30 16:36:14 -05:00
script Update bootstrap script to use pip3 2021-03-30 16:36:14 -05:00
test Update HTML fixture for python3 2021-03-30 16:36:14 -05:00
.dockerignore add testing Dockerfile 2018-12-10 12:50:58 +11:00
.gitignore vend Pod::To::HTML 2018-12-11 11:03:08 +11:00
.kick add .kick, i love it 2009-10-30 18:14:35 -07:00
.travis.yml remove jvm from travis build matrix 2018-12-17 14:03:54 +11:00
CODE_OF_CONDUCT.md Add Code of Conduct 2018-08-27 16:53:04 -07:00
CONTRIBUTING.md Update CONTRIBUTING guide to point to Code of Conduct 2018-08-27 17:33:05 -07:00
Dockerfile add testing Dockerfile 2018-12-10 12:50:58 +11:00
Gemfile upgrade to Asciidoctor 2.0.x 2019-04-01 23:58:55 -06:00
HISTORY.md Add changelog entry 2021-03-31 10:14:35 -05:00
LICENSE license 2009-10-30 18:17:47 -07:00
README.md remove pod6 from supported list 2019-02-25 09:37:42 +11:00
Rakefile Restore "test" as the default rake task 2015-01-16 10:37:02 -05:00
github-markup.gemspec Update github-markup.gemspec 2019-05-22 21:27:22 -03:00

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.