Skip to main content

pipa/
lib.rs

1// SPDX-FileCopyrightText: Copyright 2026 olav@occy.org
2// SPDX-License-Identifier: MPL-2.0
3
4//! Pipa is a tiny, pipe-y template language,
5//! made for the wonderfully whimsical world of humans-typing-text.
6//! Almost everything is optional and almost nothing is type-safe.
7//! It's do-what-i-mean all-the-way-down, at least in theory.
8//!
9//! For now, you'll find very few docs beyond this point.
10//! Many items of questionable general utility are simply hidden.
11//! Still more a ballpit of curios than, you know, serious software.
12//! However, let me know if you find anything useful that should be exposed or explained.
13//! It's mostly just a time thing.
14//!
15//! ```
16//! // Values can be Bytes, Lists, or Maps.
17//! // List and Map punctuation is optional.
18//!
19//! {set my-bytes "beep"}
20//! {set my-list [1 2 3]}
21//! {set my-map {a 4 b 5}}
22//! {set my-stuff [{ x: ['y', 10] }]}
23//!
24//! // No true/false/nil, just empty-or-not.
25//! // Use "&&" and "||" and ";" to stop-or-go.
26//!
27//! {"" && "hello?"} // => ""
28//! {[] || "list is empty"} // => "list is empty"
29//! {{} && "ternary" || "goodness"} // => "goodness"
30//!
31//! // Pipes insert their input at the end.
32//! // Use _ to insert the input somewhere else.
33//! // Concats by default, and <tags> are bytes.
34//!
35//! {capitalize my-bytes} // => "Beep"
36//! {my-bytes | capitalize} // => "Beep"
37//! {my-map | first | add _ _} // => 8
38//! {my-list | map :(add 1)} // => [2 3 4]
39//! {1 2 3 | <i>_</i>} // => "<i>123</i>"
40//! ```
41
42pub(crate) mod func;
43/// Evaluate templates, expressions, and keychains.
44pub mod lang;
45pub(crate) mod serde;
46/// The core value type and its supporting cast.
47pub mod value;