DText Parser
A Ruby extension for parsing DText markup used by e621.net.
This gem uses the Ragel state machine compiler to generate efficient C++ parsing code for DText syntax.
Setting up the development environment
If you wish to test your changes in a local instance of e621ng, please refer to the "Local DText gem" section of that repo's README file.
- Build the Docker container:
docker compose build - Compile the parser:
docker compose run --rm rake compile - Run tests:
docker compose run --rm rake test
Important: Do not commit dtext.cpp in pull requests
The dtext.cpp file is a generated artifact and should not be committed in development branches or pull requests.
It will be regenerated during the official release process.
Creating a new release
Use the release script to properly bump the version number and compile the artifacts.
./scripts/release.sh [patch|minor|major]Don't forget to update e621ng's Gemfile to include the new tag name.
Ragel
If you're new to Ragel, these resources will help you understand the syntax and concepts: