GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - github/markup: Determines which markup library to use to render a content file (e.g. README) on GitHub

BranchesTags
Open more actions menu

Latest commit

 

History

851 Commits
851 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
bin
bin
 
 
lib
lib
 
 
script
script
 
 
test
test
 
 
.gitignore
.gitignore
 
 
.kick
.kick
 
 
CODE_OF_CONDUCT.md
CODE_OF_CONDUCT.md
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
Gemfile
Gemfile
 
 
Gemfile.lock
Gemfile.lock
 
 
HISTORY.md
HISTORY.md
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
Rakefile
Rakefile
 
 
github-markup.gemspec
github-markup.gemspec
 
 

Repository files navigation

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.

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

or

bundle install

from this directory.

Usage

Markdown rendering supports CommonMarker 0.x and 2.x. Keep the installed version to retain that parser's option behavior. Extensions follow the installed parser; 2.x-only extensions remain unavailable with 0.x.

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

Set COMMONMARKER_VERSION to override the development bundle's default ~> 2.8.2 requirement. See Testing for parser version commands.

Contributing

See Contributing.

About

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

Topics

readme

Resources

Readme
MIT license

Code of conduct

Code of conduct

Contributing

Contributing

Security policy

Security policy
Activity
Custom properties

Stars

6.1k stars

Watchers

613 watching

Forks

3.4k forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.