artifactize_core/
monitor.rs1pub mod catalog;
3pub mod evidence;
4pub mod fold;
5pub mod live;
6pub mod loader;
7pub mod model;
8pub mod session;
9
10pub use catalog::{Badge, Catalog, CatalogRow, Repository, Scope};
11pub use evidence::{Evidence, EvidenceStamp, evidence, original};
12pub use fold::upstream;
13pub use loader::{Input, Loader, Origin, Page, Snapshot, newer_offset, older_offset};
14pub use model::code;
15pub use model::{
16 Activity, Busy, Card, Clock, Completion, Detail, EvalView, Graph, GraphEdge, GraphNode, Kind,
17 Light, Node, NodeId, NotRun, Progress, Queue, RunRow, Section, Segment, Source, Status, Strip,
18 Tally, Target, Tone, Upstream, Waits, Weight, card, counts, detail, duration, glyph, graph,
19 progress, run_node, run_rows, strip, tree, upstream_index,
20};
21
22use crate::workspace::canonical_target;
23use std::{borrow::Cow, path::PathBuf};
24
25pub const PAGE: u32 = 100;
27
28pub fn initial(repo: Option<PathBuf>) -> Option<PathBuf> {
31 repo.map(|path| canonical_target(&path).unwrap_or(path))
32}
33
34pub fn plain(text: &str) -> Cow<'_, str> {
37 if !text.contains(char::is_control) {
38 return Cow::Borrowed(text);
39 }
40 Cow::Owned(
41 text.chars()
42 .filter_map(|character| match character {
43 '\n' | '\t' => Some(' '),
44 character if character.is_control() => None,
45 character => Some(character),
46 })
47 .collect(),
48 )
49}
50
51#[cfg(test)]
52pub(crate) mod tests;