Commit Graph

209 Commits

Author SHA1 Message Date
apatniv
3c97525743 Clippy lint: Remove unnecessary clone 2020-12-31 15:18:37 -05:00
Vivek Bharath Akupatni
a3d4febe3e
Provide useful feedback if user executes command in different folder (#1407)
Provides better feedback if user executes in a different folder than what is expected by mdbook

After the changes `mdbook build`
```
2020-12-19 14:27:35 [ERROR] (mdbook::utils): Error: Couldn't open SUMMARY.md in "/Users/vicky/rust/source_codes/mdbook_testing/src/src" directory
2020-12-19 14:27:35 [ERROR] (mdbook::utils):    Caused By: No such file or directory (os error 2)
```

Previously: `mdbook build`
```
2020-12-19 14:28:46 [ERROR] (mdbook::utils): Error: Couldn't open SUMMARY.md
2020-12-19 14:28:46 [ERROR] (mdbook::utils):    Caused By: No such file or directory (os error 2)
```
2020-12-27 12:45:11 -08:00
apatniv
ef993e8cc2 Run rust formmater 2020-12-05 20:27:03 -05:00
apatniv
a3a5386da0 Add more context regarding which missing file creation failed 2020-12-05 20:17:45 -05:00
Eric Huss
643d5ecc5c
Merge pull request #1285 from FrankHB/patch-1
Handled UTF-8 BOM
2020-11-10 14:02:01 -08:00
FrankHB
9e9cf49c50 Added a test.
Signed-off-by: FrankHB <frankhb1989@gmail.com>
2020-10-07 22:50:25 +08:00
FrankHB
780fb979a0 Avoided the redundant allocation.
Signed-off-by: FrankHB <frankhb1989@gmail.com>
2020-09-29 18:01:06 +08:00
Ross MacArthur
e0b247e9d6 Add config option to disable print html, css, and icon 2020-09-22 11:40:02 -07:00
Eric Huss
fd59dc73e5
Adjust wording 2020-09-06 09:11:53 -07:00
Gus Wynn
5ea8e55aea collect all test failures before failing 2020-09-03 18:36:51 -07:00
Evian-Zhang
9d5c454e47 delete '+' replacement and use cargo fmt to format 2020-08-08 15:13:22 +08:00
Evian-Zhang
60be20a783 allow space in SUMMARY.md's link destination 2020-08-03 09:49:01 +08:00
Érico Rolim
dcf9462d1e summary: turn SoftBreak events into spaces.
Summary items that had their name split into two lines ended up with the
last word of one line and the first word of the next line glued
together, since a space wasn't added.

Added test case for it.

Fixes #1218
2020-07-29 15:53:27 -03:00
FrankHB
65d9eb6f7e
Handled UTF-8 BOM
Fixed #1155 .
2020-07-25 13:02:44 +08:00
Eric Huss
4699269e49 Add SVG favicon. 2020-06-23 10:58:10 -07:00
Eric Huss
6c4c3448e3
Update dependencies. (#1211)
* Removed the itertools dependency

* Removed an unused feature flag

* Stubbed out a toml_query replacement

* Update dependencies.

* Bump env_logger.

* Use warp instead of iron for http server.

Iron does not appear to be maintained anymore. warp/hyper seems to be
reasonably maintained. Unfortunately this takes a few seconds more
to compile, but shouldn't be too bad.

One benefit is that there is no longer a need for a separate websocket
port, which makes it easier to run multiple servers at once.

* Update pulldown-cmark to 0.7

* Switch from error-chain to anyhow.

* Bump MSRV to 1.39.

* Update elasticlunr-rs.

Co-authored-by: Michael Bryan <michaelfbryan@gmail.com>
2020-05-20 23:32:00 +02:00
mark
d0fe9bd41c make part titles another SummaryItem 2020-05-18 11:18:14 -05:00
mark
91e3aa4b55 try to satisfy msrv? 2020-05-17 16:53:06 -05:00
mark
5dd2a5bff4 implement support for book parts 2020-05-17 16:53:06 -05:00
Mathieu David
43008ef2ef fix issues from code review 2020-05-10 09:04:02 -07:00
Mathieu David
d605938886 Bring back draft chapters 2020-05-10 09:04:02 -07:00
Eric Huss
c44ef1b2f0 Fix some clippy warnings. 2020-05-10 08:29:50 -07:00
kngwyu
255756cfee Make new [rust] config and move edition config under it 2020-04-21 10:24:47 -07:00
Gabriel Majeri
d39d4517aa Add support for Rust edition 2020-04-21 10:24:47 -07:00
Dylan DPC
59568208ff
Revert "Support anchors in SUMMARY (#1173)" (#1175)
This reverts commit 2baed040c2.
2020-03-24 23:52:24 +01:00
Martin Carton
2baed040c2
Support anchors in SUMMARY (#1173)
* Parse anchors in `SUMMARY.md`

* Support sub-links in SUMMARY with html renderer

* Add some tests for anchors
2020-03-24 19:15:28 +01:00
dalance
b82562fe8a Fix SUMMARY's parse_numbered with comment 2020-03-18 12:28:27 +09:00
Michael Bryan
730d7f8410
Exposed the execute_build_process() method to 3rd parties 2019-11-17 20:59:55 +08:00
Marcus Klaas de Vries
2a3088422a Upgrade pulldown_cmark to 0.6.1 2019-11-11 20:25:38 +01:00
Dylan DPC
1f505c2b2e
Revert "Add support for Rust edition 2018 in playpens (#1086)" (#1093)
This reverts commit a7b3aa0444.
2019-11-11 13:24:13 +01:00
Gabriel Majeri
a7b3aa0444 Add support for Rust edition 2018 in playpens (#1086)
* Add support for Rust edition 2018 in playpens

* Add Rust edition support to rustdoc

* Run rustfmt

* Fix enum variant reference
2019-11-11 12:42:24 +01:00
Steve Klabnik
f79d5d4582 rust-lang-nursery -> rust-lang
Fixes #1080
2019-10-29 08:04:16 -05:00
Carol (Nichols || Goulding)
a873d46871 Implement a markdown renderer (#1018)
Use case: when trying to `mdbook test` a file that has many `include`
directives, and a test fails, the line numbers in the `rustdoc` output
don't match the line numbers in the original markdown file.

Turning on the markdown renderer implemented here lets you see what is
being passed to `rustdoc` by saving the markdown after the preprocessors
have run.

This renderer could be helpful for debugging many preprocessors, but
it's probably not useful in the general case, so it's turned off by
default.
2019-08-30 12:20:53 +02:00
Michael Bryan
bb412edf53
Made sure the tests pass 2019-07-21 04:32:28 +08:00
Michael Bryan
d1b5a8f982
The MDBook::build() method no longer cleans the renderer's build directory 2019-07-21 02:35:18 +08:00
Jeremy Stucki
92a7b0cdcd
Use iterator instead of for loop 2019-06-20 15:12:56 +02:00
Eric Huss
07830f7f11
Merge pull request #891 from integer32llc/include-before-test
Write preprocessed content to file before testing with rustdoc
2019-06-12 15:01:58 -07:00
Eric Huss
3cfed10098 Update to pulldown-cmark 0.5. (#898)
* Update to pulldown-cmark 0.4.1.

* Update to pulldown-cmark 0.5.2.

* Remove pulldown-cmark-to-cmark dependency.

Since it is not compatible with the new pulldown-cmark. This example isn't
directly usable, anyways, and I think the no-op example sufficiently shows how
to make a preprocessor.

* cargo fmt

* Fix example link.
2019-06-11 18:26:24 +02:00
lzutao
53ba0d6655 Remove 'static lifetime from static vars (#947) 2019-05-31 18:01:02 +02:00
Lzu Tao
672cf456eb Remove unnecessary ::<crate>
Find and replace with `git grep -E '\W::[a-z]'` command.
2019-05-30 23:12:33 +07:00
lzutao
8542f7f29d Transition to 2018 edition (#933)
* Transition to 2018 edition

* Update Travis CI badge in README

* Remove non-idiomatic `extern crate` lines
2019-05-25 20:50:41 +02:00
Allen
df12cc55c8 Revert "Merge pull request #889 from s3bk/master" (#917)
* Revert "Merge pull request #889 from s3bk/master"

This reverts commit b30b58b565, reversing
changes made to c6220fba83.

* format tests :P
2019-05-09 20:18:28 +02:00
Bas Bossink
506996808b Fix issue 832 (#841)
* Add if around stub summary creation

Check if an existing SUMMARY.md is present to prevent overwriting it
with the stub SUMMARY.md.

[#832]

* Add test for existing SUMMARY.md
2019-05-08 21:13:20 +02:00
lzutao
581187098c Deny 2018 edition idioms globally (#911) 2019-05-06 22:50:34 +02:00
lzutao
ab7802a9a9 Fix most of clippy warnings (#914)
* Fix clippy: cast_lossless

* Fix clippy: match_ref_pats

* Fix clippy: extra_unused_lifetimes

* Fix clippy: needless_lifetimes

* Fix clippy: new_without_default

* Fix clippy: or_fun_call

* Fix clippy: should_implement_trait

* Fix clippy: redundant_closure

* Fix clippy: const_static_lifetime

* Fix clippy: redundant_pattern_matching

* Fix clippy: unused_io_amount

* Fix clippy: string_lit_as_bytes

* Fix clippy: needless_update

* Fix clippy: blacklisted_name

* Fix clippy: collapsible_if

* Fix clippy: match_wild_err_arm

* Fix clippy: single_match

* Fix clippy: useless_vec

* Fix clippy: single_char_pattern

* Fix clippy: float_cmp

* Fix clippy: approx_constant
2019-05-06 20:20:58 +02:00
Lzu Tao
0aa3a9045a cargo fmt 2019-05-05 22:00:24 +07:00
Dylan DPC
b30b58b565
Merge pull request #889 from s3bk/master
new "Book" theme
2019-05-04 17:45:37 +02:00
Dylan DPC
7e26a8430d
Update mod.rs 2019-05-03 19:59:58 +02:00
Dylan DPC
f01fe854fa
Merge pull request #883 from anp/custom_summary
Expose API for building a book with a custom Summary.
2019-04-30 00:25:03 +02:00
Carol (Nichols || Goulding)
d7c7d91005
Write preprocessed content to file before testing with rustdoc
Fixes #855.
2019-03-23 08:35:44 -04:00