Skip to main content

systemprompt_generator/
lib.rs

1//! Static-site generation, theme rendering, and asset bundling for the
2//! systemprompt.io AI governance dashboard. Drives the Handlebars + Markdown
3//! pipeline that turns content rows in the database into a fully static
4//! `dist/` directory.
5//!
6//! # Public surface
7//!
8//! - [`prerender_content`] / [`prerender_pages`] — main entry points for
9//!   rendering content sources and registered page-prerenderer extensions.
10//! - [`BuildOrchestrator`] / [`BuildMode`] — drives the whole build (CSS
11//!   organisation + validation) with progress reporting.
12//! - [`generate_sitemap`], [`generate_feed`] — emit `sitemap.xml` and
13//!   per-source RSS feeds.
14//! - [`organize_dist_assets`] — post-build CSS/JS file reorganisation.
15//! - [`PublishError`] / [`GeneratorResult`] — the typed error and `Result`
16//!   alias returned by every public function in this crate.
17//! - [`ContentPrerenderJob`], [`PagePrerenderJob`] — scheduled jobs registered
18//!   with the systemprompt scheduler via the `inventory` crate.
19//!
20//! # Feature flags
21//!
22//! | Feature             | Effect                                                                 |
23//! | ------------------- | ---------------------------------------------------------------------- |
24//! | `image-processing`  | Pulls in the `image` crate to enable WebP conversion in asset jobs.    |
25//!
26//! All features are off by default.
27//!
28//! Copyright (c) systemprompt.io — Business Source License 1.1.
29//! See <https://systemprompt.io> for licensing details.
30
31pub(crate) mod assets;
32pub(crate) mod build;
33pub(crate) mod content;
34pub(crate) mod error;
35pub(crate) mod jobs;
36pub(crate) mod prerender;
37pub(crate) mod rss;
38pub(crate) mod sitemap;
39pub(crate) mod templates;
40
41pub use assets::organize_dist_assets;
42pub use build::{BuildError, BuildMode, BuildOrchestrator};
43pub use content::{extract_frontmatter, render_markdown};
44pub use error::{GeneratorResult, PublishError};
45pub use prerender::{
46    PagePrerenderResult, TocResult, generate_toc, merge_json_data, prerender_content,
47    prerender_pages,
48};
49pub use rss::{
50    DefaultRssFeedProvider, GeneratedFeed, RssChannel, RssItem, build_rss_xml, generate_feed,
51    generate_feed_with_providers,
52};
53pub use sitemap::{
54    DefaultSitemapProvider, SitemapUrl, build_sitemap_index, build_sitemap_xml, escape_xml,
55    generate_sitemap,
56};
57pub use systemprompt_models::{ContentConfigRaw, ContentSourceConfigRaw, SitemapConfig};
58pub use systemprompt_templates::TemplateRegistry;
59pub use templates::{get_templates_path, load_web_config};
60
61pub use jobs::{ContentPrerenderJob, PagePrerenderJob, copy_asset, execute_copy_extension_assets};