Project

markdpwn

0.0
No commit activity in last 3 years
No release in over 3 years
HTML-formats text documents such as Markdown, textile, and source code
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 1.3.5
>= 2.3.5
>= 5.4.1
>= 0.14.1
>= 0.9.9

Runtime

>= 1.5.5
>= 0.5.0
>= 0.9.12
>= 1.1.2
>= 3.4.0
>= 4.3.2
>= 0.8.3
 Project Readme

markdpwn

Rails engine providing a clone of Git-flavored Markdown.

Usage

Disclaimer: this gem uses semantic versioning, so its API is not guaranteed to be stable until it reaches version 1.0. Use integration tests to avoid surprises.

require 'markdpwn'
code = "puts {:key => nil}.inspect\n"
Markdpwn.markup code, :file_name => 'code.rb', :mime_type => 'text/x-ruby'

The markup call above outputs the HTML code below.

<div class="markdpwn-parsed-code">
<span class="nb">puts</span> <span class="p">{</span><span class="ss">:key</span> <span class="o">=&gt;</span> <span class="kp">nil</span><span class="p">}</span><span class="o">.</span><span class="n">inspect</span>
</div>

You can pass :file_name and/or :mime_type to help markup figure out which formatter to use. If no option is present, pygments is asked to guess the text document's language.

If you know the contents is markdpwn (close to Github-Flavored Markup), use the markdpwn method directly.

require 'markdpwn'
comment = "I like what you did to `markdpwn`."
Markdpwn.markdpwn comment
# => "<p>I like what you did to <code>markdpwn</code>.</p>\n"

Dependencies

The pygments.rb gem requires the Python VM library and the pygments package. They are installed by default on OSX and Ubuntu. The following command installs them on Fedora.

sudo yum install -y python-devel python-pygments

The github-markup gem requires PERL together with the Pod::Simple library, and Python together with the rst2html tool. The following command installs them on Fedora.

sudo yum install -y perl-Pod-Simple python-docutils

on OSX, follow the instructions here to install the rst2html tool.

Contributing to markdpwn

  • Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
  • Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
  • Fork the project.
  • Start a feature/bugfix branch.
  • Commit and push until you are happy with your contribution.
  • Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
  • Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.

Copyright

Copyright (c) 2012 Victor Costan. See LICENSE.txt for further details.