{"id":15292064,"url":"https://github.com/sebastienrousseau/mdx-gen","last_synced_at":"2025-05-07T05:06:28.382Z","repository":{"id":257805443,"uuid":"864817183","full_name":"sebastienrousseau/mdx-gen","owner":"sebastienrousseau","description":"A Rust-based library for processing and enhancing Markdown content.","archived":false,"fork":false,"pushed_at":"2025-05-02T18:55:50.000Z","size":1237,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-04T03:58:47.736Z","etag":null,"topics":["development-tools","html","markdown","parser","rust","rust-library","static-site-generators","text-processing"],"latest_commit_sha":null,"homepage":"http://doc.mdxgen.com/","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sebastienrousseau.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/funding.yml","license":"LICENSE-APACHE","code_of_conduct":".github/CODE-OF-CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":".github/SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":"AUTHORS.md","dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"sebastienrousseau","custom":"https://paypal.me/wwdseb"}},"created_at":"2024-09-29T08:41:14.000Z","updated_at":"2025-02-04T18:49:24.000Z","dependencies_parsed_at":null,"dependency_job_id":"49ff9159-d4d7-4a46-8e7d-6eeecf422226","html_url":"https://github.com/sebastienrousseau/mdx-gen","commit_stats":null,"previous_names":["sebastienrousseau/mdx-gen"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sebastienrousseau%2Fmdx-gen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sebastienrousseau%2Fmdx-gen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sebastienrousseau%2Fmdx-gen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sebastienrousseau%2Fmdx-gen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sebastienrousseau","download_url":"https://codeload.github.com/sebastienrousseau/mdx-gen/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252284932,"owners_count":21723671,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["development-tools","html","markdown","parser","rust","rust-library","static-site-generators","text-processing"],"created_at":"2024-09-30T16:16:21.970Z","updated_at":"2025-05-07T05:06:28.362Z","avatar_url":"https://github.com/sebastienrousseau.png","language":"Rust","funding_links":["https://github.com/sponsors/sebastienrousseau","https://paypal.me/wwdseb"],"categories":[],"sub_categories":[],"readme":"\u003c!-- markdownlint-disable MD033 MD041 --\u003e\n\u003cimg src=\"https://kura.pro/mdx-gen/images/logos/mdx-gen.svg\"\nalt=\"MDX Gen logo\" height=\"66\" align=\"right\" /\u003e\n\u003c!-- markdownlint-enable MD033 MD041 --\u003e\n\n# MDX Generator (mdx-gen)\n\nA robust Rust library for processing Markdown into responsive HTML, offering custom blocks, syntax highlighting, and enhanced table formatting for richer content.\n\n\u003c!-- markdownlint-disable MD033 MD041 --\u003e\n\u003ccenter\u003e\n\u003c!-- markdownlint-enable MD033 MD041 --\u003e\n\n[![Made With Love][made-with-rust]][01] [![Crates.io][crates-badge]][06] [![Lib.rs][libs-badge]][08] [![Docs.rs][docs-badge]][07] [![License][license-badge]][03]\n\n• [Website][00] • [Documentation][07] • [Report Bug][04] • [Request Feature][04] • [Contributing Guidelines][05]\n\n\u003c!-- markdownlint-disable MD033 MD041 --\u003e\n\u003c/center\u003e\n\u003c!-- markdownlint-enable MD033 MD041 --\u003e\n\n## Overview\n\n`mdx-gen` is a flexible Rust library that converts Markdown into HTML, providing enhanced features like custom block extensions, syntax highlighting, and table formatting.\n\n`mdx-gen` uses the high-performance `comrak` library for Markdown parsing and offers flexible options for modifying and extending Markdown behavior.\n\n### Key Features\n\n- **Markdown to HTML Conversion**: Converts Markdown to responsive HTML using the `comrak` parser, ensuring fast and accurate rendering of Markdown content.\n- **Custom Block Extensions**: Allows the use of custom blocks such as notes, warnings, and tips, transforming them into structured HTML elements for improved content formatting.\n- **Syntax Highlighting**: Automatically applies syntax highlighting to code blocks for a wide range of programming languages, making code snippets more readable and professional.\n- **Enhanced Table Formatting**: Converts Markdown tables into responsive HTML tables with proper alignment and additional styling for better usability across devices.\n- **Flexible Configuration**: Provides a customizable `MarkdownOptions` structure that allows developers to enable or disable specific features (e.g., custom blocks, enhanced tables, or syntax highlighting).\n- **Error Handling**: Comprehensive error handling system with detailed error reporting to ensure smooth Markdown processing, even in complex cases.\n\n### Supported Extensions\n\n`mdx-gen` offers the following extensions, which can be enabled or disabled individually via `MarkdownOptions`:\n\n- Custom blocks (notes, warnings, tips)\n- Enhanced table formatting with responsive design\n- Syntax highlighting for code blocks\n- Strikethrough and autolink support\n- Advanced error reporting for improved debugging\n\n## Installation\n\nAdd this to your `Cargo.toml`:\n\n```toml\n[dependencies]\nmdx-gen = \"0.0.1\"\n```\n\n## Usage\n\nHere are some examples of how to use the library:\n\n### Basic Usage\n\n```rust\nuse mdx_gen::{process_markdown, MarkdownOptions};\n\nlet markdown_content = \"# Hello, world!\\n\\nThis is a paragraph.\";\nlet options = MarkdownOptions::new()\n    .with_enhanced_tables(false);\nlet html = process_markdown(markdown_content, \u0026options).unwrap();\nprintln!(\"HTML output: {}\", html);\n```\n\n### Custom Blocks and Syntax Highlighting\n\n```rust\nuse mdx_gen::{process_markdown, MarkdownOptions};\n\nlet markdown_content = r#\"\n# Example\n\n\u003cdiv class=\"note\"\u003eThis is a note.\u003c/div\u003e\n\n``rust\nfn main() {\n    println!(\"Hello, world!\");\n}\n\"#;\n\nlet options = MarkdownOptions::new()\n    .with_custom_blocks(true)\n    .with_syntax_highlighting(true)\n    .with_enhanced_tables(true)\n    .with_comrak_options({\n        let mut opts = comrak::ComrakOptions::default();\n        opts.extension.table = true;\n        opts\n    });\n\nlet html = process_markdown(markdown_content, \u0026options).unwrap();\nprintln!(\"HTML output: {}\", html);\n```\n\n## Modules\n\n- **lib.rs**: The main library module that ties everything together.\n- **markdown.rs**: Core functionality for Markdown processing and conversion.\n- **extensions.rs**: Handles custom block extensions, syntax highlighting, and table processing.\n- **error.rs**: Defines error types and implements error handling for the library.\n\n## Documentation\n\nFor full API documentation, please visit [docs.rs/mdx-gen][07].\n\n## Examples\n\nTo run the examples, clone the repository and use the following command:\n\n```shell\ncargo run --example example_name\n```\n\nReplace `example_name` with the name of the example you want to run.\n\n## Contribution\n\nUnless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.\n\n## License\n\nThe project is dual-licensed under the terms of both the MIT license and the Apache License (Version 2.0).\n\n- [Apache License, Version 2.0][02]\n- [MIT license][03]\n\nat your option.\n\n## Acknowledgements\n\nSpecial thanks to all contributors who have helped build the `mdx-gen` library.\n\n[00]: https://mdxgen.com/ 'MDX Generator'\n[01]: https://www.rust-lang.org/ 'Rust Programming Language'\n[02]: https://opensource.org/license/apache-2-0/ \"Apache License, Version 2.0\"\n[03]: https://opensource.org/licenses/MIT \"MIT license\"\n[04]: https://github.com/sebastienrousseau/mdx-gen/issues \"Report Bug\"\n[05]: https://github.com/sebastienrousseau/mdx-gen/blob/main/CONTRIBUTING.md \"Contributing Guidelines\"\n[06]: https://crates.io/crates/mdx-gen 'Crates.io'\n[07]: https://docs.rs/mdx-gen 'Docs.rs'\n[08]: https://lib.rs/crates/mdx-gen 'Lib.rs'\n\n[crates-badge]: https://img.shields.io/crates/v/mdx-gen-html.svg?style=for-the-badge 'Crates.io badge'\n[docs-badge]: https://img.shields.io/docsrs/mdx-gen-html.svg?style=for-the-badge 'Docs.rs badge'\n[libs-badge]: https://img.shields.io/badge/lib.rs-v0.1.0-orange.svg?style=for-the-badge 'Lib.rs badge'\n[license-badge]: https://img.shields.io/crates/l/mdx-gen-html.svg?style=for-the-badge 'License badge'\n[made-with-rust]: https://img.shields.io/badge/rust-f04041?style=for-the-badge\u0026labelColor=c0282d\u0026logo=rust 'Made With Rust badge'\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsebastienrousseau%2Fmdx-gen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsebastienrousseau%2Fmdx-gen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsebastienrousseau%2Fmdx-gen/lists"}