Struct term_transcript::svg::TemplateOptions
source · pub struct TemplateOptions {
pub width: usize,
pub palette: Palette,
pub additional_styles: String,
pub font_family: String,
pub window_frame: bool,
pub scroll: Option<ScrollOptions>,
pub wrap: Option<WrapOptions>,
pub line_numbers: Option<LineNumbers>,
}
svg
only.Expand description
Configurable options of a Template
.
Fields§
§width: usize
Width of the rendered terminal window in pixels. The default value is 720
.
palette: Palette
Palette of terminal colors. The default value of Palette
is used by default.
additional_styles: String
CSS instructions to add at the beginning of the SVG <style>
tag. This is mostly useful
to import fonts in conjunction with font_family
.
The value is not validated in any way, so supplying invalid CSS instructions can lead to broken SVG rendering.
font_family: String
Font family specification in the CSS format. Should be monospace.
window_frame: bool
Indicates whether to display a window frame around the shell. Default value is false
.
scroll: Option<ScrollOptions>
Options for the scroll animation. If set to None
(which is the default),
no scrolling will be enabled, and the height of the generated image is not limited.
wrap: Option<WrapOptions>
Text wrapping options. The default value of WrapOptions
is used by default.
line_numbers: Option<LineNumbers>
Line numbering options.
Implementations§
source§impl TemplateOptions
impl TemplateOptions
sourcepub fn render_data<'s>(
&'s self,
transcript: &'s Transcript
) -> Result<HandlebarsData<'s>, TermError>
pub fn render_data<'s>( &'s self, transcript: &'s Transcript ) -> Result<HandlebarsData<'s>, TermError>
Generates data for rendering.
Errors
Returns an error if output cannot be rendered to HTML (e.g., it contains invalid SGR sequences).
Trait Implementations§
source§impl Clone for TemplateOptions
impl Clone for TemplateOptions
source§fn clone(&self) -> TemplateOptions
fn clone(&self) -> TemplateOptions
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for TemplateOptions
impl Debug for TemplateOptions
source§impl Default for TemplateOptions
impl Default for TemplateOptions
source§impl<'de> Deserialize<'de> for TemplateOptions
impl<'de> Deserialize<'de> for TemplateOptions
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Auto Trait Implementations§
impl RefUnwindSafe for TemplateOptions
impl Send for TemplateOptions
impl Sync for TemplateOptions
impl Unpin for TemplateOptions
impl UnwindSafe for TemplateOptions
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere T: Any,
§fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.