Determines which markup library to use to render a content file (e.g. README) on GitHub
Перейти к файлу
JM (Jason Meridth) 6f4f436f14
Merge pull request #1903 from github/jm_immutable_actions
fix: switch from shas to tags for immutable actions
2024-11-18 09:36:33 -06:00
.github fix: switch from shas to tags for immutable actions 2024-11-18 09:31:19 -06:00
bin github-markup: display basename instead of entire $0 2017-11-27 15:16:15 +11:00
lib Merge pull request #1536 from felixfontein/fix-rst-links 2024-09-04 15:03:54 -05:00
script Update bootstrap script to use pip3 2021-03-30 16:36:14 -05:00
test Merge pull request #1479 from jsoref/spelling 2024-09-22 00:45:26 -05:00
.dockerignore add testing Dockerfile 2018-12-10 12:50:58 +11:00
.gitignore chore: add .venv/venv to .gitignore 2024-09-04 15:10:19 -05:00
.kick add .kick, i love it 2009-10-30 18:14:35 -07:00
CODE_OF_CONDUCT.md Add Code of Conduct 2018-08-27 16:53:04 -07:00
CONTRIBUTING.md Remove reference to deprecated support email 2022-12-29 11:30:34 -08:00
Dockerfile add testing Dockerfile 2018-12-10 12:50:58 +11:00
Gemfile chore(deps): bump the dependencies group across 1 directory with 6 updates 2024-11-04 10:49:47 +00:00
Gemfile.lock chore(deps): bump the dependencies group across 1 directory with 6 updates 2024-11-04 10:49:47 +00:00
HISTORY.md update version and history 2024-06-17 11:20:56 -04:00
LICENSE license 2009-10-30 18:17:47 -07:00
README.md Merge pull request #1703 from TAbdiukov/MarkupLink 2024-09-09 07:28:46 -05:00
Rakefile Restore "test" as the default rake task 2015-01-16 10:37:02 -05:00
github-markup.gemspec chore(deps): bump the dependencies group across 1 directory with 6 updates 2024-11-04 10:49:47 +00: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")

Local Development

python3 -m venv .venv
source .venv/bin/activate
cd script
./bootstrap

Contributing

See Contributing.