A native markdown processing extension for the Ring programming language, built on top of the high-performance MD4C parser.
- Cross-platform (Windows, Linux, FreeBSD)
- Easy-to-use Ring API
- Ring programming language (1.22 or later)
- CMake (3.5 or later)
- C compiler (GCC, Clang, or MSVC)
ringpm install markdown from ysdragon
- Clone the repository:
git clone --recursive https://github.com/ysdragon/markdown.git
cd markdown
- Set RING environment variable to your Ring installation directory:
On Windows (cmd):
set RING=X:\path\to\ring
On Windows (PowerShell):
$env:RING = "X:\path\to\ring"
On Unix-like systems:
export RING=/path/to/ring
- Build using CMake:
cmake -Bbuild -DCMAKE_BUILD_TYPE=Release
cmake --build build
load "markdown.ring"
md = new Markdown()
# Use custom flags
md.setFlags(MD_FLAG_TABLES | MD_FLAG_STRIKETHROUGH)
# Convert markdown to HTML
text = "# Hello World\nThis is **bold** and *italic*."
html = md.toHTML(text)
? html
# Parse markdown structure
struct = md.parse(text)
? struct
Check the examples
directory for more usage examples:
01-basic.ring
: Basic markdown to HTML conversion02-github.ring
: GitHub-flavored markdown features03-custom-flags.ring
: Custom parsing options
If you find a bug, please open an issue on GitHub with:
- A clear description of the problem
- Steps to reproduce
- Expected vs actual behavior
- Your environment details (OS, Ring version, etc.)
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Open a Pull Request
- Fork and clone the repository
- Build the project following installation instructions
- Run tests before submitting PR
- Ensure documentation is updated
This project is licensed under the MIT License - see the LICENSE file for details.