compiled dtext parser extension
  • Ruby 72.8%
  • Ragel 22.2%
  • C++ 4.9%
  • Dockerfile 0.1%
Find a file
2025-01-30 23:43:30 -06:00
bin Add color & remove cdtext 2024-05-11 02:58:55 -05:00
ext/dtext bump version 2025-01-27 16:46:15 -06:00
lib bump version 2025-01-27 16:46:15 -06:00
test va -> contrib 2025-01-27 16:40:36 -06:00
.devcontainer.json Add Dockerfile. 2024-03-15 16:24:53 -05:00
.dockerignore Add Dockerfile. 2024-03-15 16:24:53 -05:00
.gitattributes change branding 2024-05-10 21:57:06 -05:00
.gitignore Add Dockerfile. 2024-03-15 16:24:53 -05:00
Dockerfile finishing touches 2024-05-11 18:41:11 -05:00
dtext_rb.gemspec rebranding 2024-06-15 15:14:10 -05:00
Gemfile Update gems. 2023-01-17 19:18:41 -06:00
Gemfile.lock bump version 2025-01-27 16:46:15 -06:00
Rakefile Remove last vestiges of GLib. 2023-01-26 03:39:44 -06:00
README.md Add move notice 2025-01-30 23:43:30 -06:00

Important

DText was moved to the FemboyFans repository in commit e192f34. See lib/dtext_rb in the FemboyFans repo.

About

Uses the ragel state machine to generate the dtext parsing capabilities of FemboyFans.

Getting started

Most of the changes will only need to touch dtext.rl, the rest of the files will be generated for you by running either rake compile or rake test. Take a look at this unofficial quickstart guide or the complete official documentation if you want to know more about how ragel works.

Releasing a new version for use

Commit the changes to dtext.cpp.rl and the resuling changes in dtext.cpp. Bump the version number in lib/dtext/version.rb. After that is all done you can bundle lock in the FemboyFans repository. It should pick up on the increased version.

To test these changes locally commit them and update the Gemfiles dtext entry. Specifying the commit hash allows you to rebuild the container without having to also increment the version number every time. Don't forget to bundle lock before rebuilding.
gem "dtext_rb", git: "https://github.com/YOUR_FORK/dtext_rb.git", ref: "YOUR_COMMIT_HASH"

Usage

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

Installation

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

Development

bin/rake compile
bin/rake test

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