GitXplorerGitXplorer
g

markup

public
5837 stars
3399 forks
210 issues

Commits

List of commits on branch master.
Verified
03eb6d87acf1cf9add784097a0115f0bc647a513

Merge pull request #1873 from github/dependabot/github_actions/dependencies-965fa1a766

jjmeridth committed 10 days ago
Verified
158e3c983b78ed8402b4c5990d84d55bb8fc6a9b

Merge pull request #1703 from TAbdiukov/MarkupLink

jjmeridth committed 10 days ago
Verified
bc6e6e36a6cdf5e4cd73f4d3bcfafd05c3e4cb67

chore(deps): bump ruby/setup-ruby in the dependencies group

ddependabot[bot] committed 10 days ago
Verified
9fe4c64f58d01190a7eafdd078592b785a115e02

Merge pull request #1872 from github/jm_add_venv_to_gitignore

jjmeridth committed 15 days ago
Verified
b4f9c54a4b4c117cb315cd0f4df09ffd5a1484b7

chore: add .venv/venv to .gitignore

jjmeridth committed 15 days ago
Verified
914839fd31c93b93a8054a3c91fce0906b2d1375

Merge pull request #1536 from felixfontein/fix-rst-links

jjmeridth committed 15 days ago

README

The README file for this repository.

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.