pub struct GridShortcode {
pub columns: u32,
pub ratio: Option<String>,
pub classes: String,
pub cells: Vec<Vec<Block>>,
pub width: Option<String>,
}Expand description
Arguments for Shortcode::Grid.
Fields§
§columns: u32Column count. Defaults to 1 when neither positional nor cols=
attribute is provided.
ratio: Option<String>Optional ratio string like "1:2" or "1:1:2". When present, the
renderer emits it as a custom property —
style="--moss-grid-ratio:minmax(0, 1fr) minmax(0, 2fr)" — which the
stylesheet reads. Never as an inline grid-template-columns: that
outranks every rule, so the mobile single-column collapse could not
reach a ratio grid.
cols=1:2:3 is equivalent to setting both columns (count = 3)
and ratio to "1:2:3".
classes: StringExtra CSS classes for the wrapping <div> (from {.foo .bar}).
cells: Vec<Vec<Block>>Each cell’s parsed block content. Phase 4 PR4.5 (2026-05-28)
promoted this from Vec<String> (raw markdown source) to
Vec<Vec<Block>> (fully-typed AST). Nested shortcodes inside a
cell (::::buttons in :::grid) extract through
crate::ast::parser::parse recursion in
[crate::ast::shortcode_extract::parse_grid].
Compound-link cells (the SoCiviC [![[poster]] ### Title ...](/url)
pattern, where the entire cell is wrapped in a markdown link that
spans block-level inner content) are represented as a single-element
vec![Block::LinkCard { url, children }]. See
Block::LinkCard for the rationale.
width: Option<String>Spec § P9 width attribute: body | wide | page | screen (with
full aliased to screen). None means the author did not set
a width — the emitter omits data-width so the HTML stays sparse.
Trait Implementations§
Source§impl Clone for GridShortcode
impl Clone for GridShortcode
Source§fn clone(&self) -> GridShortcode
fn clone(&self) -> GridShortcode
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for GridShortcode
impl Debug for GridShortcode
Source§impl Default for GridShortcode
impl Default for GridShortcode
Source§fn default() -> GridShortcode
fn default() -> GridShortcode
Source§impl<'de> Deserialize<'de> for GridShortcode
impl<'de> Deserialize<'de> for GridShortcode
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>,
impl Eq for GridShortcode
Source§impl PartialEq for GridShortcode
impl PartialEq for GridShortcode
Source§impl Serialize for GridShortcode
impl Serialize for GridShortcode
impl StructuralPartialEq for GridShortcode
Auto Trait Implementations§
impl Freeze for GridShortcode
impl RefUnwindSafe for GridShortcode
impl Send for GridShortcode
impl Sync for GridShortcode
impl Unpin for GridShortcode
impl UnsafeUnpin for GridShortcode
impl UnwindSafe for GridShortcode
Blanket Implementations§
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.