### SiteConfig::builder Source: https://docs.rs/wikioxide/0.1.0/wikioxide/struct.SiteConfig.html Starts building a configuration for a wiki. ```APIDOC ### pub fn builder(lang: impl Into, site_name: impl Into) -> SiteConfigBuilder Starts building a configuration for a wiki with the given content language code and site name. ``` -------------------------------- ### Get human-readable title text Source: https://docs.rs/wikioxide/0.1.0/wikioxide/struct.Title.html?search= Generates the human-readable string representation of the title. ```rust pub fn text(&self) -> String ``` -------------------------------- ### SiteConfig::from_preset_json Source: https://docs.rs/wikioxide/0.1.0/wikioxide/struct.SiteConfig.html Loads a configuration from preset JSON. ```APIDOC ### pub fn from_preset_json(json: &str) -> Result Loads a configuration from preset JSON (the schema written by `cargo xtask gen-siteconfig`, not raw `meta=siteinfo` output). ``` -------------------------------- ### InMemoryTemplateStore::new Source: https://docs.rs/wikioxide/0.1.0/wikioxide/struct.InMemoryTemplateStore.html Creates a new, empty InMemoryTemplateStore instance. ```APIDOC ## pub fn new() -> Self ### Description Creates and returns an empty InMemoryTemplateStore. ### Signature `pub fn new() -> Self` ``` -------------------------------- ### Define Span Struct Source: https://docs.rs/wikioxide/0.1.0/wikioxide/struct.Span.html The structure definition for Span, containing start and end byte offsets. ```rust pub struct Span { pub start: usize, pub end: usize, } ``` -------------------------------- ### SystemClock::default Source: https://docs.rs/wikioxide/0.1.0/wikioxide/struct.SystemClock.html Creates a new instance of SystemClock. ```APIDOC ## fn default() -> SystemClock ### Description Returns the default value for the SystemClock type. ### Signature `pub fn default() -> SystemClock` ``` -------------------------------- ### Namespace::new Source: https://docs.rs/wikioxide/0.1.0/wikioxide/struct.Namespace.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Creates a new Namespace instance from a raw MediaWiki namespace ID. ```APIDOC ## pub const fn new(id: i32) -> Self ### Description Wraps a raw MediaWiki namespace id into a Namespace object. ### Parameters - **id** (i32) - Required - The raw integer ID of the MediaWiki namespace. ``` -------------------------------- ### InMemoryTemplateStore::extend Source: https://docs.rs/wikioxide/0.1.0/wikioxide/struct.InMemoryTemplateStore.html Bulk-loads multiple pages into the store. ```APIDOC ## pub fn extend(&self, pages: impl IntoIterator>)>) ### Description Bulk-loads pages into the store. A value of `None` for the wikitext marks the page as verified-missing. ### Parameters - **pages** (impl IntoIterator>)>) - An iterator of tuples containing the title and optional wikitext. ``` -------------------------------- ### SiteConfig Presets Source: https://docs.rs/wikioxide/0.1.0/wikioxide/struct.SiteConfig.html Methods to retrieve predefined SiteConfig instances for common wikis. ```APIDOC ### pub fn enwiki() -> &'static SiteConfig English Wikipedia (en.wikipedia.org) preset. ### pub fn ruwiki() -> &'static SiteConfig Russian Wikipedia (ru.wikipedia.org) preset. ### pub fn generic() -> &'static SiteConfig A plain-MediaWiki preset: canonical English namespaces, core magic words and extension tags, default protocols. ``` -------------------------------- ### pub fn code(&self) -> Option<&'static str> Source: https://docs.rs/wikioxide/0.1.0/wikioxide/enum.Warning.html Retrieves the MediaWiki 'parsewarnings' message key that this warning mirrors. Returns None for diagnostic warnings or warnings specific to this crate. ```APIDOC ### Method `pub fn code(&self) -> Option<&'static str>` ### Description Returns the MediaWiki API-parity message key (e.g., 'duplicate-args-warning') associated with the warning. If the warning is a diagnostic warning or specific to this crate, it returns None. ### Returns - **Option<&'static str>** - The message key string if available, otherwise None. ``` -------------------------------- ### ExistenceMap::new Source: https://docs.rs/wikioxide/0.1.0/wikioxide/struct.ExistenceMap.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Creates a new, empty ExistenceMap. ```APIDOC ### pub fn new() -> Self Creates an empty map. ``` -------------------------------- ### SiteConfig Methods Source: https://docs.rs/wikioxide/0.1.0/wikioxide/struct.SiteConfig.html?search=u32+-%3E+bool Methods available on the SiteConfig struct for retrieving wiki-specific configuration details. ```APIDOC ## SiteConfig Methods ### from_preset_json(json: &str) -> Result Loads a configuration from preset JSON. ### enwiki() -> &'static SiteConfig Returns the English Wikipedia preset. ### ruwiki() -> &'static SiteConfig Returns the Russian Wikipedia preset. ### generic() -> &'static SiteConfig Returns a plain-MediaWiki preset. ### builder(lang: impl Into, site_name: impl Into) -> SiteConfigBuilder Starts building a configuration for a wiki. ### lang(&self) -> &str Returns the wiki's content-language code. ### site_name(&self) -> &str Returns the wiki's site name. ### resolve_namespace(&self, prefix: &str) -> Option Resolves a namespace prefix to a namespace. ### namespace_name(&self, ns: Namespace) -> Option<&str> Returns the localized name of a namespace. ### ns_first_letter(&self, ns: Namespace) -> bool Checks if titles in the namespace are first-letter case-insensitive. ### resolve_magic_word(&self, alias: &str) -> Option<&str> Resolves a magic-word alias to its stable id. ### redirect_aliases(&self) -> &[String] Returns the accepted redirect keywords. ### ext_tag(&self, name: &str) -> Option Returns how an extension tag treats its body. ### protocols(&self) -> &[String] Returns external-link protocols. ### trail_accepts(&self, c: char) -> bool Checks if a character may extend a link label. ### is_interwiki_prefix(&self, prefix: &str) -> bool Checks if a prefix is a known interwiki prefix. ### magic_links(&self) -> MagicLinks Returns the RFC/PMID/ISBN magic-link toggles. ### lang_converter(&self) -> bool Checks if LanguageConverter markup is recognized. ### months(&self) -> &MonthNames Returns the localized month names. ``` -------------------------------- ### SiteConfig Query Methods Source: https://docs.rs/wikioxide/0.1.0/wikioxide/struct.SiteConfig.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Methods to query configuration details like namespaces, magic words, and language settings. ```APIDOC ## Query Methods - **lang(&self) -> &str**: Returns the wiki's content-language code. - **site_name(&self) -> &str**: Returns the wiki's site name. - **resolve_namespace(&self, prefix: &str) -> Option**: Resolves a namespace prefix to a Namespace. - **resolve_magic_word(&self, alias: &str) -> Option<&str>**: Resolves a magic-word alias to its stable id. - **ext_tag(&self, name: &str) -> Option**: Looks up how an extension tag treats its body. ``` -------------------------------- ### MagicWordDef::new Source: https://docs.rs/wikioxide/0.1.0/wikioxide/struct.MagicWordDef.html?search= Creates a new instance of a MagicWordDef. ```APIDOC ## pub fn new(id: impl Into, aliases: A, case_sensitive: bool) -> Self ### Description Creates a new magic word definition with the specified identifier, aliases, and case-sensitivity flag. ### Parameters - **id** (impl Into) - Required - The stable MediaWiki identifier (e.g., 'if', 'redirect'). - **aliases** (A: IntoIterator>) - Required - A collection of accepted spellings for the magic word. - **case_sensitive** (bool) - Required - Whether the aliases match case-sensitively. ``` -------------------------------- ### SiteConfig Query Methods Source: https://docs.rs/wikioxide/0.1.0/wikioxide/struct.SiteConfig.html Methods to query configuration details like namespaces, magic words, and protocols. ```APIDOC ### pub fn lang(&self) -> &str The wiki’s content-language code. ### pub fn site_name(&self) -> &str The wiki’s site name. ### pub fn resolve_namespace(&self, prefix: &str) -> Option Resolves a namespace prefix to a namespace. ### pub fn resolve_magic_word(&self, alias: &str) -> Option<&str> Resolves a magic-word alias to its stable id. ### pub fn protocols(&self) -> &[String] Returns external-link protocols. ``` -------------------------------- ### Initialize and configure PageContext Source: https://docs.rs/wikioxide/0.1.0/wikioxide/struct.PageContext.html?search=std%3A%3Avec Methods for creating a new context with a title and overriding the current timestamp. ```rust pub fn for_title(title: Title) -> Self ``` ```rust pub fn at(self, now: Timestamp) -> Self ``` -------------------------------- ### SiteConfig Definition Source: https://docs.rs/wikioxide/0.1.0/wikioxide/struct.SiteConfig.html The primary structure definition for site configuration. ```rust pub struct SiteConfig { /* private fields */ } ``` -------------------------------- ### InMemoryTemplateStore Methods Source: https://docs.rs/wikioxide/0.1.0/wikioxide/struct.InMemoryTemplateStore.html?search= Methods available for interacting with the InMemoryTemplateStore instance. ```APIDOC ## pub fn new() -> Self Creates an empty InMemoryTemplateStore. ## pub fn insert(&self, title: Title, wikitext: impl Into>) Records that a specific title exists with the provided wikitext. ## pub fn insert_missing(&self, title: Title) Records that a specific title is verified not to exist (a red link). ## pub fn extend(&self, pages: impl IntoIterator>)>) Bulk-loads pages into the store. A value of None marks a page as verified-missing. ## pub fn len(&self) -> usize Returns the number of cached entries, including both present and verified-missing pages. ## pub fn is_empty(&self) -> bool Returns true if the store holds no entries. ``` -------------------------------- ### Parse wikitext with WikitextParser Source: https://docs.rs/wikioxide/0.1.0/wikioxide/index.html Configure a site-specific parser and process wikitext into a DocumentView. The parser is total over input, returning a document and warnings instead of errors. ```rust use wikioxide::{DocumentView, NamespaceDef, PageContext, SiteConfig, WikitextParser}; let config = SiteConfig::builder("ru", "Вики") .namespace(NamespaceDef::main()) .namespace(NamespaceDef::new(10, "Template", "Шаблон", ["Ш"], true)) .link_trail("a-zа-яё") .build()?; let parser = WikitextParser::builder().site_config(config).build()?; let doc = parser.parse( "Стихи [[кота|котика]] в {{рамке|цвет=серый}}", &PageContext::default(), ); assert_eq!(doc.links()[0].target().text(), "Кота"); assert_eq!(doc.links()[0].anchor_text(), Some("котика")); assert_eq!(doc.templates()[0].title().text(), "Шаблон:Рамке"); assert_eq!(doc.templates()[0].param("цвет"), Some("серый")); ``` -------------------------------- ### pub fn fragment(&self) -> Option<&str> Source: https://docs.rs/wikioxide/0.1.0/wikioxide/struct.Redirect.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Retrieves the fragment component of the redirect, if it exists. ```APIDOC ## pub fn fragment(&self) -> Option<&str> ### Description Returns the `#fragment` of the target, if one is specified in the redirect. ### Signature `pub fn fragment(&self) -> Option<&str>` ``` -------------------------------- ### SiteConfigBuilder Methods Source: https://docs.rs/wikioxide/0.1.0/wikioxide/struct.SiteConfigBuilder.html Methods available on the SiteConfigBuilder for configuring site settings. ```APIDOC ## SiteConfigBuilder Methods ### months(months: MonthNames) -> Self Sets the localized month names used by the signature-timestamp matcher. ### namespace(def: NamespaceDef) -> Self Adds a namespace definition. ### magic_word(def: MagicWordDef) -> Self Adds a magic-word definition. ### ext_tag(name: impl Into, content: ExtTagContent) -> Self Registers an extension tag and how its body is treated. ### protocols

(protocols: P) -> Self Replaces the external-link protocol list (defaults to MediaWiki’s). ### link_trail(class: impl Into) -> Self Sets the link-trail character class body (default "a-z"; "" disables trails). ### interwiki

(prefixes: P) -> Self Replaces the interwiki prefix list. ### magic_links(links: MagicLinks) -> Self Sets the RFC/PMID/ISBN magic-link toggles. ### lang_converter(enabled: bool) -> Self Enables or disables LanguageConverter markup recognition. ### build() -> Result Validates the definitions and compiles the lookup tables. ``` -------------------------------- ### Define SiteConfigBuilder struct Source: https://docs.rs/wikioxide/0.1.0/wikioxide/struct.SiteConfigBuilder.html?search= The primary structure used for building site configurations. ```rust pub struct SiteConfigBuilder { /* private fields */ } ``` -------------------------------- ### SiteConfigBuilder Methods Source: https://docs.rs/wikioxide/0.1.0/wikioxide/struct.SiteConfigBuilder.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Methods available on the SiteConfigBuilder struct for configuring site settings. ```APIDOC ## pub fn months(self, months: MonthNames) -> Self Sets the localized month names used by the signature-timestamp matcher. ## pub fn namespace(self, def: NamespaceDef) -> Self Adds a namespace definition. ## pub fn magic_word(self, def: MagicWordDef) -> Self Adds a magic-word definition. ## pub fn ext_tag(self, name: impl Into, content: ExtTagContent) -> Self Registers an extension tag and how its body is treated. ## pub fn protocols

(self, protocols: P) -> Self Replaces the external-link protocol list (defaults to MediaWiki’s). ## pub fn link_trail(self, class: impl Into) -> Self Sets the link-trail character class body (default "a-z"; "" disables trails). ## pub fn interwiki

(self, prefixes: P) -> Self Replaces the interwiki prefix list. ## pub fn magic_links(self, links: MagicLinks) -> Self Sets the RFC/PMID/ISBN magic-link toggles. ## pub fn lang_converter(self, enabled: bool) -> Self Enables or disables LanguageConverter markup recognition. ## pub fn build(self) -> Result Validates the definitions and compiles the lookup tables. ``` -------------------------------- ### WikitextParser::site_config Source: https://docs.rs/wikioxide/0.1.0/wikioxide/struct.WikitextParser.html Retrieves the site configuration associated with the parser. ```APIDOC ## pub fn site_config(&self) -> &SiteConfig ### Description Returns the site configuration that this parser was initialized with. ### Returns - **&SiteConfig** - A reference to the site configuration. ``` -------------------------------- ### NamespaceDef::main Source: https://docs.rs/wikioxide/0.1.0/wikioxide/struct.NamespaceDef.html Returns the definition for the main (article) namespace. ```APIDOC ### pub fn main() -> Self Returns the main (article) namespace definition. ``` -------------------------------- ### WikitextParser::builder Source: https://docs.rs/wikioxide/0.1.0/wikioxide/struct.WikitextParser.html Initializes a new builder for configuring a WikitextParser instance. ```APIDOC ## pub fn builder() -> WikitextParserBuilder ### Description Starts configuring a new parser instance. ### Returns - **WikitextParserBuilder** - A builder object used to configure the parser. ``` -------------------------------- ### pub fn name(&self) -> &str Source: https://docs.rs/wikioxide/0.1.0/wikioxide/discussion/struct.Author.html?search=u32+-%3E+bool Retrieves the account name (spaces, not underscores) or the IP address for an anonymous editor. ```APIDOC ### pub fn name(&self) -> &str Returns the account name or IP address associated with the author. ``` -------------------------------- ### Access Title database key Source: https://docs.rs/wikioxide/0.1.0/wikioxide/struct.Title.html?search= Retrieves the normalized database-key form of the page name. ```rust pub fn dbkey(&self) -> &str ``` -------------------------------- ### pub fn prefix(&self) -> &str Source: https://docs.rs/wikioxide/0.1.0/wikioxide/struct.InterLanguageLink.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Retrieves the language or interwiki prefix of the link (e.g., 'fr'). ```APIDOC ### pub fn prefix(&self) -> &str Returns the language/interwiki prefix as written (e.g., 'fr'). ``` -------------------------------- ### Applying existence facts Source: https://docs.rs/wikioxide/0.1.0/wikioxide/struct.ExpandedDocument.html?search= Enriches the document with existence data from an external provider. ```rust pub fn apply_existence(&mut self, facts: &ExistenceMap) ``` -------------------------------- ### Parse a MediaWiki title Source: https://docs.rs/wikioxide/0.1.0/wikioxide/struct.Title.html?search= Parses and normalizes a string input into a Title object using the provided SiteConfig. ```rust pub fn parse(input: &str, config: &SiteConfig) -> Result ``` -------------------------------- ### NamespaceDef::new Source: https://docs.rs/wikioxide/0.1.0/wikioxide/struct.NamespaceDef.html Creates a new namespace definition with the specified ID, canonical name, localized name, aliases, and case-sensitivity rule. ```APIDOC ### pub fn new(id: i32, canonical: impl Into, localized: impl Into, aliases: A, first_letter: bool) -> Self Creates a new namespace definition. #### Parameters - **id** (i32) - MediaWiki namespace ID. - **canonical** (impl Into) - Canonical English name. - **localized** (impl Into) - Localized name. - **aliases** (A) - Additional accepted aliases. - **first_letter** (bool) - Whether page names are first-letter case-insensitive. ``` -------------------------------- ### Access Title namespace Source: https://docs.rs/wikioxide/0.1.0/wikioxide/struct.Title.html?search= Retrieves the namespace associated with the Title. ```rust pub const fn namespace(&self) -> Namespace ``` -------------------------------- ### pub fn target(&self) -> &str Source: https://docs.rs/wikioxide/0.1.0/wikioxide/struct.InterLanguageLink.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Retrieves the unnormalized target page text on the other wiki. ```APIDOC ### pub fn target(&self) -> &str Returns the target page text on the other wiki (unnormalized — foreign title rules). ``` -------------------------------- ### pub fn name(&self) -> &str Source: https://docs.rs/wikioxide/0.1.0/wikioxide/discussion/struct.Author.html Retrieves the account name (spaces, not underscores) or the IP address if the editor is anonymous. ```APIDOC ### Method `name(&self) -> &str` ### Description Returns the account name of the author. For anonymous editors, this returns the IP address. ``` -------------------------------- ### InMemoryTemplateStore::is_empty Source: https://docs.rs/wikioxide/0.1.0/wikioxide/struct.InMemoryTemplateStore.html Checks if the store is empty. ```APIDOC ## pub fn is_empty(&self) -> bool ### Description Checks whether the store holds no entries. ### Returns - **bool** - True if the store is empty, false otherwise. ``` -------------------------------- ### Warning::code Source: https://docs.rs/wikioxide/0.1.0/wikioxide/enum.Warning.html?search= Retrieves the MediaWiki 'parsewarnings' message key associated with the warning, if one exists. ```APIDOC ## fn code(&self) -> Option<&'static str> ### Description Returns the MediaWiki `parsewarnings` message key this warning mirrors, if it has an API-parity equivalent (e.g., `duplicate-args-warning`). Diagnostic warnings or warnings specific to this crate return `None`. ``` -------------------------------- ### ExpandedDocument methods Source: https://docs.rs/wikioxide/0.1.0/wikioxide/struct.ExpandedDocument.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Methods for accessing post-expansion data such as transclusions, modules, and metadata. ```rust pub fn transclusion_closure(&self) -> &[Title] ``` ```rust pub fn modules(&self) -> &[ModuleInvocation] ``` ```rust pub fn interlanguage_links(&self) -> &[InterLanguageLink] ``` ```rust pub fn template_calls(&self) -> &[TemplateCall] ``` ```rust pub fn default_sort(&self) -> Option<&str> ``` ```rust pub fn display_title(&self) -> Option<&str> ``` ```rust pub fn titles_needing_existence(&self) -> &[Title] ``` ```rust pub fn apply_existence(&mut self, facts: &ExistenceMap) ``` -------------------------------- ### Implement lookup Method Source: https://docs.rs/wikioxide/0.1.0/wikioxide/trait.ExistenceProvider.html The lookup method should be implemented to return existence status, ideally using a cache to avoid blocking the synchronous expander. ```rust fn lookup(&self, titles: &[Title]) -> Result ``` -------------------------------- ### SystemClock::now Source: https://docs.rs/wikioxide/0.1.0/wikioxide/struct.SystemClock.html Retrieves the current wall-clock time. ```APIDOC ## fn now(&self) -> Timestamp ### Description Returns the current wall-clock time as a Timestamp. ### Signature `pub fn now(&self) -> Timestamp` ``` -------------------------------- ### SystemClock::now Source: https://docs.rs/wikioxide/0.1.0/wikioxide/struct.SystemClock.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Retrieves the current wall-clock time. ```APIDOC ## fn now(&self) -> Timestamp ### Description Returns the current wall-clock time. ### Signature `pub fn now(&self) -> Timestamp` ``` -------------------------------- ### pub fn name(&self) -> &str Source: https://docs.rs/wikioxide/0.1.0/wikioxide/discussion/struct.Author.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Retrieves the account name of the author. For registered users, this returns the account name (using spaces, not underscores); for anonymous editors, it returns the IP address. ```APIDOC ### pub fn name(&self) -> &str Returns the account name of the author. If the author is an anonymous editor, this returns their IP address. ``` -------------------------------- ### Retrieving interlanguage links Source: https://docs.rs/wikioxide/0.1.0/wikioxide/struct.ExpandedDocument.html?search= Accesses the sidebar links produced after expansion. ```rust pub fn interlanguage_links(&self) -> &[InterLanguageLink] ``` -------------------------------- ### SiteConfig::resolve_namespace Source: https://docs.rs/wikioxide/0.1.0/wikioxide/struct.SiteConfig.html?search=std%3A%3Avec Resolves a namespace prefix to a namespace object. ```APIDOC ## pub fn resolve_namespace(&self, prefix: &str) -> Option ### Description Resolves a namespace prefix (canonical, localized or alias; case-insensitive, underscore/space-insensitive) to a namespace. ### Parameters - **prefix** (str) - Required - The namespace prefix to resolve. ``` -------------------------------- ### Accessing limit values Source: https://docs.rs/wikioxide/0.1.0/wikioxide/struct.Limits.html?search= Methods to retrieve current configuration values for various parsing limits. ```rust pub const fn expansion_depth(&self) -> u16 ``` ```rust pub const fn node_count(&self) -> u64 ``` ```rust pub const fn post_expand_bytes(&self) -> usize ``` ```rust pub const fn template_arg_bytes(&self) -> usize ``` ```rust pub const fn expensive_parser_functions(&self) -> u32 ``` ```rust pub const fn unstrip_depth(&self) -> u16 ``` ```rust pub const fn unstrip_bytes(&self) -> usize ``` ```rust pub const fn max_source_bytes(&self) -> usize ``` -------------------------------- ### WikitextParserBuilder Methods Source: https://docs.rs/wikioxide/0.1.0/wikioxide/struct.WikitextParserBuilder.html Methods available on the WikitextParserBuilder to configure the parser before building. ```APIDOC ## pub fn site_config(self, config: SiteConfig) -> Self Sets the per-wiki configuration. ## pub fn limits(self, limits: Limits) -> Self Overrides the resource limits. ## pub fn clock(self, clock: Arc) -> Self Injects a clock for {{CURRENT*}}-family determinism. ## pub fn template_source(self, source: Arc) -> Self Sets where expand fetches template/module wikitext. ## pub fn existence_provider(self, provider: Arc) -> Self Sets the existence oracle {{#ifexist:}} consults. ## pub fn on_unresolved(self, policy: UnresolvedPolicy) -> Self Sets what expand does with unresolved template pages. ## pub fn build(self) -> Result Validates the configuration and builds the parser. ``` -------------------------------- ### WikitextParserBuilder Methods Source: https://docs.rs/wikioxide/0.1.0/wikioxide/struct.WikitextParserBuilder.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Methods available on the WikitextParserBuilder to configure the parser before building. ```APIDOC ## pub fn site_config(self, config: SiteConfig) -> Self Sets the per-wiki configuration (required unless the presets feature supplies the generic default). ## pub fn limits(self, limits: Limits) -> Self Overrides the resource limits (defaults mirror Wikimedia production). ## pub fn clock(self, clock: Arc) -> Self Injects a clock for {{CURRENT*}}-family determinism. ## pub fn template_source(self, source: Arc) -> Self Sets where expand fetches template/module wikitext. ## pub fn existence_provider(self, provider: Arc) -> Self Sets the existence oracle {{#ifexist:}} consults. ## pub fn on_unresolved(self, policy: UnresolvedPolicy) -> Self Sets what expand does with unresolved template pages. ## pub fn build(self) -> Result Validates the configuration and builds the parser. ``` -------------------------------- ### Title::parse Source: https://docs.rs/wikioxide/0.1.0/wikioxide/struct.Title.html Parses and normalizes a string input into a Title object based on the provided SiteConfig. ```APIDOC ## pub fn parse(input: &str, config: &SiteConfig) -> Result ### Description Parses and normalizes a title the way MediaWiki does: whitespace/underscore unification, bidi-mark stripping, namespace-prefix resolution against config, first-letter capitalization, and validity checks. ### Parameters - **input** (&str) - The raw title string to parse. - **config** (&SiteConfig) - The site configuration used for namespace resolution. ### Returns - **Result** - A Result containing the parsed Title or a TitleError if parsing fails. ``` -------------------------------- ### pub fn target(&self) -> &Title Source: https://docs.rs/wikioxide/0.1.0/wikioxide/struct.Redirect.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Retrieves the target of the redirect. ```APIDOC ## pub fn target(&self) -> &Title ### Description Returns the target of the redirect as a reference to a Title object. ### Signature `pub fn target(&self) -> &Title` ``` -------------------------------- ### Retrieving template calls Source: https://docs.rs/wikioxide/0.1.0/wikioxide/struct.ExpandedDocument.html?search= Returns the top-level template calls as written in the source. ```rust pub fn template_calls(&self) -> &[TemplateCall] ``` -------------------------------- ### ExistenceRecord Struct Definition Source: https://docs.rs/wikioxide/0.1.0/wikioxide/struct.ExistenceRecord.html?search= The core data structure used to track page existence and category visibility. ```rust pub struct ExistenceRecord { pub exists: bool, pub hidden_category: Option, } ``` -------------------------------- ### Retrieving module invocations Source: https://docs.rs/wikioxide/0.1.0/wikioxide/struct.ExpandedDocument.html?search= Returns the list of {{#invoke:}} calls encountered during the expansion process. ```rust pub fn modules(&self) -> &[ModuleInvocation] ``` -------------------------------- ### Retrieving display title Source: https://docs.rs/wikioxide/0.1.0/wikioxide/struct.ExpandedDocument.html?search= Returns the effective {{DISPLAYTITLE:}} if defined. ```rust pub fn display_title(&self) -> Option<&str> ``` -------------------------------- ### Title::parse Source: https://docs.rs/wikioxide/0.1.0/wikioxide/struct.Title.html?search=u32+-%3E+bool Parses and normalizes a title string based on the provided SiteConfig, handling namespace resolution and character normalization. ```APIDOC ## pub fn parse(input: &str, config: &SiteConfig) -> Result ### Description Parses and normalizes a title the way MediaWiki does: whitespace/underscore unification, bidi-mark stripping, namespace-prefix resolution against `config`, first-letter capitalization, and validity checks. ### Parameters - **input** (&str) - The raw title string to parse. - **config** (&SiteConfig) - The site configuration used for namespace resolution. ``` -------------------------------- ### WikitextParser::expand Source: https://docs.rs/wikioxide/0.1.0/wikioxide/struct.WikitextParser.html Parses wikitext with full template expansion. ```APIDOC ## pub fn expand(&self, wikitext: &str, ctx: &PageContext) -> ExpandOutcome ### Description Parses wikitext while resolving transclusions, arguments, and parser functions. If templates are missing, it may return an ExpandOutcome::MissingTemplates status. ### Parameters - **wikitext** (&str) - The raw wikitext string to parse. - **ctx** (&PageContext) - The context of the page being parsed. ### Returns - **ExpandOutcome** - The result of the expansion process. ``` -------------------------------- ### Parse wikitext into Discussion Source: https://docs.rs/wikioxide/0.1.0/wikioxide/discussion/struct.Discussion.html Parses signed comments from raw wikitext using the provided site configuration. ```rust pub fn from_wikitext(wikitext: &str, config: &SiteConfig) -> Discussion ``` -------------------------------- ### Namespace struct definition Source: https://docs.rs/wikioxide/0.1.0/wikioxide/struct.Namespace.html?search= The primary structure used to represent a MediaWiki namespace. ```rust pub struct Namespace(/* private fields */); ``` -------------------------------- ### PageContext::for_title Source: https://docs.rs/wikioxide/0.1.0/wikioxide/struct.PageContext.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Creates a new PageContext instance for the specified page title. ```APIDOC ## pub fn for_title(title: Title) -> Self ### Description Initializes a new context for parsing a given page. This context is used to track the page's title for features like self-link detection. ### Parameters - **title** (Title) - Required - The title of the page to be parsed. ``` -------------------------------- ### Define Redirect struct Source: https://docs.rs/wikioxide/0.1.0/wikioxide/struct.Redirect.html?search= The definition of the Redirect struct with private fields. ```rust #[non_exhaustive] pub struct Redirect { /* private fields */ } ``` -------------------------------- ### Retrieve comments from Discussion Source: https://docs.rs/wikioxide/0.1.0/wikioxide/discussion/struct.Discussion.html Returns a slice of all comments in the order they appear in the source. ```rust pub fn comments(&self) -> &[Comment] ``` -------------------------------- ### Retrieving titles needing existence checks Source: https://docs.rs/wikioxide/0.1.0/wikioxide/struct.ExpandedDocument.html?search= Returns titles that required an #ifexist check during parsing. ```rust pub fn titles_needing_existence(&self) -> &[Title] ``` -------------------------------- ### ExistenceMap::get Source: https://docs.rs/wikioxide/0.1.0/wikioxide/struct.ExistenceMap.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Retrieves the existence record for a given title. ```APIDOC ### pub fn get(&self, title: &Title) -> Option Returns the fact recorded for `title`, if it exists. ``` -------------------------------- ### NamespaceDef Struct Definition Source: https://docs.rs/wikioxide/0.1.0/wikioxide/struct.NamespaceDef.html?search= The primary structure used to define a namespace for SiteConfigBuilder. ```rust pub struct NamespaceDef { pub id: i32, pub canonical: String, pub localized: String, pub aliases: Vec, pub first_letter: bool, } ``` -------------------------------- ### InMemoryTemplateStore::insert Source: https://docs.rs/wikioxide/0.1.0/wikioxide/struct.InMemoryTemplateStore.html Records that a specific title exists with the provided wikitext. ```APIDOC ## pub fn insert(&self, title: Title, wikitext: impl Into>) ### Description Records that the given `title` exists and associates it with the provided `wikitext`. ### Parameters - **title** (Title) - The title of the page. - **wikitext** (impl Into>) - The content of the page. ``` -------------------------------- ### FixedClock::new Source: https://docs.rs/wikioxide/0.1.0/wikioxide/struct.FixedClock.html?search=std%3A%3Avec Creates a new instance of FixedClock that always reports the provided timestamp. ```APIDOC ## pub const fn new(at: Timestamp) -> Self ### Description Creates a new FixedClock instance that is frozen at the specified timestamp. ### Parameters - **at** (Timestamp) - Required - The fixed time to be reported by the clock. ``` -------------------------------- ### FixedClock::new Source: https://docs.rs/wikioxide/0.1.0/wikioxide/struct.FixedClock.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Creates a new FixedClock instance that always reports the provided timestamp. ```APIDOC ## pub const fn new(at: Timestamp) -> Self ### Description Creates a new clock that always reports the specified `at` timestamp. This is useful for ensuring reproducible results during tests or when using golden fixtures. ### Parameters - **at** (Timestamp) - Required - The fixed timestamp the clock will return. ``` -------------------------------- ### FixedClock::new Source: https://docs.rs/wikioxide/0.1.0/wikioxide/struct.FixedClock.html?search= Creates a new instance of FixedClock that will always report the provided timestamp. ```APIDOC ## pub const fn new(at: Timestamp) -> Self ### Description Creates a new FixedClock instance that always returns the specified `at` timestamp. ### Parameters - **at** (Timestamp) - Required - The fixed timestamp the clock will report. ``` -------------------------------- ### InMemoryTemplateStore::len Source: https://docs.rs/wikioxide/0.1.0/wikioxide/struct.InMemoryTemplateStore.html Returns the number of cached entries. ```APIDOC ## pub fn len(&self) -> usize ### Description Returns the total number of cached entries, including both present pages and verified-missing pages. ### Returns - **usize** - The count of entries. ``` -------------------------------- ### ExistenceMap::insert Source: https://docs.rs/wikioxide/0.1.0/wikioxide/struct.ExistenceMap.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Records an existence fact for a specific title. ```APIDOC ### pub fn insert(&mut self, title: Title, record: ExistenceRecord) Records a fact for the provided `title`. ``` -------------------------------- ### InMemoryTemplateStore Definition Source: https://docs.rs/wikioxide/0.1.0/wikioxide/struct.InMemoryTemplateStore.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E The primary structure definition for the in-memory template cache. ```rust pub struct InMemoryTemplateStore { /* private fields */ } ``` -------------------------------- ### PageContext Definition Source: https://docs.rs/wikioxide/0.1.0/wikioxide/struct.PageContext.html?search= The primary structure definition for PageContext. ```rust pub struct PageContext { /* private fields */ } ```