Coder Social home page Coder Social logo

minidown's Introduction

Minidown

Gem Version Build Status

Minidown is yet another markdown parser, with:

  • Complete GFM support.

  • Lightweight, no other dependencies.

  • Fast & easy to use.

Project Deprecated !!!

Please use kramdown instead https://github.com/gettalong/kramdown

Installation

Add this line to your application's Gemfile:

gem 'minidown'

And then execute:

$ bundle

Or install it yourself as:

$ gem install minidown

Basic usage

require 'minidown'

Minidown.render('*hello*')
#=> "<p><em>hello</em></p>"

Custom your own handler

highlight_with_pygments = ->(lang, content) {
  Pygments.highlight(content, :lexer => lang)
}

Minidown.render source, code_block_handler: highlight_with_pygments

# if you don't like pass options every time
parser_with_highlight = Minidown::Parser.new code_block_handler: highlight_with_pygments
parser_with_highlight.render source

Command line

wget https://raw.github.com/mojombo/github-flavored-markdown/gh-pages/_site/sample_content.md
minidown sample_content.md > result.html
open result.html

looks nice!

Syntax

Complete GFM(GitHub Flavored Markdown) support. include Basic markdown, Task list, Table, Code, Blockquote etc.. view details

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

minidown's People

Contributors

billdueber avatar jjyr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

minidown's Issues

改一下项目副标题英文

Minidown is yet another light weight, fast markdown parser with no dependencies, written in pure ruby, and follows GFM

Parse complicated url problem

In github, [Ajax](http://en.wikipedia.org/wiki/Ajax_(programming)) will be correctly parsed: Ajax, but minidown will add unnecessary )

List缩进问题

minidown带缩进的List支持欠佳,具体体现如下:

  • 不进行缩进;
  • 如果一块有缩进的UL接了一块OL,则UL会缩进,但缩进距离不正确,且部分缩进条目会被解析为<p><\p>
+ ul 1
+ ul 2
   + ul 3
   + ul 4
        + ul 5
   + ul 6

1. ul a
1. ul b
1. ul c
1. ul d

被解析为了:

<ul>
  <li>ul 1</li>
  <ul>
     <li>ul 2</li>
     <ul>
        <li>ul 3</li>
        <ul>
            <li>ul 4</li>
            <ul>
               <li>ul 5</li>
               <ul>
                   <li>ul 6</li>
               </ul>
            </ul>
         </ul>
      </ul>
   </ul>
</ul>

<ol>
  <li>ul a</li>
  <li>ul b</li>
  <li>ul c</li>
  <li>ul d</li>
</ol>

ul / ol parse error

* ul1
 1. ol
 2. ol
 3. ol

* ul2
* ul3
 1.  ol
 2.  ol
 3.  ol
 4.  ol
 5.  ol

+ ul4
+ ul5
 1. ol
 2. ol
 3. ol

Incorrect parsing image URI

I have image URI containing spaces

![график](Глава 2/Рисунки/Нагрузка.png)

Minidown renders it like

<p><img src="Глава" alt="график"></img></p>

dropping all between space and closing paranthesis.

Replacing space to "%20" in markdown file looks ugly but Minidown renders it correctly:

![график](Глава%202/Рисунки/Нагрузка.png)
<p><img src="Глава%202/Рисунки/Нагрузка.png" alt="график"></img></p>

make minidown support pipeline.

嘿, this gem is very very COOL!

I hope can support pipeline, because my emacs markdown-mode need
text stream to be feed as STDIN, so, I hope mindown can support this.

following is some code you can refer to, thanks very much.

if File.pipe?($stdin)
  puts Minidown.render($stdin.read)
  exit
end

file = ARGV.first
if file 
....

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.