Expand description
Metadata Gen
A Rust library for extracting, validating, and processing metadata in YAML, TOML, and JSON formats.
§Install
cargo add metadata-genOr add to Cargo.toml:
[dependencies]
metadata-gen = "0.0.3"You need Rust 1.56.0 or later. Works on macOS, Linux, and Windows.
§Overview
Metadata Gen extracts, validates, and processes metadata from content files in YAML, TOML, and JSON formats.
- Multi-format extraction from any content file
- HTML meta tag generation for SEO
- Validation of metadata structure and required fields
- Serde integration for typed metadata access
§Features
| Multi-format | Extract metadata from YAML, TOML, and JSON |
| Validation | Validate metadata structure and required fields |
| Meta tags | Generate HTML meta tags from metadata |
| Content files | Process metadata from any content or data file |
| Serde integration | Serialize/deserialize metadata to Rust structs |
§Usage
use metadata_gen::extract_metadata;
fn main() {
let content = "---\ntitle: Example\n---\nBody text.";
let meta = extract_metadata(content).unwrap();
println!("Title: {}", meta.get("title").unwrap());
}§Development
cargo build # Build the project
cargo test # Run all tests
cargo clippy # Lint with Clippy
cargo fmt # Format with rustfmtSee CONTRIBUTING.md for setup, signed commits, and PR guidelines.
THE ARCHITECT ᛫ Sebastien Rousseau THE ENGINE ᛞ EUXIS ᛫ Enterprise Unified Execution Intelligence System
§License
Dual-licensed under Apache 2.0 or MIT, at your option.
Re-exports§
pub use error::MetadataError;pub use metadata::extract_metadata;pub use metadata::process_metadata;pub use metadata::Metadata;pub use metatags::MetaTagGroups;pub use utils::async_extract_metadata_from_file;pub use utils::escape_html;
Modules§
- error
- The
errormodule contains error types for metadata processing. Error types for the metadata-gen library. - metadata
- The
metadatamodule contains functions for extracting and processing metadata. Metadata extraction and processing module. - metatags
- The
metatagsmodule contains functions for generating meta tags. Meta tag generation and extraction module. - utils
- The
utilsmodule contains utility functions for metadata processing. Utility functions for metadata processing and HTML manipulation.
Functions§
- extract_
and_ prepare_ metadata - Extracts metadata from the content, generates keywords based on the metadata, and prepares meta tag groups.
- extract_
keywords - Extracts keywords from the metadata.
Type Aliases§
- Keywords
- Type alias for a list of keywords.
- Metadata
Map - Type alias for a map of metadata key-value pairs.
- Metadata
Result - Type alias for the result of metadata extraction and processing.