Skip to main content

HeadingInputs

Struct HeadingInputs 

Source
pub struct HeadingInputs<'a> {
    pub file_path: &'a str,
    pub frontmatter_title: Option<&'a str>,
    pub body_markdown: &'a str,
    pub root_folder_name: Option<&'a str>,
    pub is_home_override: bool,
    pub slot_only: bool,
}
Expand description

Inputs to the heading rule.

Fields§

§file_path: &'a str§frontmatter_title: Option<&'a str>

Frontmatter title: value verbatim. None is “field missing” (filename-mode); Some(""), Some(" ") is “explicitly empty” (Title source, invisible).

§body_markdown: &'a str

Raw markdown body (post-frontmatter). Used to detect a leading :::hero block — when present, the hero owns the heading slot and the auto-injected H1 is suppressed regardless of title.

§root_folder_name: Option<&'a str>

The project’s root folder name (the user’s vault directory basename). Used as a fallback for self-named-folder-note detection when the file is at the project root: <root>/<root>.md and <root>/index.md both render the project’s homepage, but Path::parent() returns the empty path for root-level files, so the path-based check can’t see the folder name. Editor and pipeline both pass the basename of the open project folder. Pass None if unknown (filename detection still catches index.md / README.md / language-suffixed indexes).

§is_home_override: bool

true iff the file is promoted to its folder’s home via the home: true frontmatter marker (issue #587). Pipeline-only input; editor passes false.

§slot_only: bool

true iff the file is a layout-slot source (e.g. root footer.md) rather than an article. Slot files are embedded as fragments into a surrounding layout; the auto-injected <h1 class="moss-article-title"> would render as an unwanted heading inside that fragment. PR7b (moss#599) replaces the pre-2026-05-28 frontmatter-synthesis hack (title: "" injected at the call site to drive empty_title=true) with this structural input. Editor passes false.

Trait Implementations§

Source§

impl<'a> Clone for HeadingInputs<'a>

Source§

fn clone(&self) -> HeadingInputs<'a>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Copy for HeadingInputs<'a>

Source§

impl<'a> Debug for HeadingInputs<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for HeadingInputs<'a>

§

impl<'a> RefUnwindSafe for HeadingInputs<'a>

§

impl<'a> Send for HeadingInputs<'a>

§

impl<'a> Sync for HeadingInputs<'a>

§

impl<'a> Unpin for HeadingInputs<'a>

§

impl<'a> UnsafeUnpin for HeadingInputs<'a>

§

impl<'a> UnwindSafe for HeadingInputs<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.