- Notifications
You must be signed in to change notification settings - Fork3.4k
Determines which markup library to use to render a content file (e.g. README) on GitHub
License
github/markup
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
This library is thefirst step of a journey that every markup file in a repository goes on before it is rendered on GitHub.com:
github-markup
selects anunderlying library to convert the raw markup to HTML. See the list ofsupported markup formats below.- The HTML is sanitized, aggressively removing things that could harm you and your kin—such as
script
tags, inline-styles, andclass
orid
attributes. - Syntax highlighting is performed on code blocks. Seegithub/linguist for more information about syntax highlighting.
- The HTML is passed through other filters that add special sauce, such as emoji, task lists, named anchors, CDN caching for images, and autolinking.
- The resulting HTML is rendered on GitHub.com.
Please note thatonly 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 ourcontributing guidelines before reporting an issue.
The following markups are supported. The dependencies listed are required ifyou wish to run the library. You can also runscript/bootstrap
to fetch them all.
- .markdown, .mdown, .mkdn, .md --
gem install commonmarker
(https://github.com/gjtorikian/commonmarker) - .textile --
gem install RedCloth
(https://github.com/jgarber/redcloth) - .rdoc --
gem install rdoc -v 3.6.1
- .org --
gem install org-ruby
(https://github.com/wallyqs/org-ruby) - .creole --
gem install creole
(https://github.com/larsch/creole) - .mediawiki, .wiki --
gem install wikicloth
(https://github.com/nricciar/wikicloth) - .rst --
pip install docutils
- .asciidoc, .adoc, .asc --
gem install asciidoctor
(http://asciidoctor.org) - .pod --
Pod::Simple::XHTML
comes with Perl >= 5.10. Lower versions should install Pod::Simple from CPAN.
gem install github-markup
or
bundle install
from this directory.
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")
python3 -m venv .venvsource .venv/bin/activatecd script./bootstrap
SeeContributing.
About
Determines which markup library to use to render a content file (e.g. README) on GitHub
Topics
Resources
License
Code of conduct
Security policy
Uh oh!
There was an error while loading.Please reload this page.