danbooru / dtext_rb

compiled dtext parser extension
1 stars 6 forks source link

[!IMPORTANT] DText was moved to the Danbooru repository in commit d965f959b. See lib/dtext_rb in the Danbooru repo.


DText

A Ruby library for parsing DText, Danbooru's text formatting language.

Installation

sudo apt-get install ruby ruby-dev g++ libc-dev make patch xz-utils ragel
gem install bundler
bundle install
bin/rake

Usage

ruby -Ilib -rdtext -e 'puts DText.parse("hello world")'
# => <p>hello world</p>

Development

bin/rake clean
bin/rake compile
bin/rake test
bin/rake bench

To build in debug mode:

bin/rake clean
DTEXT_DEBUG=true bin/rake compile

To build with Clang:

MAKE="make --environment-overrides" CXX="/usr/bin/clang++" bin/rake