1
0
mirror of https://github.com/lise-henry/crowbook synced 2024-09-29 20:41:24 +02:00
Commit Graph

305 Commits

Author SHA1 Message Date
Elisabeth Henry
42ef79876a Update book_example/config.md 2016-03-07 01:56:38 +01:00
Elisabeth Henry
c5ed1ab8d7 Add output.html_dir in config.book 2016-03-06 02:50:04 +01:00
Elisabeth Henry
6def2e40f4 Update ChangeLog 2016-03-06 02:48:53 +01:00
Elisabeth Henry
f42ace238c Add html.script option to specify javascript file to use
Also, various templates use this value instead of hard-coding the
javascript code (and duplicating it three times).
2016-03-06 02:35:11 +01:00
Elisabeth Henry
ee44d57de1 Update Changelog 2016-03-05 23:15:59 +01:00
Elisabeth Henry
40c35b39c7 Add links to previous and next chapter in HtmlDirRenderer 2016-03-05 23:10:06 +01:00
Elisabeth Henry
f381f7159e Update .gitignore 2016-03-05 22:34:41 +01:00
Elisabeth Henry
a145d78cf5 Add image support for HtmlDirRenderer 2016-03-05 22:33:30 +01:00
Elisabeth Henry
21ec13a79a Add (not yet complete) HtmlDirRenderer
For rendering a multiple-files HTML in a directory, in `output.html_dir`.
2016-03-05 22:02:27 +01:00
Elisabeth Henry
fd31be67d7 Add templates for html_dir output 2016-03-05 20:35:11 +01:00
Elisabeth Henry
4f33cbf381 Update ChangeLog 2016-03-05 18:36:08 +01:00
Elisabeth Henry
11919333ae Make EPUB renderer read resources.base_path.files when writing embedded files 2016-03-05 18:34:53 +01:00
Elisabeth Henry
af734beb1a Fix displaying of book options to not crash anymore
Displaying should be worked on, though.
2016-03-05 18:14:05 +01:00
Elisabeth Henry
fae0aef7d4 Fix Epub renderer which still used resources.path 2016-03-05 18:09:25 +01:00
Elisabeth Henry
5676b5ad43 Update ChangeLog 2016-03-05 18:05:33 +01:00
Elisabeth Henry
2aa1139baf Rename book options base_path* to resources.base_path*
This is to ensure a bit more consistency in the ways options are named
and grouped.

Also added a (not very satisfying) way to warn that an option that is
being used is deprecated and should be replaced with the new one.
2016-03-05 18:02:45 +01:00
Elisabeth Henry
3e818d1a2e Make Zipper check that a path is in temporary dir before writing the file 2016-03-05 15:35:41 +01:00
Elisabeth Henry
f382c92ed9 Make code a bit more rustic applying clippy's advices 2016-03-05 14:53:41 +01:00
Elisabeth Henry
e28dc05087 Update program documentation 2016-03-05 03:15:42 +01:00
Elisabeth Henry
e14dccd04d Update dependencies versions 2016-03-05 00:36:48 +01:00
Elisabeth Henry
8ec49959b1 State in Changelog.md that it depends on rustc>=1.7.0 2016-03-05 00:36:37 +01:00
Elisabeth Henry
1b3c398267 Require Rust 1.7.0 in appveyor.yml 2016-03-05 00:26:27 +01:00
Elisabeth Henry
1e7557398b Allow resources.files to specify directories
Use walkdir crate to walk in all files.
2016-03-04 22:22:01 +01:00
Elisabeth Henry
9980739ed4 Make Error::Render contain a String instead of a &'static str
Also, more errors that should theoretically not happened have been
turned to panic!s
2016-03-04 19:26:23 +01:00
Elisabeth Henry
14f659e4bb Add support for embedding additional files in EPUB document
This is done with the `resources.files` options. These files will be
placed in the `resources.path` directory in the EPUB.

Solves #6
2016-03-04 18:30:34 +01:00
Elisabeth Henry
7c2bb73bb1 Add resources.path and resources.files options 2016-03-04 18:04:52 +01:00
Elisabeth Henry
3229af9a8f Remove unused import in epub.rs 2016-03-04 18:03:09 +01:00
Elisabeth Henry
39cebebd5c Use mime_guess library to guess mime types from extension
EPUB renderer needs to specify a mime type for each file in the
manifest. For images, it previously used a simple function which only
worked currently on png, jpg and gif extensions. Using this library
should be more reliable.

It is also a first step in adressing #6.
2016-03-04 17:41:24 +01:00
Elisabeth Henry
568fe89511 Fix a typo in lib.rs documentation 2016-03-03 21:19:02 +01:00
Elisabeth Henry
6109570ccf Deny missing docs 2016-03-03 21:14:32 +01:00
Elisabeth Henry
54ca041d5a Clean Book constructors API
- Book::new takes an additional `options` parameter.
- Book::new_from_file_with_options becomes `new_from_file`, which got
  deleted.

This way, each constructor takes an `options` parameter (which can
be set to `&[]` for default options), allowing derived constructors to
not replicate the setting options code.
2016-03-03 20:56:28 +01:00
Elisabeth Henry
e197b82add Remove Bugs.md file 2016-03-03 18:26:07 +01:00
Elisabeth Henry
cc7747f20f Fix typos in ChangeLog.md 2016-03-03 18:23:28 +01:00
Elisabeth Henry
d0a491c332 Use github's issue tracker instead of maintaining a Bugs.md file 2016-03-03 18:13:23 +01:00
Elisabeth Henry
b58b73eb02 Render CSS differently according to lang
This is currently only used to display "–" for list items if lang is
set to "fr", and to default bullets otherwise, but it is now possible
to add more variations.
2016-03-03 17:57:38 +01:00
Elisabeth Henry
7b93cb4479 Bump preventively version to 0.5.0-unreleased for semantic versioning 2016-03-03 17:40:38 +01:00
Elisabeth Henry
4b22f9a339 Add enable_yaml_mode option
This option activates or disables the parsing of YAML block. If
disabled, YAML blocks will be ignored and won't be used to try to set
Crowbook's options.

enable_yaml_mode is false by defaut, but set to true when crowbook is
called with `--single`.
2016-03-02 20:38:35 +01:00
Elisabeth Henry
f561cf855d Add babel correspondences to more languages codes 2016-03-02 18:37:45 +01:00
Elisabeth Henry
981a8fab07 Fix typo in helpers.rs 2016-03-02 16:54:10 +01:00
Elisabeth Henry
1ad7a5d847 Set book options before parsing chapters
When run with --set, Crowbook now sets book options before chapters
are set. This allows to set book_path (or its variants) with --set
(previously it had no effect because it was only in place after the
chapters were parsed.)

Should fix #5.
2016-03-02 16:40:03 +01:00
Elisabeth Henry
7af8e1b633 Update ChangeLog.md 2016-03-02 04:10:59 +01:00
Elisabeth Henry
38a0656f9f Add new option tex.short
This option makes LaTeX uses the article class instead of book, and
uses the default \maketitle command for it. This option is set to
false by default, but automatically enabled when runned with
--single.

(This commit also fixes a bug for path resolution when crowbook
is runned in single. Thiss should have been a separate commit, ooops.)

Resolves: #3
2016-03-02 03:58:42 +01:00
Elisabeth Henry
e1aab90f11 Fix indentation in templates/template.html 2016-03-02 03:57:57 +01:00
Elisabeth Henry
0495791072 Fix commentary indentation in book.rs 2016-03-02 02:33:40 +01:00
Elisabeth Henry
d0f006f81d Add base_path, base_path.links and base_path.images options
By default, links are computed relatively to the Markdown file that
uses them. Setting `base_path` allows to override this behaviour: in
this case, links will be relative to this path.

`base_path` sets the paths both for images and links, but it is
possible to set them independently, respectively with base_path.images
and base_path.links. Note that if base_path is set, these two options
won't be looked at.

Should fix issue #5.
2016-03-02 02:12:23 +01:00
Elisabeth Henry
bc459cfd3b Bump version preventively to 0.4.1-unreleased 2016-03-02 01:42:15 +01:00
Elisabeth Henry
3a5f16a94a Bump version to 0.4.0 v0.4.0 2016-03-01 21:51:14 +01:00
Elisabeth Henry
aa6cc9f3a7 Update documentation 2016-03-01 21:41:23 +01:00
Elisabeth Henry
690cdb76ac Hide --list-options-md from the --help message 2016-03-01 21:25:49 +01:00
Elisabeth Henry
7ca0b8f26a Clean help message 2016-03-01 20:29:11 +01:00