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

146 Commits

Author SHA1 Message Date
Elisabeth Henry
b310d762c5 Improve the way --help is displayed 2016-03-01 18:46:42 +01:00
Elisabeth Henry
6e99258062 Set book's path when creating with new_from_markdown_file
This should allow a single markdown file to link to e.g. a cover file
and still be rendered correctly even if crowbook is called from
another directory.
2016-03-01 18:28:49 +01:00
Elisabeth Henry
7be4af4264 Add option --single to the binary
This option allows Crowbook to parse a single MarkDown file,
defaulting to hide the chapters' headings. This should allow to get
ride of `.book` file for short stories.

Resolves: #2, #3
2016-03-01 17:43:40 +01:00
Elisabeth Henry
61f4dabff5 Add Book::new_from_markdown_file method
This method allows to create a book from a single markdown file.
2016-03-01 17:36:47 +01:00
Elisabeth Henry
05cb43bc1d Update libs/tests/book.rs to use real YAML multiline syntax 2016-03-01 17:28:31 +01:00
Elisabeth Henry
9a181f9663 Parse book configuration file with yaml-rust
The first part of a `.book` file, setting book options, is now parsed
as true YAML by the yaml-rust library instead of using a custom
parser.
2016-03-01 17:23:03 +01:00
Elisabeth Henry
0a39bee213 Make Book parse inline yaml blocks, not just ignoring them. 2016-03-01 16:00:43 +01:00
Elisabeth Henry
98517c243b Make Book::remove_yaml issues a warning when yaml block isn't valid
Previously, it was a debug message, but since it is probable the user
would actually want this to be seen as YAML it's better if the message
is more visible.
2016-03-01 15:42:27 +01:00
Elisabeth Henry
ae2f43193c Make BookOptions::set returns the previous option, if already set
This way, it is possible to display a debug message or a warning when
an option is overriden with a new setting.
2016-03-01 15:33:24 +01:00
Elisabeth Henry
6dd8a970d5 Move BookOptions to its own module, bookoptions.rs 2016-03-01 15:09:50 +01:00
Elisabeth Henry
c23b353d2c Use yaml_rust for BookOptions
`BookOptions` now internally uses the yaml_rust library. This should
not change much for an end-user perspective, but should make easy to
allow to configure a `Book` with a YAML block inside a markdown file.

Since the "old" Crowbooks's config format was similar, but somewhat
different, to markdown, this might cause some bugs,
though. Particularly, strings should now be escaped with "" in some
casess (e.g. if it contains special characters). On the other hand, it
*allows* to optionally espace a string with these quotes, which wasn't
possible until then and might be useful in some cases.
2016-03-01 15:01:25 +01:00
Elisabeth Henry
8b8d847a7d Consider it is a YAML block only if first line is at the beginning of a
doc or preceded by an empty line, to avoid the case where
Foo
---

Bar
---

gets counted as a YAML block. The only ambiguous case left is if you had wanted to make two rules,
but can easily be avoided by using either *** for rules, or by using more dashes.
2016-03-01 04:02:49 +01:00
Elisabeth Henry
fa5393641b Crowbook now ignores YAML blocks (i.e., delimited by two lines containing ---, must contain valid YAML) in Markdown files 2016-03-01 01:28:36 +01:00
Elisabeth Henry
67bc26aaa8 made more clear in debug mode that what is printed is the output of latex/zip command 2016-02-29 01:52:26 +01:00
Elisabeth Henry
e6343dd1b7 improved warning messages 2016-02-29 01:47:49 +01:00
Elisabeth Henry
127bdae1e5 crowbook no longer crash if it cannot create file specified with --output 2016-02-29 01:39:10 +01:00
Elisabeth Henry
2cb67068c6 book.render_all now does error checking internally and runs all renderer even if first one fails 2016-02-29 01:32:30 +01:00
Elisabeth Henry
9125fa370f added --debug option 2016-02-29 00:44:48 +01:00
Elisabeth Henry
48a672c024 adaptating verbose status to Logger 2016-02-29 00:36:45 +01:00
Elisabeth Henry
2563d997c3 use Logger struct and removed book.debug/println 2016-02-28 17:11:11 +01:00
Elisabeth Henry
31dc190fe0 started working on logger struct 2016-02-28 15:23:26 +01:00
Elisabeth Henry
1d53e9772e Add hidden titles to the toc even if the heading is not displayed inline 2016-02-27 15:04:35 +01:00
Elisabeth Henry
cbbabf11e9 moved book options handling to a separate struct, BookOptions 2016-02-27 13:52:43 +01:00
Elisabeth Henry
5ec5924a50 renamed resource.rs to resource_handler.rs 2016-02-27 12:52:25 +01:00
Elisabeth Henry
c216feff99 html renderer now passes validator 2016-02-27 04:48:17 +01:00
Elisabeth Henry
dc6498801a removed debugging println 2016-02-27 04:41:29 +01:00
Elisabeth Henry
a523789435 local images now work for pdf and epub outputs 2016-02-27 04:35:38 +01:00
Elisabeth Henry
4e25d5eddb EPUB can now embed local images 2016-02-27 03:51:57 +01:00
Elisabeth Henry
b9844663f5 main.rs: fixed bug 2016-02-27 02:57:55 +01:00
Elisabeth Henry
63dd7ec7f9 latex renderer also transform local links 2016-02-27 00:06:25 +01:00
Elisabeth Henry
1a227ff0be epub renderer now correctly displays unnumbered chapters without a number 2016-02-26 23:34:58 +01:00
Elisabeth Henry
d8683054da Epub renderer now correctly converts links to .md files used for the book to inner link in epub document 2016-02-26 23:23:25 +01:00
Elisabeth Henry
4ff7c28f69 html renderer now converts links to .md files used in the book to inner references 2016-02-26 23:17:48 +01:00
Elisabeth Henry
e8846117f2 started working on a way to get links to .md files working, but it's gonna be a long road 2016-02-26 22:41:30 +01:00
Elisabeth Henry
9ee9e4958d cleaned a bit (hum) book.rs 2016-02-26 19:11:16 +01:00
Elisabeth Henry
8175812f36 added zip.command to book options 2016-02-26 18:51:13 +01:00
Elisabeth Henry
bd2971ab61 no longer change current directory, as it generated problems in multithreaded envs 2016-02-26 17:33:33 +01:00
Elisabeth Henry
f855d74db6 continued documentation 2016-02-26 04:21:20 +01:00
Elisabeth Henry
158142c32e book.rs: added documentation 2016-02-26 02:45:21 +01:00
Elisabeth Henry
d2da852bc0 html, odt: either made methods private or (for html) hide them for the docs 2016-02-26 02:08:06 +01:00
Elisabeth Henry
0b0da0092e code cleaning and improving documentation 2016-02-26 01:49:38 +01:00
Elisabeth Henry
38433292d5 improved documentation of parser.rs 2016-02-26 00:51:35 +01:00
Elisabeth Henry
bd25114bd4 moved token, cleaner and parser public again 2016-02-26 00:19:19 +01:00
Elisabeth Henry
3381c5d078 added unit test for book 2016-02-26 00:17:03 +01:00
Elisabeth Henry
d21dbc529e module cleaner is now private 2016-02-26 00:02:09 +01:00
Elisabeth Henry
2991099ecd modules token and parser are now private 2016-02-25 23:59:33 +01:00
Elisabeth Henry
7aba577347 made escape a private mod and added some tests 2016-02-25 23:50:10 +01:00
Elisabeth Henry
d513a03703 moved tests/toc.rs inside src/lib so module toc can be private 2016-02-25 23:33:54 +01:00
Elisabeth Henry
a2afa21dbf fixed french cleaner, now uses em space after — 2016-02-25 21:47:42 +01:00
Elisabeth Henry
c600207d21 force latex not to overflow page 2016-02-25 19:56:18 +01:00