Struct crowbook::book::Book [] [src]

pub struct Book {
    pub lang: String,
    pub author: String,
    pub title: String,
    pub description: Option<String>,
    pub subject: Option<String>,
    pub cover: Option<String>,
    pub output_epub: Option<String>,
    pub output_html: Option<String>,
    pub output_pdf: Option<String>,
    pub output_tex: Option<String>,
    pub output_odt: Option<String>,
    pub temp_dir: String,
    pub chapters: Vec<(Number, Vec<Token>)>,
    pub numbering: bool,
    pub autoclean: bool,
    pub nb_char: char,
    pub numbering_template: String,
    pub verbose: bool,
    pub tex_command: String,
    pub tex_links_as_footnotes: bool,
    pub tex_template: Option<String>,
    pub epub_css: Option<String>,
    pub epub_template: Option<String>,
    pub epub_version: u8,
    pub html_template: Option<String>,
    pub html_css: Option<String>,
}

Fields

lang: String author: String title: String description: Option<String> subject: Option<String> cover: Option<String> output_epub: Option<String> output_html: Option<String> output_pdf: Option<String> output_tex: Option<String> output_odt: Option<String> temp_dir: String chapters: Vec<(Number, Vec<Token>)> numbering: bool autoclean: bool nb_char: char numbering_template: String verbose: bool tex_command: String tex_links_as_footnotes: bool tex_template: Option<String> epub_css: Option<String> epub_template: Option<String> epub_version: u8 html_template: Option<String> html_css: Option<String>

Methods

impl Book
[src]

fn new() -> Book

fn println(&self, s: &str)

Prints to stderr

fn debug(&self, s: &str)

Prints to stderr but only if verbose is set to true

fn new_from_file(filename: &str, verbose: bool) -> Result<Book>

Creates a new book from a file

This method also changes the current directory to the one of this file

fn get_mapbuilder(&self, format: &str) -> MapBuilder

Returns a MapBuilder, to be used (and completed) for templating

fn get_cleaner(&self) -> Option<Box<Cleaner>>

Return a Box corresponding to the appropriate cleaning method, or None

fn get_header(&self, n: i32, title: &str) -> Result<String>

Returns the string corresponding to a number, title, and the numbering template

fn set_from_config(&mut self, s: &str) -> Result<()>

Sets options according to configuration file

A line with "option: value" sets the option to value + chapter_name.md adds the (default numbered) chapter - chapter_name.md adds the (unnumbered) chapter 3. chapter_name.md adds the (custom numbered) chapter

fn render_pdf(&self) -> Result<()>

Render book to pdf according to book options

fn render_epub(&self) -> Result<()>

Render book to epub according to book options

fn render_odt(&self) -> Result<()>

Render book to odt according to book options

fn render_html<T: Write>(&self, f: &mut T) -> Result<()>

Render book to html according to book options

fn render_tex<T: Write>(&self, f: &mut T) -> Result<()>

Render book to pdf according to book options

fn render_all(&self) -> Result<()>

Generates output files acccording to book options

fn add_chapter(&mut self, number: Number, file: &str) -> Result<()>

File: location of the file for this chapter

fn get_template(&self, template: &str) -> Result<Cow<'static, str>>

Returns the template (default or modified version)

Trait Implementations

impl Debug for Book
[src]

fn fmt(&self, __arg_0: &mut Formatter) -> Result

Formats the value using the given formatter.