pub struct MarkdownRenderer { /* private fields */ }Implementations§
Source§impl MarkdownRenderer
impl MarkdownRenderer
pub fn render_cmd(&self, cmd: &SpecCommand) -> Result<String, UsageErr>
Source§impl MarkdownRenderer
impl MarkdownRenderer
Sourcepub fn render_config(&self) -> Result<String, UsageErr>
pub fn render_config(&self) -> Result<String, UsageErr>
The settings reference for a spec’s config block.
Empty string when there is nothing to say, so a caller can concatenate it without checking — a CLI with no settings should not grow a blank section.
Source§impl MarkdownRenderer
impl MarkdownRenderer
pub fn new(spec: Spec) -> Self
Sourcepub fn config_page(&self) -> &'static str
pub fn config_page(&self) -> &'static str
The file name the settings page gets in --multi mode.
One name, always. settings.md was the obvious choice and the wrong one: mise has a
settings command, whose own page lands there, and config is written second — so for
the very CLI this feature is aimed at, the command’s page was silently replaced and the
index linked both entries to the same file.
Choosing between two names by whether a command is in the way would fix that and
introduce something worse: the name would move when a command is added or removed
between runs, leaving the abandoned one behind as a stale page nothing links but the
docs site still serves. A fixed name cannot do that, and configuration is a name CLIs
give to a file, not to a command — the command is called config.
Sourcepub fn config_page_collision(&self) -> Option<&str>
pub fn config_page_collision(&self) -> Option<&str>
A visible top-level command whose own page would be written to Self::config_page.
Vanishingly unlikely, and silence is what made the settings.md collision hard to see,
so the one case left is reported rather than guessed at.
pub fn with_header_level(self, header_level: usize) -> Self
pub fn with_multi(self, index: bool) -> Self
pub fn with_url_prefix<S: Into<String>>(self, url_prefix: S) -> Self
pub fn with_html_encode(self, html_encode: bool) -> Self
pub fn with_replace_pre_with_code_fences( self, replace_pre_with_code_fences: bool, ) -> Self
Source§impl MarkdownRenderer
impl MarkdownRenderer
pub fn render_spec(&self) -> Result<String, UsageErr>
pub fn render_index(&self) -> Result<String, UsageErr>
Trait Implementations§
Source§impl Clone for MarkdownRenderer
impl Clone for MarkdownRenderer
Source§fn clone(&self) -> MarkdownRenderer
fn clone(&self) -> MarkdownRenderer
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for MarkdownRenderer
impl RefUnwindSafe for MarkdownRenderer
impl Send for MarkdownRenderer
impl Sync for MarkdownRenderer
impl Unpin for MarkdownRenderer
impl UnsafeUnpin for MarkdownRenderer
impl UnwindSafe for MarkdownRenderer
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,
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