cr-discount
Version, currently 0.3.03 versions
- 0.3.0latestJan 29, 2026
- 0.2.0not indexedJan 29, 2026
- 0.1.0not indexedJan 29, 2026
github.com/ralsina/cr-discount
A thin Crystal wrapper for discount, a markdown implementation
2 stars
1 dependent
License: MIT
Installation
# Add this to your shard.yml
dependencies:
cr-discount:
github: ralsina/cr-discount
version: ~> 0.3.0Then run:
shards installshard.yml
- Crystal
1.8.2- License
- MIT
- Author
- Roberto Alsina
- Target
markdownfrom src/main.cr
Dependencies
This version declares no dependencies.
README
cr-discount
A crystal wrapper for Discount, a Markdown implementation
Installation
-
Add the dependency to your
shard.yml:dependencies: cr-discount: github: ralsina/cr-discount -
Run
shards install
Usage
require "cr-discount"
You can use Discount to compile markdown to HTML like this:
markdown = "This *is* **markdown**"
html = Discount.compile(markdown)
This is the whole API:
# Compile `text` from Markdown to HTML
def self.compile(
text : String,
with_toc : Bool = false,
flags = LibDiscount::MKD_FENCEDCODE | LibDiscount::MKD_TOC
)
with_tocadds a simple table of contents at the beginning of the returned HTMLflagscan be any combination of the flags in the discount docs
Development
I am not planning on developing this much further since it already does what I want :-)
Contributing
- Fork it (https://github.com/ralsina/cr-discount/fork)
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request
Contributors
- Roberto Alsina - creator and maintainer
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This release
- Version
0.3.0- Tagged
- Jan 29, 2026
- Commit
f640c4d48142- Crystal
1.8.2- Indexed
- yes
Dependents
Repository
github.com/ralsina/cr-discount
Metadata
- Created
- Aug 12, 2026
- Updated
- Oct 16, 2026
- Synced
- Oct 16, 2026
- Versions
- 3