pub struct JfmDocument {
pub frontmatter: JfmFrontmatter,
pub body: String,
}Expand description
A JFM document consisting of YAML frontmatter and a markdown body.
Fields§
§frontmatter: JfmFrontmatterParsed frontmatter metadata fields.
body: StringRaw markdown body (not parsed — passed through to/from ADF conversion).
Implementations§
Source§impl JfmDocument
impl JfmDocument
Sourcepub fn parse(input: &str) -> Result<Self>
pub fn parse(input: &str) -> Result<Self>
Parses a JFM document from a string.
Expects the format: ---\n<yaml frontmatter>\n---\n<markdown body>
Sourcepub fn render(&self) -> Result<String>
pub fn render(&self) -> Result<String>
Renders the document back to a string with YAML frontmatter and markdown body.
Sourcepub fn split_custom_sections(&self) -> (String, Vec<CustomFieldSection>)
pub fn split_custom_sections(&self) -> (String, Vec<CustomFieldSection>)
Splits the body into the primary markdown and any trailing custom-field sections emitted by the custom-field-aware read path.
Non-destructive — returns owned strings and leaves self.body
unchanged so render() continues to produce a lossless round-trip.
Trait Implementations§
Source§impl Clone for JfmDocument
impl Clone for JfmDocument
Source§fn clone(&self) -> JfmDocument
fn clone(&self) -> JfmDocument
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for JfmDocument
impl RefUnwindSafe for JfmDocument
impl Send for JfmDocument
impl Sync for JfmDocument
impl Unpin for JfmDocument
impl UnsafeUnpin for JfmDocument
impl UnwindSafe for JfmDocument
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
Mutably borrows from an owned value. Read more