Skip to main content

MdAction

Enum MdAction 

Source
pub enum MdAction {
    ReplaceSection {
        file: String,
        heading: String,
        stdin: bool,
        content: Option<String>,
    },
    InsertAfterHeading {
        file: String,
        heading: String,
        stdin: bool,
        content: Option<String>,
    },
    InsertAfterSection {
        file: String,
        heading: String,
        stdin: bool,
        content: Option<String>,
    },
    InsertBeforeHeading {
        file: String,
        heading: String,
        stdin: bool,
        content: Option<String>,
    },
    UpsertBullet {
        file: String,
        heading: String,
        bullet: String,
    },
    DedupeHeadings {
        file: String,
    },
    LintAgents {
        file: String,
    },
    TableAppend {
        file: String,
        heading: String,
        row: String,
    },
    MoveSection {
        file: String,
        heading: String,
        to: Option<String>,
        before: Option<String>,
        after: Option<String>,
    },
}

Variants§

§

ReplaceSection

Replace a heading section body (until next same-or-higher heading).

Nested lower-level headings under the match are included (e.g. # Intro owns following ## sections until the next #). Prefer peer-level headings when sibling sections must survive.

Fields

§file: String

Markdown file to edit.

§heading: String

Heading of the section to replace (e.g. ## Unreleased).

§stdin: bool

Read replacement content from stdin.

§content: Option<String>

Replacement content as argument.

§

InsertAfterHeading

Insert content immediately after a heading line (before existing body).

Does not insert after the full section body. For a sibling section after the section ends, use insert-after-section (#1726).

Fields

§file: String

Markdown file to edit.

§heading: String

Heading line to insert under (e.g. ## Config).

§stdin: bool

Read insertion content from stdin instead of --content.

§content: Option<String>

Content to insert (omit when using --stdin).

§

InsertAfterSection

Insert content after the full section body (sibling placement).

Use when adding a new ## section after this section’s content. Prefer insert-after-heading only for content under the heading (e.g. intro before a table). #1726

Fields

§file: String

Markdown file to edit.

§heading: String

Heading whose section body ends just before the insertion point.

§stdin: bool

Read insertion content from stdin instead of --content.

§content: Option<String>

Content to insert (omit when using --stdin).

§

InsertBeforeHeading

Insert content immediately before a heading line.

Alias insert-before-section: a section starts at its heading, so sibling-before-section placement is the same as before-heading (symmetry with insert-after-section / insert-after-heading).

Fields

§file: String

Markdown file to edit.

§heading: String

Heading line to insert before (e.g. ## Config).

§stdin: bool

Read insertion content from stdin instead of --content.

§content: Option<String>

Content to insert (omit when using --stdin).

§

UpsertBullet

Add a bullet under a heading if not already present.

Fields

§file: String

Markdown file to edit.

§heading: String

Heading under which to upsert the bullet (e.g. ## Rules).

§bullet: String

Bullet text (leading - is optional). Alias --content matches sibling md mutators (#1839).

§

DedupeHeadings

Remove later whole sections with a duplicate heading (level+text).

Drops heading and body until the next same-or-higher heading; unique content under the second heading is not kept.

Fields

§file: String

Markdown file to scan for duplicate headings.

§

LintAgents

Lint common AGENTS.md problems.

Fields

§file: String

AGENTS.md (or similar) file to lint.

§

TableAppend

Append a row to a markdown table under a heading.

Fields

§file: String

Markdown file containing the table.

§heading: String

Heading above the target table (e.g. ## API).

§row: String

Table row: | col1 | col2 | or compact col1|col2 / col1 | col2.

§

MoveSection

Move a heading section to a new location (same file or different file).

Fields

§file: String

Source file containing the section to move.

§heading: String

Heading of the section to move (e.g., “## FAQ”).

§to: Option<String>

Destination file. Omit for same-file reorder.

§before: Option<String>

Insert before this heading at the destination.

§after: Option<String>

Insert after this heading at the destination.

Trait Implementations§

Source§

impl Debug for MdAction

Source§

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

Formats the value using the given formatter. Read more
Source§

impl FromArgMatches for MdAction

Source§

fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Source§

fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Source§

fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

fn update_from_arg_matches_mut<'b>( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

impl Subcommand for MdAction

Source§

fn augment_subcommands<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate Self via FromArgMatches::from_arg_matches_mut Read more
Source§

fn augment_subcommands_for_update<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate self via FromArgMatches::update_from_arg_matches_mut Read more
Source§

fn has_subcommand(__clap_name: &str) -> bool

Test whether Self can parse a specific subcommand

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

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more