3 releases

0.1.2 Dec 18, 2024
0.1.1 Sep 16, 2024
0.1.0 Sep 13, 2024

#2 in #denote

Download history 100/week @ 2024-09-09 236/week @ 2024-09-16 17/week @ 2024-09-23 32/week @ 2024-09-30 6/week @ 2024-12-09 131/week @ 2024-12-16

137 downloads per month
Used in zeroten-denote-cli

MPL-2.0 license

19KB
345 lines

denote-lib

Handle denote name scheme. It's used in denote-cli.

How to use denote-lib you can found in documentation.


lib.rs:

Handle denote name scheme.

Core of this crate is the Denote struct. Create it, fill in the fields as an option and convert it in to string to get formatted string in denote name scheme.

Declaration

I recommend declaring denote-lib in Cargo.toml like this:

[dependencies]
denote = { package = "zeroten-denote", version = "0.1.1" }

Usage

use zeroten_denote::{Denote, Identifier, Signature, Extension, Title};

// You can use something like `Identifier::now()` but for example, we will take an already
// formatted identifier
let identifier = Identifier::parse("20240912T13015412").unwrap();
let denote = Denote::new(identifier)
    .title(Title::parse("Some title").unwrap())
    .signature(Signature::parse("1b").unwrap())
    .extension(Extension::new("txt").unwrap())
    .to_string();
assert_eq!(denote.to_string(), "20240912T13015412==1b--some-title.txt");

Dependencies

~3–4.5MB
~72K SLoC