pub struct RunOptions {
pub link_pos: ReferencePlacement,
pub footnote_pos: Option<ReferencePlacement>,
pub link_format: LinkTransform,
pub renumber_footnotes: bool,
pub output: OutputFormat,
pub wrap_width: Option<usize>,
pub quiet: bool,
pub allow_unknown_markdown: bool,
pub add_breaks: Option<bool>,
pub selectors: String,
pub markdown_file_paths: Vec<String>,
}Expand description
Options analogous to the mdq CLI’s switches.
Fields§
§link_pos: ReferencePlacementWhere to put link references.
For links and images of style [description][1], this flag controls where to put the [1]: https://example.com
definition.
footnote_pos: Option<ReferencePlacement>Where to put footnote references. Defaults to be same as –link-pos
link_format: LinkTransform§renumber_footnotes: bool§output: OutputFormatSpecifies the output format. Defaults to markdown.
wrap_width: Option<usize>The number of characters to wrap text at. This is only valid when the output format is markdown.
Certain elements (like section headings and link definitions) will never be wrapped, and the wrapping will never break a word; it will only ever be along existing whitespace. In particular, this means the wrapping will never add hyphens, and it will never break URLs.
quiet: boolQuiet: do not print anything to stdout. The exit code will still be 0 if any elements match, and non-0 if none do.
allow_unknown_markdown: bool§add_breaks: Option<bool>Include breaks between elements in plain and markdown output mode.
For plain, this will add a blank line between elements. For markdown, this will add a thematic break (“—–”) between elements.
This has no effect in JSON output mode.
This defaults to true for Markdown output, and false for plain text output.
This is analogous to the --[no-]br option in the CLI arguments.
selectors: StringThe selectors string
markdown_file_paths: Vec<String>An optional list of Markdown files to parse, by path. If not provided, standard input will be used.
If these are provided, mdq will act as if they were all concatenated into a single file. For example, if you use –link-pos=doc, the link definitions for all input files will be at the very end of the output.
A path of “-” represents standard input.
If these are provided, standard input will not be used unless one of the arguments is “-”. Files will be processed in the order you provide them. If you provide the same file twice, mdq will process it twice, unless that file is “-”; all but the first “-” paths are ignored.
Implementations§
Source§impl RunOptions
impl RunOptions
pub fn should_add_breaks(&self) -> bool
Trait Implementations§
Source§impl Clone for RunOptions
impl Clone for RunOptions
Source§fn clone(&self) -> RunOptions
fn clone(&self) -> RunOptions
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more