Struct ftml::settings::WikitextSettings
source · pub struct WikitextSettings {
pub mode: WikitextMode,
pub enable_page_syntax: bool,
pub use_include_compatibility: bool,
pub use_true_ids: bool,
pub isolate_user_ids: bool,
pub minify_css: bool,
pub allow_local_paths: bool,
pub interwiki: InterwikiSettings,
}Expand description
Settings to tweak behavior in the ftml parser and renderer.
Fields§
§mode: WikitextModeWhat mode we’re running in.
enable_page_syntax: boolWhether page-contextual syntax is permitted.
This currently refers to:
- Include
- Module
- Table of Contents
- Button
use_include_compatibility: boolWhether a literal [[include]] is permitted.
If this is true, then [[include]] is treated as an alias
for [[include-messy]], which is necessary for Wikidot compatibility.
It is off by default.
use_true_ids: boolWhether IDs should have true values, or be excluded or randomly generated.
In the latter case, IDs can be used for navigation, for instance
the table of contents, but setting this to true is needed in any
context where more than one instance of rendered wikitext could be emitted.
isolate_user_ids: boolWhether to prefix user IDs with u-.
This is a behavior found in Wikidot (although implemented incompletely)
which prefixes IDs in HTML elements provided by the user with u- to ensure
isolation.
minify_css: boolWhether to minify CSS in <style> blocks.
allow_local_paths: boolWhether local paths are permitted.
This should be disabled in contexts where there is no “local context” to which these paths could be interpreted. For instance, on pages you can reference an attached file, but on an arbitrary forum thread no such file can exist.
This applies to:
- Files
- Images
interwiki: InterwikiSettingsWhat interwiki prefixes are supported.
All instances of $$ in the destination URL are replaced with the link provided
in the interwiki link. For instance, [wikipedia:SCP_Foundation SCP Wiki], then
$$ will be replaced with SCP_Foundation.
Notes
- These are matched case-sensitively.
- Prefixes may not contain colons, they are matched up to the first colon, and any beyond that are considered part of the link.
- By convention, prefixes should be all-lowercase.
Implementations§
source§impl WikitextSettings
impl WikitextSettings
pub fn from_mode(mode: WikitextMode) -> Self
Trait Implementations§
source§impl Clone for WikitextSettings
impl Clone for WikitextSettings
source§fn clone(&self) -> WikitextSettings
fn clone(&self) -> WikitextSettings
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for WikitextSettings
impl Debug for WikitextSettings
source§impl<'de> Deserialize<'de> for WikitextSettings
impl<'de> Deserialize<'de> for WikitextSettings
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
source§impl PartialEq<WikitextSettings> for WikitextSettings
impl PartialEq<WikitextSettings> for WikitextSettings
source§fn eq(&self, other: &WikitextSettings) -> bool
fn eq(&self, other: &WikitextSettings) -> bool
self and other values to be equal, and is used
by ==.