Sign in

    himeno/mopress/config does not have a README file

    ConfigParseError

    pub suberror ConfigParseError {
    ConfigParseError(String)
    } derive(Eq,
    Debug
    )

    Error raised when a configuration file's contents cannot be parsed into a BookConfig. The associated String carries a human-readable description of the parse failure.

    BookConfig

    pub(all) struct BookConfig {
    title : String
    description : String
    keywords : String
    favicon : String
    logo : String
    authors : Array[String]
    language : String
    repository : String?
    src : String
    dest : String
    base_url : String
    features : FeaturesConfig
    extensions : ExtensionsConfig
    } derive(Eq, ToJson,
    Debug
    )

    Top-level configuration for a mopress site/book.

    This is the structure serialized to and parsed from the project's configuration file (see file_name), and is threaded through the entire build pipeline (see himeno/mopress's run and process_markdown_page, and himeno/mopress/bridge's processor-running functions) as shared, read-only context.

    BookConfig::apply_feature_presets

    fn BookConfig::apply_feature_presets(self : BookConfig) -> BookConfig

    Desugars the features preset into their corresponding low-level extension fields (use_js, use_css, inject_head, inject_body, import_css, import_js, etc.), returning a new BookConfig with those extension fields populated accordingly.

    This is automatically invoked at the end of BookConfig::parse, so callers loading configuration through parse do not need to call this separately; it is exposed primarily for cases where a BookConfig is constructed or mutated by other means and needs the same desugaring applied afterwards.

    BookConfig::parse

    fn BookConfig::parse(config_str : String) -> BookConfig raise ConfigParseError

    Parses a BookConfig from its serialized (TOML) string representation.

    Raises ConfigParseError if input is not valid TOML, or is valid TOML that does not match the expected BookConfig shape (e.g. missing required fields or fields of the wrong type).

    BookConfig::to_toml

    fn BookConfig::to_toml(self : BookConfig) -> String

    Serializes this configuration to its TOML string representation, e.g. for writing out to the project's configuration file (see file_name) during mopress init or when persisting configuration changes.

    ExtensionsConfig

    pub(all) struct ExtensionsConfig {
    template : String
    assets : Array[String]
    inject_head : Array[String]
    inject_body : Array[String]
    use_js : Array[String]
    use_css : Array[String]
    import_css : Array[String]
    import_js : Array[String]
    preprocessors : Array[String]
    transformers : Array[String]
    } derive(Eq, ToJson,
    Debug
    )

    Configuration for extension points that customize how a site is built: which template to render pages with, which static assets to copy verbatim, which CSS/JS to inject or import, and which external preprocessor/transformer commands to run over Markdown content.

    FeaturesConfig

    pub(all) struct FeaturesConfig {
    highlight_enabled : Bool
    highlight_theme : String
    mathjax_enabled : Bool
    } derive(Eq, ToJson,
    Debug
    )

    Toggles for optional, built-in rendering features.

    file_name

    let file_name : String

    The file name (relative to the current working directory) that mopress looks for, reads, and writes as the project's configuration file, e.g. when running mopress init or when loading configuration before a build/serve command.

    Source Files

    Powered by MoonBit

    Site sourceReport issuePackagesBuild queueSkillsStatistics

    © 2026 mooncakes.io