Determines which markup library to use to render a content file (e.g. README) on GitHub
Перейти к файлу
Ashe Connor 00c6b8cff0
Merge pull request #1131 from github/display_base_executable_name
github-markup: display basename instead of entire $0
2017-11-27 15:26:53 +11:00
bin github-markup: display basename instead of entire $0 2017-11-27 15:16:15 +11:00
lib Merge pull request #1082 from tony/patch-1 2017-07-31 15:22:35 +10:00
script Update docs and bootstrap for asciidoc 2014-01-21 21:17:14 -08:00
test spelling: precedence 2017-11-10 03:43:17 +00:00
.gitignore Adding a convenience "render by symbol" 2015-05-06 00:27:49 +02:00
.kick add .kick, i love it 2009-10-30 18:14:35 -07:00
.travis.yml Add Ruby 2.1/2.2/2.3/2.4 and JRuby 9000 for CI target 2017-07-15 08:16:04 +09:00
CONTRIBUTING.md Update link and information about primer-markdown module #1119 2017-10-21 20:05:59 -04:00
Gemfile Upgrade to Asciidoctor 1.5.6.1 2017-07-24 11:08:20 +03:00
HISTORY.md 💎 bump to 1.6.1 2017-07-25 11:10:11 +10:00
LICENSE license 2009-10-30 18:17:47 -07:00
README.md removing redundant information 2017-11-03 17:30:32 -02:00
Rakefile Restore "test" as the default rake task 2015-01-16 10:37:02 -05:00
github-markup.gemspec Remove superfluous dependency on rinku 2017-03-28 19:37:19 +02: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. This library converts 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. See the sanitization filter for the full whitelist.
  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 in the html-pipeline 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

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.