| 1 | Discount Markdown Processor for Ruby |
| 2 | ==================================== |
| 3 | [](https://github.com/davidfstr/rdiscount/actions/workflows/main.yml) |
| 4 | |
| 5 | Discount is an implementation of John Gruber's Markdown markup language in C. |
| 6 | It implements all of the language described in [the markdown syntax document][1] and |
| 7 | passes the [Markdown 1.0 test suite][2]. |
| 8 | |
| 9 | CODE: `git clone git://github.com/davidfstr/rdiscount.git` |
| 10 | HOME: <https://dafoster.net/projects/rdiscount/> |
| 11 | DOCS: <https://rdoc.info/github/davidfstr/rdiscount/master/RDiscount> |
| 12 | BUGS: <https://github.com/davidfstr/rdiscount/issues> |
| 13 | |
| 14 | Discount was developed by [David Loren Parsons][3]. |
| 15 | The Ruby extension is maintained by [David Foster][4]. |
| 16 | |
| 17 | [1]: https://daringfireball.net/projects/markdown/syntax |
| 18 | [2]: https://daringfireball.net/projects/downloads/MarkdownTest_1.0.zip |
| 19 | [3]: https://www.pell.portland.or.us/~orc |
| 20 | [4]: https://github.com/davidfstr |
| 21 | |
| 22 | INSTALL, HACKING |
| 23 | ---------------- |
| 24 | |
| 25 | New releases of RDiscount are published to [RubyGems][]: |
| 26 | |
| 27 | $ [sudo] gem install rdiscount |
| 28 | |
| 29 | The RDiscount sources are available via Git: |
| 30 | |
| 31 | $ git clone git://github.com/davidfstr/rdiscount.git |
| 32 | $ cd rdiscount |
| 33 | $ rake --tasks |
| 34 | |
| 35 | See the file [BUILDING][] for hacking instructions. |
| 36 | |
| 37 | [RubyGems]: https://rubygems.org/gems/rdiscount |
| 38 | [BUILDING]: https://github.com/davidfstr/rdiscount/blob/master/BUILDING |
| 39 | |
| 40 | USAGE |
| 41 | ----- |
| 42 | |
| 43 | RDiscount implements the basic protocol popularized by RedCloth and adopted |
| 44 | by BlueCloth: |
| 45 | |
| 46 | require 'rdiscount' |
| 47 | markdown = RDiscount.new("Hello World!") |
| 48 | puts markdown.to_html |
| 49 | |
| 50 | Additional processing options can be turned on when creating the |
| 51 | RDiscount object: |
| 52 | |
| 53 | markdown = RDiscount.new("Hello World!", :smart, :filter_html) |
| 54 | |
| 55 | Inject RDiscount into your BlueCloth-using code by replacing your bluecloth |
| 56 | require statements with the following: |
| 57 | |
| 58 | begin |
| 59 | require 'rdiscount' |
| 60 | BlueCloth = RDiscount |
| 61 | rescue LoadError |
| 62 | require 'bluecloth' |
| 63 | end |
| 64 | |
| 65 | COPYING |
| 66 | ------- |
| 67 | |
| 68 | Discount is free software; it is released under a BSD-style license |
| 69 | that allows you to do as you wish with it as long as you don't attempt |
| 70 | to claim it as your own work. RDiscount adopts Discount's license |
| 71 | verbatim. See the file `COPYING` for more information. |
| 72 |