Struct Args

Source
pub struct Args {
Show 16 fields pub input: String, pub debug: bool, pub flag_colon: bool, pub flag_enclose_table: bool, pub flag_extract_links: bool, pub flag_extract_links_without_anchor: bool, pub flag_google_list_style: bool, pub flag_semicolon: bool, pub flag_parenthesis: bool, pub flag_pretty_table: bool, pub flag_strip_enclosed_url: bool, pub flag_whitespace_around_bold_font: bool, pub flag_italic_to_bold_font: bool, pub print_config: bool, pub compact_output: bool, pub debug_markdown_tag_pair: bool,
}
Expand description

根据命令行的输入内容,生成相应的配置选项,用于调整 Markdowon Formatter 的行为。

Fields§

§input: String

需要处理的 Markdown 源文件路径

§debug: bool

调试标志位,将输出每一个可能的中间值

§flag_colon: bool

中文冒号转为英文冒号+空格,“:” => “: ”

§flag_enclose_table: bool

表格的每一行两端使用 |

§flag_extract_links: bool

从段落提取链接用于填充在段末或文章结尾

§flag_extract_links_without_anchor: bool

提取链接时去掉锚点部分

§flag_google_list_style: bool

使用 Google 风格的 List 缩进,参见 https://google.github.io/styleguide/docguide/style.html

§flag_semicolon: bool

中文分号转为英文分号+空格,“;” => “; ”

§flag_parenthesis: bool

中文括号转为英文括号+空格,“()” => “ () ”,将根据上下文去除多余的空格

§flag_pretty_table: bool

以相同列宽展示表格中的每一列

§flag_strip_enclosed_url: bool

去除 内部的非必要空格

§flag_whitespace_around_bold_font: bool

加粗文字前后使用空格,“abc” => “a b c”,将根据上下文去除多余的空格

§flag_italic_to_bold_font: bool

斜体字更改为加粗文字,“abc” => “abc”

§print_config: bool

是否需要在开始格式化之前输出相应的配置

§compact_output: bool

输出配置时使用紧凑的布局

§debug_markdown_tag_pair: bool

执行 Markdown 模块的函数时输出成对的 Tag

Implementations§

Source§

impl Args

Source

pub fn parse(args: Vec<String>) -> Option<Self>

解析命令行选项和参数

§Arguments
  • args - 来自命令行或认为构建的选项
Source

pub fn set_flavor_hugging_face_wechat(&mut self)

使用 Hugging Face 微信公众号的风格

Source

pub fn print_config(&self)

打印所有风格选项

Trait Implementations§

Source§

impl Debug for Args

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Args

§

impl RefUnwindSafe for Args

§

impl Send for Args

§

impl Sync for Args

§

impl Unpin for Args

§

impl UnwindSafe for Args

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