markup

Determines which markup library to use to render a content file (e.g. README) on GitHub

  • 所有者: github/markup
  • 平台:
  • 許可證: MIT License
  • 分類:
  • 主題:
  • 喜歡:
    0
      比較:

Github星跟蹤圖

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.

主要指標

概覽
名稱與所有者github/markup
主編程語言Ruby
編程語言Ruby (語言數: 6)
平台
許可證MIT License
所有者活动
創建於2009-10-31 01:02:46
推送於2025-06-23 11:54:54
最后一次提交2025-06-18 07:09:48
發布數68
最新版本名稱v5.0.1 (發布於 2024-06-17 11:54:43)
第一版名稱v0.1.0 (發布於 )
用户参与
星數5.9k
關注者數633
派生數3.4k
提交數747
已啟用問題?
問題數1148
打開的問題數34
拉請求數166
打開的拉請求數8
關閉的拉請求數180
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?