README

Anxiu0101/yuegui/core does not have a README file

#
AssetKind

pub(all) enum AssetKind {
Image
File
Stylesheet
Script
}

A static asset reference: image, stylesheet, or downloadable file.

#
AssetRef

pub(all) struct AssetRef {
source_path : String
target_path : String
kind : AssetKind
}

A reference to a static asset, with source and target paths.

#
ConfigJson

pub(all) enum ConfigJson {
CJNull
CJBool(Bool)
CJInt(Int)
CJDouble(Double)
CJString(String)
CJArray(Array[ConfigJson])
CJObject(Map[String, ConfigJson])
}

Flexible JSON-like value for extensible configuration (markdown_extensions, extra, plugin options).

#
Diagnostic

pub(all) struct Diagnostic {
level : DiagnosticLevel
code : String
file_path : String
line : Int?
column : Int?
message : String
}

A build-time diagnostic with source location.

#
DiagnosticLevel

pub(all) enum DiagnosticLevel {
Error
Warning
Info
}

Severity level of a diagnostic.

#
FidelityLevel

pub(all) enum FidelityLevel {
Full
Partial
Unknown
}

Reported rendering fidelity for a document.

#
Heading

pub(all) struct Heading {
level : Int
text : String
id : String
}

A heading extracted from a parsed document.
pub(all) struct Link {
target : String
kind : LinkKind
}

A link found in a document, with source location.

#
LinkKind

pub(all) enum LinkKind {
Internal(String)
External(String)
Asset(String)
}

The kind of a link target.
pub(all) enum NavItem {
Link(String, String)
Group(String, Array[NavItem])
Separator
}

A navigation item in a nav bar or sidebar.
pub(all) struct NavigationConfig {
nav : Array[NavItem]
sidebar : Map[String, Array[NavItem]]
}

Navigation configuration for a site.

#
PageMetadata

pub(all) struct PageMetadata {
title : String
description : String?
date : String?
author : String?
tags : Array[String]
draft : Bool
layout : String
weight : Int
}

Per-page metadata from frontmatter and document extraction.

#
ParsedDocument

pub(all) struct ParsedDocument {
source : SourceDocument
title : String?
headings : Array[Heading]
links : Array[Link]
assets : Array[AssetRef]
diagnostics : Array[Diagnostic]
render_capabilities : RenderCapabilities
}

The output of a ParserAdapter, ready for indexing.

#
PluginConfig

pub(all) struct PluginConfig {
name : String
options : Map[String, ConfigJson]
}

Plugin configuration entry. name is the MoonBit package name or registry identifier. options is an arbitrary JSON-like map passed to the plugin on load.

#
RenderCapabilities

pub(all) struct RenderCapabilities {
format : SourceFormat
mode : RenderMode
fidelity : FidelityLevel
warnings : Array[String]
}

Describes what a format adapter can deliver at render time.

#
RenderMode

pub(all) enum RenderMode {
SemanticHtml
SvgEmbed
Artifact
}

Available Typst rendering modes.

#
Site

pub(all) struct Site {
pages : Map[String, SitePage]
routes : Array[String]
diagnostics : Array[Diagnostic]
}

Aggregate site state built during the index pass.

#
SitePage

pub(all) struct SitePage {
route : String
title : String
content_html : String
source_format : SourceFormat
metadata : PageMetadata
outgoing_links : Array[String]
headings : Array[Heading]
}

One page in the site graph — the unit that gets themed and emitted.

#
SourceDocument

pub(all) struct SourceDocument {
path : String
format : SourceFormat
frontmatter : Map[String, String]
body : String
}

A raw document read from disk, before format-specific body parsing.

#
SourceFormat

pub(all) enum SourceFormat {
Markdown
Typst
Html
}

Source format of a document, determined by file extension.

#
YueguiConfig

pub(all) struct YueguiConfig {
title : String
description : String
language : String
base_url : String
source_dir : String
theme_dir : String
output_dir : String
auto_navigation : Bool
navigation : NavigationConfig
markdown_extensions : Map[String, ConfigJson]
plugins : Array[PluginConfig]
extra : Map[String, ConfigJson]
typst_mode : String
typst_fallback : String
dev_port : Int
dev_host : String
}

Site configuration: all user-facing settings for a Yuegui site.
let E001_BROKEN_LINK : String

Error codes.

#
E002_ROUTE_COLLISION

let E002_ROUTE_COLLISION : String

#
E003_MISSING_FRONTMATTER

let E003_MISSING_FRONTMATTER : String

#
E004_UNKNOWN_FORMAT

let E004_UNKNOWN_FORMAT : String

#
E005_MISSING_TEMPLATE

let E005_MISSING_TEMPLATE : String

#
E006_TYPST_COMPILE_FAILED

let E006_TYPST_COMPILE_FAILED : String

#
W001_TYPST_LAYOUT_WARNING

let W001_TYPST_LAYOUT_WARNING : String

Warning codes.

#
W002_SVG_EMBED_ACCESSIBILITY

let W002_SVG_EMBED_ACCESSIBILITY : String

#
W003_ORPHAN_PAGE

let W003_ORPHAN_PAGE : String

fn check_broken_links(site : Site) -> Site

Check for broken wikilinks across all pages.

#
check_missing_titles

fn check_missing_titles(site : Site) -> Site

Check all pages have a non-empty title derived.

#
check_route_collisions

fn check_route_collisions(site : Site) -> Site

Detect route collisions in the site.

#
check_template_slots

fn check_template_slots(layouts : Map[String, String]) -> Array[Diagnostic]

Check that all template variables in the given layouts are known. Returns diagnostics for any unknown variable references.

#
default_yuegui_config

fn default_yuegui_config() -> YueguiConfig

Default site configuration values.

#
detect_format

fn detect_format(path : String) -> SourceFormat?

Detect SourceFormat from a file extension.

#
error

fn error(code : String, file_path : String, line : Int?, column : Int?, message : String) -> Diagnostic

Create an error diagnostic.

#
filepath_to_route

fn filepath_to_route(filepath : String, source_dir : String) -> String

Route computation from file paths.

Rules:
  • content/index.md/
  • content/guide/index.md/guide/
  • content/guide/getting-started.md/guide/getting-started/

The source_dir prefix (e.g. "content") is stripped from the filepath before route computation.

#
info

fn info(code : String, file_path : String, line : Int?, column : Int?, message : String) -> Diagnostic

Create an info diagnostic.

#
warning

fn warning(code : String, file_path : String, line : Int?, column : Int?, message : String) -> Diagnostic

Create a warning diagnostic.