cmark-writer
A CommonMark writer implementation in Rust.
Usage
Basic Example
use ;
use CommonMarkWriter;
// Create a document
let document = Document;
// Render to CommonMark
let mut writer = new;
writer.write.expect;
let markdown = writer.into_string;
println!;
Custom Formatting Options
You can customize the formatting behavior:
use WriterOptions;
use CommonMarkWriter;
use Node;
// Create custom options
let options = WriterOptions ;
// Create writer with custom options
let mut writer = with_options;
writer.write.unwrap;
API Documentation
Core Types
Node- Represents various CommonMark node typesListItem- Represents list items, including task list itemsCommonMarkWriter- Converts nodes to CommonMark textWriterOptions- Customization options for the writer
Creating Custom Nodes
You can extend the CommonMark syntax with your own custom nodes:
use ;
use WriteResult;
use derive_custom_node;
// Define a custom highlight node
// Implement the custom node using the macro
derive_custom_node!;
// Implement the required methods
// Use your custom node
let document = Document;
Development
Building
Running Tests
License
This project is licensed under the MIT License - see the LICENSE file for details.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.