Skip to content

Instantly share code, notes, and snippets.

@damoclark
Last active November 20, 2017 17:44
Show Gist options
  • Save damoclark/26cf82f69645ffe222fd to your computer and use it in GitHub Desktop.
Save damoclark/26cf82f69645ffe222fd to your computer and use it in GitHub Desktop.
Github README.md Template

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 see our contributing guidelines before reporting an issue.

Synopsis

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment