#![deny(missing_docs)]
#![forbid(unsafe_code)]
mod chrome;
mod compress;
mod d2;
mod directives;
mod error;
mod fences;
mod lean;
mod seo;
mod serve;
pub use chrome::{
extract_toc, page as chrome_page, Chrome, NavGroup, TocEntry, LAYOUT_CSS as chrome_layout_css,
};
pub use compress::{ext_token, pick_encoding, sidecar_path, Tools};
pub use directives::{resolve, BuildContext};
pub use error::CompilerError;
pub use fences::{scan, Directive, DirectiveKind, Scanned};
pub use seo::{
document, first_h1, first_paragraph, llms_txt, robots_txt, sitemap_xml, split_front_matter,
PageMeta, SeoPage, SiteConfig,
};
pub use serve::{compile_site, compile_site_with, mime_for, resolve_route, SiteReport};
pub fn compile(source: &str, ctx: &BuildContext) -> Result<String, CompilerError> {
let scanned = scan(source);
let resolved = scanned.substitute(|d| resolve(d, ctx))?;
docs_core::render(&resolved, &ctx.asset_base).map_err(CompilerError::Render)
}
pub const VERSION: &str = env!("CARGO_PKG_VERSION");