Static site generator(?)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
ana 4a21aa6045 fix(shtola): parse raw html in markdown (0.4.2) 11 months ago
..
examples feat(shtola): support reading non-utf-8 files 11 months ago
src fix(shtola): parse raw html in markdown (0.4.2) 11 months ago
tests feat(shtola): support reading non-utf-8 files 11 months ago
CHANGELOG.md fix(shtola): parse raw html in markdown (0.4.2) 11 months ago
Cargo.toml fix(shtola): parse raw html in markdown (0.4.2) 11 months ago
LICENSE Link LICENSE 3 years ago
README.md doc: Remove doc link breaking period 1 year ago

README.md

shtola

Shtola is a library for generic file processing. It enables you to build your own applications that function as static site generators! Here's an example:

use shtola::{Plugin, RefIR, ShFile, Shtola};
use std::time::SystemTime;

fn plugin() -> Plugin {
	Box::new(|mut ir: RefIR| {
		// Let's create our file in the IR (intermediate representation) file hash map!
		let current_time = SystemTime::now();
		ir.files.insert(
			"current_time.txt".into(),
			ShFile {
				content: format!("{:?}", current_time).into(),
				..ShFile::default()
			},
		);
	})
}

fn main() {
	let mut s = Shtola::new();
	s.source("fixtures/empty");
	s.destination("fixtures/dest_systemtime");
	s.register(plugin());
	s.build().expect("Build failed!");
	// Now we have a "current_time.txt" file in our destination directory that
	// contains the current system time!
}

Installation

Add the latest version of Shtola to your Cargo.toml.

Documentation

See https://docs.rs/shtola