Are you happy with your logging solution? Would you help us out by taking a 30-second survey? Click here

markup

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

Subscribe to updates I use markup


Statistics on markup

Number of watchers on Github 4210
Number of open issues 74
Average time to close an issue 19 days
Main language Ruby
Average time to merge a PR 23 days
Open pull requests 25+
Closed pull requests 12+
Last commit over 1 year ago
Repo Created almost 10 years ago
Repo Last Updated over 1 year ago
Size 482 KB
Organization / Authorgithub
Latest Releasev2.0.0
Contributors54
Page Updated
Do you use markup? Leave a review!
View open issues (74)
View markup activity
View on github
Fresh, new opensource launches 🚀🚀🚀
Trendy new open source projects in your inbox! View examples

Subscribe to our mailing list

Evaluating markup for your project? Score Explanation
Commits Score (?)
Issues & PR Score (?)

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 kinsuch 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 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.

  • .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.

Installation

gem install github-markup

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.

markup open issues Ask a question     (View All Issues)
  • almost 3 years Wrong tag
  • almost 3 years Wrong Marked Language.
  • almost 3 years Link to project's root
  • almost 3 years JavaScript/C# tagging confusion
  • almost 3 years Details code block bug
  • almost 3 years RestructuredText (rst): subsequent section and subsection rendered as two sections
  • almost 3 years Images do not render inside tables
  • almost 3 years javascript is detected when c# is the right lang
  • almost 3 years Trbl
  • almost 3 years I think lowercase header field names are breaking badge caching
  • almost 3 years My group project repository is marked as the wrong language
  • almost 3 years Possible bug in text parser?
  • almost 3 years Implement text colors in READMEs
  • almost 3 years Wrong language detected in repository
  • almost 3 years Add support for mdoc (e.g. manpages) markup
  • almost 3 years Bulk checking impossible in nested task list
  • almost 3 years My project code is marked with the incorrect technology (HTML instead of JavaScript)
  • almost 3 years Asciidoc tables of contents don't render
  • almost 3 years Markdown checkboxes aren't clickable in releases.
  • almost 3 years Asciidoc includes don't render
  • almost 3 years Sanitizing HTML not working
  • almost 3 years Non-http URI-s in Markdown
  • almost 3 years Spurious rendering of dates in Github isses
  • almost 3 years No support of README.pdf?
  • almost 3 years Add headerless tables in GFM
  • about 3 years rendering README.ipynb in a project entrypoint page
  • about 3 years .rst file not rendered by github; pandoc html conversion does not give errors
  • about 3 years reStructuredText highlight directive doesn't work
  • about 3 years Wrong headings hierarchy in reStructuredText
  • about 3 years Support PlantUML
markup open pull requests (View All Pulls)
  • Mediawiki codepre
  • [WIP] Use Linguist to detect the language
  • Display unknown restructuredText directives
  • Symbol convenience render method
  • Upgrade wikicloth to JRuby-compatible version 0.8.3.
  • Remove creole support
  • bin/github-markup: Follow symlinks to find installation folder.
  • Switch to Pod::Simple::XHTML.
  • Remove compliance setting for now
  • Fix POD markup in test
  • allow multiple files for command line tool
  • Add failing test case
  • Makes rest2html work in both Python2 and Python3
  • Use a more contemporary install command for .rst format.
  • rest2html: Add support for highlight directive
  • rdoc URL updated
  • RestructuredText (rst): Remove the sectsubtitle_xform setting
  • Added support for highlighting doctest blocks in reStructuredText files.
  • Make rest2html work with docutils 0.13
  • (chore) (refactor) pipe result of each gsub instead of modifying original
  • Pass through symlink info
  • Perl POD with file variables line not marked up.
  • Adjust initial_header_level for TOC
  • Remove compliance setting for now
  • [CI] Test against Ruby 2.5
markup questions on Stackoverflow (View All Questions)
  • how extract html markup tags
  • Why is liquid include statement in Tag markup rather than Output markup
  • Why does Twilio Twimlbin reject markup that uses voice="alice"?
  • How to indent a few lines in Markdown markup?
  • Google now Hotel reservation (LodgingReservation) image markup
  • How to change the Markup of a asp.net page serverside (from .cs file)
  • Custom Markup Extension for Data Context Always Treated as type System.Object
  • How Do I Customize the HTML Markup of Images Inserted into WordPress Posts?
  • Where is the best place to put <script> tags in HTML markup?
  • Angular render markup that is nested
  • Extensive pageload time, but minimal markup
  • How to place markup after the submit button in drupal 7?
  • Kendo UI: Extending Button, why is the markup a div?
  • Unable to Export HTML Markup to PDF using iTextSharp API in asp.net using C#?
  • Best markup format for future-proofing large text chunks?
  • Highlight word in HTML text (but not markup)
  • Update markup dynamically after JS Ajax call to CodeBehind static function
  • How to force React to accept server markup
  • Practically speaking, why semantic markup?
  • iOS 9 Search Api - Is it required that using web markup api for public indexing?
  • How can i parse markup text with C#
  • inject context and markup into another template
  • why calling a function within object markup is valid?
  • ASP.NET how does markup access to variables in code-behind?
  • Support RST markup in lektor?
  • html cite, i, etc elements semantic markup
  • Correct Markup for Nested/Grouped Checkbox
  • rails helper - how can I get a helper to give me a `<br/>` (or other markup)
  • Email Markup may not Work I using Amazon SES
  • DOMDocument mangles markup with two sibling elements
markup list of languages used
markup latest release notes
  • Remove filesystem access #1157
  • Updates for Linguist v6 #1139
  • Update to Nokogiri ~> 1.8; drop support for Ruby 2.0 #1156
  • Reverted #537 to avoid extra dependencies
Other projects in Ruby