1
0
mirror of https://github.com/lise-henry/crowbook synced 2024-11-18 00:13:55 +01:00

--print-template is now usable with --set epub.version 3

This commit is contained in:
Elisabeth Henry 2016-02-25 15:52:46 +01:00
parent 30262ebc07
commit fd15da13df
2 changed files with 29 additions and 3 deletions

@ -146,8 +146,33 @@ will override the book title to `Bar` and its author to `Foo`.
Displays all the valid options to use either in a book configuration
file or with `--set`, with a short description. There is also
`--list-options-md`, which outputs markdown, giving the following
result:
`--list-options-md`, which outputs markdown.
`--print-template`
------------------
**usage**: `crowbook --print-template template`
Prints to stdout the built-in template. Useful if you want to
customize the appearance of your document. E.g., if you want to modify
the CSS used for HTML rendering:
```
$ crowbook --print-template html.css > my_style.css
# edit my_style.css in your favourite editor
$ crowbook my.book --set html.css my_style.css
# or add "html.css: my_style.css" in my.book
```
Note that it is possible to use this option in conjonction with
`--set`, though it is currently only useful for EPUB template:
```
$ crowbook --print-template epub.template --set epub.version 2
# Returns the template for Epub 2 (default one)
$ crowbook --print-template epub.template --set epub.version 3
# Returns the template for Epub 3
```
`--verbose`

@ -99,7 +99,8 @@ fn main() {
if matches.is_present("print-template") {
let template = matches.value_of("print-template").unwrap();
let book = Book::new();
let mut book = Book::new();
set_book_options(&mut book, &matches);
let result = book.get_template(template.as_ref());
match result {
Ok(s) => {