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.

    ConfigParseError::equal

    ConfigParseError::not_equal

    fn ConfigParseError::not_equal(x : ConfigParseError, y : ConfigParseError) -> Bool

    ConfigParseError::output

    fn ConfigParseError::output(self : ConfigParseError, logger : &Logger) -> Unit

    ConfigParseError::to_string

    fn ConfigParseError::to_string(self : ConfigParseError) -> String

    BookConfig

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

    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::default

    fn BookConfig::default() -> BookConfig

    BookConfig::equal

    fn BookConfig::equal(BookConfig, BookConfig) -> Bool

    BookConfig::not_equal

    fn BookConfig::not_equal(x : BookConfig, y : BookConfig) -> Bool

    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_json

    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]
    data_dir : String
    } derive(Eq,
    Debug
    ,
    ToJson
    )

    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.

    ExtensionsConfig::default

    ExtensionsConfig::equal

    ExtensionsConfig::not_equal

    fn ExtensionsConfig::not_equal(x : ExtensionsConfig, y : ExtensionsConfig) -> Bool

    FeaturesConfig

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

    Toggles for optional, built-in rendering features.

    FeaturesConfig::default

    FeaturesConfig::equal

    FeaturesConfig::not_equal

    fn FeaturesConfig::not_equal(x : FeaturesConfig, y : FeaturesConfig) -> Bool

    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