pub trait Format: DynClone + Debug + Send + Sync + Serialize + Deserialize {
// Required methods
fn extension(&self) -> &str;
fn template_prefix(&self) -> &str;
fn name(&self) -> &str;
fn no_parse(&self) -> bool;
fn renderer(&self) -> Box<dyn DocumentRenderer>;
fn include_resources(&self) -> bool;
fn use_layout(&self) -> bool;
}
Expand description
Implementors define a format. This trait should make format extensions easy to implement.
Required Methods§
sourcefn template_prefix(&self) -> &str
fn template_prefix(&self) -> &str
Template format name. Useful if templates are reused across formats as is the case for notebooks which use markdown.
sourcefn name(&self) -> &str
fn name(&self) -> &str
Format name that is used in status messages, build output and in the configuration file.
sourcefn no_parse(&self) -> bool
fn no_parse(&self) -> bool
Return true if the format should not be parsed. This may be removed in the future and is currently only used for the info format which exports all parsed contents in a project.
sourcefn renderer(&self) -> Box<dyn DocumentRenderer>
fn renderer(&self) -> Box<dyn DocumentRenderer>
Return a renderer instance. Currently does not allow for configuration.
sourcefn include_resources(&self) -> bool
fn include_resources(&self) -> bool
Determines whether non-source files should be copied to
fn use_layout(&self) -> bool
Trait Implementations§
source§impl<'de> Deserialize<'de> for Box<dyn Format>
impl<'de> Deserialize<'de> for Box<dyn Format>
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>,
Deserialize this value from the given Serde deserializer. Read more
source§impl<'de> Deserialize<'de> for Box<dyn Format + Send>
impl<'de> Deserialize<'de> for Box<dyn Format + Send>
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>,
Deserialize this value from the given Serde deserializer. Read more
source§impl<'de> Deserialize<'de> for Box<dyn Format + Send + Sync>
impl<'de> Deserialize<'de> for Box<dyn Format + Send + Sync>
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>,
Deserialize this value from the given Serde deserializer. Read more
source§impl<'de> Deserialize<'de> for Box<dyn Format + Sync>
impl<'de> Deserialize<'de> for Box<dyn Format + Sync>
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>,
Deserialize this value from the given Serde deserializer. Read more