Skip to main content

MarkdownRenderer

Struct MarkdownRenderer 

Source
pub struct MarkdownRenderer { /* private fields */ }

Implementations§

Source§

impl MarkdownRenderer

Source

pub fn render_arg(&self, arg: &SpecArg) -> Result<String, UsageErr>

Source§

impl MarkdownRenderer

Source§

impl MarkdownRenderer

Source

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

Source

pub fn render_flag(&self, flag: &SpecFlag) -> Result<String, UsageErr>

Source§

impl MarkdownRenderer

Source

pub fn new(spec: Spec) -> Self

Source

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.

Source

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.

Source

pub fn with_header_level(self, header_level: usize) -> Self

Source

pub fn with_multi(self, index: bool) -> Self

Source

pub fn with_url_prefix<S: Into<String>>(self, url_prefix: S) -> Self

Source

pub fn with_html_encode(self, html_encode: bool) -> Self

Source

pub fn with_replace_pre_with_code_fences( self, replace_pre_with_code_fences: bool, ) -> Self

Source§

impl MarkdownRenderer

Trait Implementations§

Source§

impl Clone for MarkdownRenderer

Source§

fn clone(&self) -> MarkdownRenderer

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 Debug for MarkdownRenderer

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
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.