Crates.io | html-generator |
lib.rs | html-generator |
version | |
source | src |
created_at | 2024-10-07 19:38:27.789421 |
updated_at | 2024-12-01 22:15:09.644953 |
description | A robust Rust library designed for transforming Markdown into SEO-optimized, accessible HTML. Featuring front matter extraction, custom header processing, table of contents generation, and performance optimization for web projects of any scale. |
homepage | https://html-generator.co/ |
repository | https://github.com/sebastienrousseau/html-generator |
max_upload_size | |
id | 1400397 |
Cargo.toml error: | TOML parse error at line 35, column 1 | 35 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
A comprehensive Rust library for transforming Markdown into optimised, accessible HTML.
• Website • Documentation • Report Bug • Request Feature • Contributing Guidelines
The html-generator
library simplifies the process of transforming Markdown into SEO-optimised, accessible HTML. This library provides tools for processing front matter, generating semantic headers, validating accessibility, and optimising performance for modern web applications.
Add the following to your Cargo.toml
:
[dependencies]
html-generator = "0.0.2"
use html_generator::{generate_html, HtmlConfig};
fn main() -> Result<(), Box<dyn std::error::Error>> {
let config = HtmlConfig::default();
let markdown = "# Welcome to HTML Generator
This library makes HTML creation effortless.";
let html = generate_html(markdown, &config)?;
println!("Generated HTML:
{}", html);
Ok(())
}
use html_generator::{
accessibility::validate_wcag,
seo::{generate_meta_tags, generate_structured_data},
HtmlConfig,
};
async fn advanced_example() -> Result<String, Box<dyn std::error::Error>> {
let config = HtmlConfig::builder()
.with_language("en-GB")
.with_syntax_highlighting(true, Some("dracula".to_string()))
.build()?;
let markdown = "# Advanced Example
Features include syntax highlighting and WCAG validation.";
let html = generate_html(markdown, &config)?;
validate_wcag(&html, &config, None)?;
let meta_tags = generate_meta_tags(&html)?;
let structured_data = generate_structured_data(&html, None)?;
Ok(format!("{}
{}
{}", meta_tags, structured_data, html))
}
Run examples from the repository:
git clone https://github.com/sebastienrousseau/html-generator.git
cd html-generator
cargo run --example basic
We welcome contributions of all kinds! Please read our Contributing Guidelines for instructions on:
This project is licensed under either of the following at your choice:
Heartfelt thanks to all contributors who have supported the development of html-generator
.