Crate dollgen

Crate dollgen 

Source
Expand description

dollgen is a relatively simple Static Site Generator, intended to be unbiased towards what you choose to write your site in (by default, it doesn’t have [em:any] language-specific features)

&rules the core of dollgen is simple, define rules with the following: - included paths[ref(glob)] - excluded paths[ref(glob)] - output path[ref(format)] (recieves captures from the include glob that matched) - transformer that reads the input file and generates a plan to be executed

	may be created oneself or found in the integrations section

although it's *recommended* to use [code:src/] for input files and [code:dist/] for output files,
dollgen does not care what directories you use, and will automatically create directories up to whatever
output path that a rule specifies

[def(glob)::
	globs follow the syntax of [link(https://crates.io/crates/capturing-glob):capturing-glob]
	
	all paths are relative to the current working directory
]

[def(format)::
	format strings follow a similar syntax to rust's format strings, but simpler

	given a list of captures, [code:{n}] is replaced with the [code:n]-th capture

	given rule with an include [code:src/(**)/(*).draft.*)],
	matching path [code:src/blog/itsfirstblog.draft.doll],
	format string [code:dist/{0}/{1}.html]
	would produce [code:dist/blog/itsfirstblog.html]
]

&integrations read more about integrations in their individual modules

currently present
-	templating languages
	-	[link(https://docs.rs/dollgen/latest/dollgen/liquid/):liquid]
		(feature: [code:liquid], support for [link(https://shopify.github.io/liquid/):the liquid templating language])
	-	[link(https://docs.rs/dollgen/latest/dollgen/minijinja/):minijinja]
		(feature: [code:minijinja], support for the jinja templating language via [link(https://github.com/mitsuhiko/minijinja):minijinja])
-	source languages to be used in templates
	-	[link(https://docs.rs/dollgen/latest/dollgen/lang/markdoll/):markdoll]
		(feature: [code:lang-markdoll], support for [link(https://codeberg.org/0x57e11a/markdoll):the markdoll language])
-	misc
	-	[link(https://docs.rs/dollgen/latest/dollgen/scss/):scss]
		(feature: [code:scss], support for [link(https://sass-lang.com/documentation/syntax/):the scss/sass stylesheet languages])
	-	[link(https://docs.rs/dollgen/latest/dollgen/wasm/):wasm]
		(feature: [code:wasm], support for compiling rust libs to [link(https://webassembly.org/):webassembly modules], via [link(https://github.com/rustwasm/wasm-bindgen):wasm_bindgen])

planned
-	markdown
-	maybe MDX?
-	maybe reStructuredText? (if it wants to subject itself to that?)
-	at this point just make an issue for what you want

Modules§

lang
source languages for templating rules

Structs§

Entry
Entry that contains file path as well as all capture groups if any
Pattern
A compiled Unix shell style pattern.
Plan
a plan to transform a file
Rule
the core of dollgen, defines a list of globs to include, a list of globs to exclude, how to transform the file, and where to emit it to

Enums§

ErrorKind
an error

Traits§

PlannedTransformation
a planned transformation that can be executed

Functions§

copy
a primitive transformer that just fs::copy’s its input path to its output path
execute
execute some plans
format
quickly format a format-string with a given set of captures
noop
the most primitive transformer, does absolutely nothing
plan
plan some transformations
run
equivalent to execute(plan(rules)?)