Skip to main content

Crate jlic

Crate jlic 

Source
Expand description

LICENSE file generator for open source projects.

License texts are embedded in the binary; nothing is read from disk at runtime.

use jlic::{Context, License, render_license};

let ctx = Context {
    year: "2026".into(),
    name: Some("Mikhail Savin".into()),
    email: None,
};
let text = render_license(License::Mit, &ctx).unwrap();
assert!(text.contains("Copyright (c) 2026 Mikhail Savin"));

Re-exports§

pub use context::Context;
pub use error::Error;
pub use error::Result;
pub use license::Fields;
pub use license::License;

Modules§

cli
Command line definition.
context
Values to substitute into templates: year, copyright holder, email.
error
license
Catalog of supported licenses and their templates.
output
Writing the result to disk.
template
Minimal template engine: substitutes {{year}}, {{holder}}, {{name}} and {{email}}.

Functions§

render_license
Renders the license text for a LICENSE file.
render_notice
Renders the notice block for a source file header.