1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
//! `docgen-bases` — a faithful, dependency-light engine and static HTML renderer
//! for [Obsidian Bases](https://obsidian.md/help/bases).
//!
//! A `.base` file is a YAML document describing filtered, sorted, grouped *views*
//! over a vault's notes, computed from note frontmatter, file metadata, and an
//! expression language (functions, methods, operators, formulas, summaries). This
//! crate parses that YAML, evaluates the expression language over a caller-built
//! [`Corpus`] of [`Note`]s, and renders each view to self-contained HTML — no
//! scripts, no runtime — for build-time inclusion in a static site.
//!
//! The crate is pure: it performs no I/O and knows nothing about docgen. The host
//! (docgen-build / docgen-core) constructs the [`Corpus`] from discovered docs and
//! supplies a [`RenderOptions`] with the site base path.
//!
//! ## Quick start
//! ```
//! use docgen_bases::{render_base_source, Corpus, Note, RenderOptions};
//!
//! let mut note = Note::default();
//! note.slug = "books/dune".into();
//! note.basename = "Dune".into();
//! note.tags = vec!["book".into()];
//! let corpus = Corpus::new(vec![note]);
//!
//! let yaml = "filters:\n and:\n - file.hasTag(\"book\")\nviews:\n - type: table\n";
//! let html = render_base_source(yaml, &corpus, &RenderOptions::default());
//! assert!(html.contains("docgen-base-table"));
//! ```
// Test helpers build `Note`/`View` fixtures by field-reassigning a `default()`,
// which is clearest for large structs; allow it in test code only.
pub use view_interactive_enabled;
pub use ;
pub use ;
pub use ;
pub use ;
/// Errors surfaced by the base engine. Parsing/eval degrade gracefully inside the
/// renderer (producing error blocks / empty cells), so this is mostly for callers
/// that want to parse a base explicitly.