pub struct MarkdownDocument { /* private fields */ }Expand description
Represents a markdown document with validation capabilities
Implementations§
Source§impl MarkdownDocument
impl MarkdownDocument
Sourcepub fn load<P: AsRef<Path>>(path: P) -> Result<Self, DocError>
pub fn load<P: AsRef<Path>>(path: P) -> Result<Self, DocError>
Load a markdown document from a file
Sourcepub fn has_compliance_labels(&self) -> bool
pub fn has_compliance_labels(&self) -> bool
Check if document has all required compliance labels
Sourcepub fn missing_labels(&self) -> Vec<String>
pub fn missing_labels(&self) -> Vec<String>
Get missing compliance labels
Sourcepub fn fix_compliance_labels(&mut self) -> Result<bool, DocError>
pub fn fix_compliance_labels(&mut self) -> Result<bool, DocError>
Fix compliance labels by adding missing ones
Sourcepub fn has_trailing_whitespace(&self) -> bool
pub fn has_trailing_whitespace(&self) -> bool
Check for trailing whitespace
Sourcepub fn fix_trailing_whitespace(&mut self) -> Result<bool, DocError>
pub fn fix_trailing_whitespace(&mut self) -> Result<bool, DocError>
Fix trailing whitespace
Sourcepub fn has_long_lines(&self) -> bool
pub fn has_long_lines(&self) -> bool
Check for long lines
Sourcepub fn fix_long_lines(&mut self) -> Result<bool, DocError>
pub fn fix_long_lines(&mut self) -> Result<bool, DocError>
Fix long lines by wrapping them
Auto Trait Implementations§
impl Freeze for MarkdownDocument
impl RefUnwindSafe for MarkdownDocument
impl Send for MarkdownDocument
impl Sync for MarkdownDocument
impl Unpin for MarkdownDocument
impl UnwindSafe for MarkdownDocument
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
Converts
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>
Converts
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