Struct sile::cli::Cli

source ·
pub struct Cli {
Show 15 fields pub input: Option<Vec<PathBuf>>, pub backend: Option<String>, pub class: Option<String>, pub debug: Option<Vec<String>>, pub evaluate: Option<Vec<String>>, pub evaluate_after: Option<Vec<String>>, pub fontmanager: Option<String>, pub makedeps: Option<PathBuf>, pub output: Option<PathBuf>, pub option: Option<Vec<String>>, pub preamble: Option<Vec<PathBuf>>, pub postamble: Option<Vec<PathBuf>>, pub use: Option<Vec<String>>, pub quiet: bool, pub traceback: bool,
}
Expand description

The SILE Typesetter reads input file(s) and typesets the content into a rendered document format, typically PDF.

By default, input files may be in declarative SIL markup, structured XML, or programmatic Lua. The input format is automatically detected by the active modules. By default, the output will be a file with the same name as the first input file with the extension changed to .pdf. The output filename can be overridden with the --output argument. Using --backend one can change to a different output format (or a different driver for the same format). Additional input or output formats can be handled by loading a 3rd party module that supports them by adding --use argument on the command line (which will load prior to attempting to read input documents).

Fields§

§input: Option<Vec<PathBuf>>

Input document filename(s), by default in SIL, XML, or Lua formats.

One or more input files from which to process content. The first listed file is considered the master document, others are procced in sequence. Other inputter formats may be enabled via--use. Use - to read a content stream from STDIN.

§backend: Option<String>

Specify the output backend.

The default is libtexpdf and suitible for most PDF output. Alternatives supported out of the box include text, debug, dummy, cairo, and podofo. Other outputters may be enabled via --use.

§class: Option<String>

Override the default or specified document class.

The default class for documents that do not specify one in the root tag is plain. This can be used to either change the default class or to override the class actually specified in a document. Other bundled classes include base, bible, book, diglot, docbook, docbook, jbook, jplain, letter, pecha, tbook, tplain, and triglot. Others will be loaded dynamically from the module path.

§debug: Option<Vec<String>>

Show debug information for tagged aspects of SILE’s operation.

Multiple debug flags may be given as a comma separated list. While packages may define their own debug flags, the most commonly used ones are typesetter, pagebuilder, vboxes, break, frames, profile, and versions. May be specified more than once.

§evaluate: Option<Vec<String>>

Evaluate Lua expression before processing input.

May be specified more than once.

§evaluate_after: Option<Vec<String>>

Evaluate Lua expression after processing input.

May be specified more than once.

§fontmanager: Option<String>

Specify which font manager to use.

The font manager is responsible for discovering the locations on font files on the system given a font name. The default font manager is fontconfig on non-macOS systems and macfonts on macOS.

§makedeps: Option<PathBuf>

Generate a Makefile format list of dependencies and white them to a file.

This tracks all the files (input files, Lua libraries, fonts, images, etc.) use during the typesetting process. After completion, the list is written to FILE in the format of a dependency list for a target in a Makefile. This can be used later to determine if a PDF needs re-rendering based on whether any inputs have changed.

§output: Option<PathBuf>

Explicitly set the output file name.

By default the basename of the first input file will be used as the output filename. An extension will be chosen based on the output backend, typically .pdf. With this option any arbitrary name and path can be given. Additionally - can be used to write the output to STDOUT.

§option: Option<Vec<String>>

Set or override document class options.

Can be used to change default options or override the ones specified in a document. For example setting --option papersize=letter would override both the default papersize of A4 and any specific one set in the document’s options. May be specified more than once.

§preamble: Option<Vec<PathBuf>>

Include the contents of a SIL, XML, or other resource file before the input document content.

The value should be a full filename with a path relative to PWD or an absolute path. May be specified more than once.

§postamble: Option<Vec<PathBuf>>

Include the contents of a SIL, XML, or other resource file after the input document content.

The value should be a full filename with a path relative to PWD or an absolute path. May be specified more than once.

§use: Option<Vec<String>>

Load and initialize a class, inputter, shaper, or other module before processing the main input.

The value should be a loadable module name (with no extension, using . as a path separator) and will be loaded using SILE’s module search path. Options may be passed to the module by enclosing key=value pairs in square brackets following the module name. This is particularly useful when the input document is not SIL or a natively recognized XML scheme and SILE needs to be taught new tricks before even trying to read the input file. If the module is a document class, it will replace plain as the default class for processing documents that do not specifically identify one to use. Because this executes before loading the document, it may even add an input parser or modify an existing one to support new file formats. Package modules will be added to the preamble to be loaded after the class is initialized. May be specified more than once.

§quiet: bool

Suppress warnings and informational messages during processing.

§traceback: bool

Display detailed location trace on errors and warnings.

Trait Implementations§

source§

impl Args for Cli

source§

fn group_id() -> Option<Id>

Report the [ArgGroup::id][crate::ArgGroup::id] for this set of arguments
source§

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

Append to [Command] so it can instantiate Self via [FromArgMatches::from_arg_matches_mut] Read more
source§

fn augment_args_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§

impl CommandFactory for Cli

source§

fn command<'b>() -> Command

Build a [Command] that can instantiate Self. Read more
source§

fn command_for_update<'b>() -> Command

Build a [Command] that can update self. Read more
source§

impl Debug for Cli

source§

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

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

impl FromArgMatches for Cli

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( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
source§

impl Parser for Cli

§

fn parse() -> Self

Parse from std::env::args_os(), [exit][Error::exit] on error.
§

fn try_parse() -> Result<Self, Error>

Parse from std::env::args_os(), return Err on error.
§

fn parse_from<I, T>(itr: I) -> Self
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Parse from iterator, [exit][Error::exit] on error.
§

fn try_parse_from<I, T>(itr: I) -> Result<Self, Error>
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Parse from iterator, return Err on error.
§

fn update_from<I, T>(&mut self, itr: I)
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Update from iterator, [exit][Error::exit] on error. Read more
§

fn try_update_from<I, T>(&mut self, itr: I) -> Result<(), Error>
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Update from iterator, return Err on error.

Auto Trait Implementations§

§

impl Freeze for Cli

§

impl RefUnwindSafe for Cli

§

impl Send for Cli

§

impl Sync for Cli

§

impl Unpin for Cli

§

impl UnwindSafe for Cli

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

impl<T> MaybeSend for T