pub struct WikitextSettings {
pub mode: WikitextMode,
pub layout: Layout,
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: WikitextMode
What mode we’re running in.
layout: Layout
What layout we’re targeting.
For instance, generating Wikidot’s legacy HTML structure.
enable_page_syntax: bool
Whether page-contextual syntax is permitted.
This currently refers to:
- Include
- Module
- Table of Contents
- Button
use_include_compatibility: bool
Whether a literal [[include]]
is permitted.
If this is true, then [[include]]
is treated as an alias
for [[include]]
, which is necessary for Wikidot compatibility.
It is off by default.
use_true_ids: bool
Whether 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: bool
Whether 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: bool
Whether to minify CSS in <style>
blocks.
allow_local_paths: bool
Whether 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: InterwikiSettings
What 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
Sourcepub fn from_mode(mode: WikitextMode, layout: Layout) -> Self
pub fn from_mode(mode: WikitextMode, layout: Layout) -> Self
Returns the default settings for the given WikitextMode
.
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 for WikitextSettings
impl PartialEq for WikitextSettings
Source§impl Serialize for WikitextSettings
impl Serialize for WikitextSettings
impl Eq for WikitextSettings
impl StructuralPartialEq for WikitextSettings
Auto Trait Implementations§
impl Freeze for WikitextSettings
impl RefUnwindSafe for WikitextSettings
impl Send for WikitextSettings
impl Sync for WikitextSettings
impl Unpin for WikitextSettings
impl UnwindSafe for WikitextSettings
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more