Commit Graph

63 Commits

Author SHA1 Message Date
Matt Ickstadt 5835da2432 Run rustfmt 2018-07-23 12:47:04 -05:00
Matt Ickstadt b2ad669c61 Search with Elasticlunr, updated (#604)
* Add search with elasticlunr.js

This commit adds search functionality to mdBook, based on work done by @phaiax. The in-browser search code uses elasticlunr.js to execute the search, using an index generated at book build time by elasticlunr-rs.

* Add generator comment
Someone on Reddit was wondering how the rust book was generated and said they checked the source. Thought I'd put this here. Might be a good idea to have a little footer "made with mdBook", but this'll do for now.

* Remove search/editor file override behavior

* Use for loop for book iterator

* Improve HTML regex

* Fix search CORS in file URIs

* Use ammonia to sanitize HTML

* Filter html5ever log messages
2018-03-07 21:02:06 +08:00
Dylan Maccora 38c883e1ef Changing clap settings (#624) 2018-02-18 15:10:47 +08:00
Bulat Musin 0bc1030a02 implement `clean` subcommand (#583) 2018-02-04 21:00:29 +08:00
Michael Bryan fd7e8d1b7b
Add support for alternative backends (#507)
* Added a mechanism for creating alternate backends

* Added a CmdRenderer and the ability to have multiple renderers

* Made MDBook::load() autodetect renderers

* Added a couple methods to RenderContext

* Converted RenderContext.version to a String

* Made sure all alternate renderers are invoked as `mdbook-*`

* Factored out the logic for determining which renderer to use

* Added tests for renderer detection

* Made it so `mdbook test` works on the book-example again

* Updated the "For Developers" docs

* Removed `[output.epub]` from the example book's book.toml

* Added a bit more info on how backends should work

* Added a `destination` key to the RenderContext

* Altered how we wait for an alternate backend to finish

* Refactored the Renderer trait to not use MDBook and moved livereload to the template

* Moved info for developers out of the book.toml format chapter

* MOAR docs

* MDBook::build() no longer takes &mut self

* Replaced a bunch of println!()'s with proper log macros

* Cleaned up the build() method and backend discovery

* Added a couple notes and doc-comments

* Found a race condition when backends exit really quickly

* Added support for backends with arguments

* Fixed a funny doc-comment
2018-01-07 22:10:48 +08:00
Michael Bryan e74c376833
You need to call `rx.iter()` to iterate over events from a channel (#522) 2018-01-03 19:32:49 +08:00
Michael Bryan cba16a0083
Updated dependencies and made logging more readable 2017-12-30 18:43:46 +08:00
Michael Bryan ebcf41c25b
Improved error messages using error_chain::ChainedError::display_chain() 2017-12-11 11:42:36 +11:00
Anna Liao 5ce05a79be updated links from azerupi to rust-lang-nursery (#489) 2017-11-22 11:35:18 +01:00
Pratik Karki 382fc4139b run rustfmt on the repository #398(Updated) (#438)
rustfmt the repository #398
2017-10-03 13:40:23 +02:00
Michal Budzynski 287f539b7d Increased default logging level to info unless RUST_LOG is set 2017-06-28 23:37:03 +02:00
Michal Budzynski 7f51039f9a Rename and move the clap sub-command generation functions 2017-06-27 07:59:50 +02:00
Michal Budzynski fe62d0c407 Merge remote-tracking branch 'upstream/master' into split_commands 2017-06-26 23:11:00 +02:00
Michal Budzynski f3c8535870 Extracted `mdbook test` and `mdbook init` to separate files/modules 2017-06-26 01:24:33 +02:00
Michal Budzynski efdd0330c1 Extracted `mdbook init` to separate file/module 2017-06-26 01:02:32 +02:00
Michal Budzynski 4c78fdf431 Extracted `mdbook build` to separate file/module 2017-06-26 01:00:18 +02:00
Michal Budzynski b09fdf07e4 Register `serve` and `watch` subcommands only if given features enabled 2017-06-26 00:43:28 +02:00
Michal Budzynski 5c524da3c2 Extracted `mdbook watch` to separate file/module 2017-06-25 23:44:28 +02:00
Michal Budzynski 99224f40d5 Extracted `mdbook serve` to separate file/module 2017-06-25 23:05:58 +02:00
Michael Bryan fd821a5ead the binary now uses error-chain 2017-06-25 00:13:41 +08:00
Michal Budzynski 79cdcb46de extract serving code to a separate module 2017-06-23 08:59:42 +02:00
Michal Budzynski f889eb3d12 first draft of silencing 404 errors 2017-06-23 08:54:14 +02:00
Mathieu David 28afebdca2 Merge branch 'minor_refactor' of https://github.com/budziq/mdBook into budziq-minor_refactor 2017-06-23 01:09:26 +02:00
Jimmy Do 193f014a5b Add an option to convert to curly quotes when rendering to HTML 2017-06-18 10:11:04 -07:00
Michal Budzynski e8908e32c9 Minor cleanup
- removing need to explicitly use `Path::new` all over the place
- removed warnings from doctests (normally invisible unless `cargo test -- --nocapture`)
- no doctests are norun/ignore now
- updated docs both in book-example and in docs not to refer to nonexisting API's
2017-06-14 21:55:42 +02:00
Mathieu David f1121cf8c2 fix build failure 2017-06-04 20:47:34 +02:00
Mathieu David d3ae2eda56 Replace the old book structure with the new one 2017-06-04 20:41:31 +02:00
Michal Budzynski be3418a269 Now changes to `theme` directory trigger rebuild for `mdbook serve`
As `theme` dir is no longer under `src`. Updates to "theme" did not
trigger book rebuild.
Also fixed misleading docs about `theme` dir being located in `src`
2017-06-01 13:11:39 +02:00
Michal Budzynski 453b97bec0 Reformatted "Serving on " message for easier consumption
Now we have: `Serving on: http://localhost:3000`
2017-05-27 11:34:46 +02:00
superstring 7de24f86a9 Change --ws-port to --websocket-port 2017-05-26 19:18:32 +08:00
superstring 027c21aef7 Fix websocket port option for serve 2017-05-26 12:04:20 +08:00
Michal Budzynski 75bbd55128 Changes made with rustfmt including `use_try_shorthand`
Updated the project rustfmt.toml to include `use_try_shorthand = true`.
Run rustfmt on all rust sources.
2017-05-19 13:04:37 +02:00
Corey Farwell c6e81337fb Implement new 'no-create' build flag.
Fixes https://github.com/azerupi/mdBook/issues/253.
2017-04-17 21:53:27 -04:00
Corey Farwell 95fd292b4f Address warnings found by rust-clippy.
https://github.com/Manishearth/rust-clippy
2017-02-16 16:55:28 -05:00
Pete Hayes 4b31ae6789 Add --dest-dir arg to build, watch and serve subcommands 2017-01-12 12:26:22 +00:00
Pete Hayes 1afa2debc1 Fix spelling of omitted 2017-01-12 12:23:39 +00:00
Matt Brubeck c7b4147ba7 Watch both book.json and book.toml 2017-01-01 16:03:49 -08:00
Matt Brubeck 1ac2602360 Update to notify 3.0
notify now does its own event debouncing, so it's no longer necessary
for mdbook to do this manually.
2017-01-01 16:03:49 -08:00
Matt Brubeck 21bc3d47c8 Add a CLI option to open a web browser 2017-01-01 09:58:20 -08:00
Gambhiro 4153db2624 env_logger 2016-08-14 14:55:10 +01:00
Carol (Nichols || Goulding) a459a3606e Exit with a nonzero status if we get an error
This is especially important when mdbook is used with CI.
2016-08-06 14:54:07 -04:00
Ferris 317023cd0e Added option to configure serve interface and address browser will use to connect to websocket server. 2016-08-05 21:40:00 +00:00
Austin Hartzheim 03373c6bf2 Fix azerupi/mdBook#133 by adding a link to the GitHub repo at the end of the --help output. 2016-06-11 23:08:48 +00:00
Boris-Chengbiao Zhou 9b1e224680 Fix no-default-features build 2016-05-08 21:51:34 +02:00
Boris-Chengbiao Zhou e3f398cff2 Add address output to mdbook serve 2016-04-27 22:29:48 +02:00
Boris-Chengbiao Zhou c8051294b0 Switch from rust-websocket to ws-rs 2016-04-02 21:44:13 +02:00
Boris-Chengbiao Zhou e861880f95 Implement Serve feature 2016-04-02 05:20:46 +02:00
Mathieu David c5752620d7 Merge pull request #122 from Bobo1239/fix_cooldown
Fix watch event cooldown
2016-03-19 19:40:58 +01:00
Boris Zhou 7f3a6c8130 Fix watch event cooldown 2016-03-19 18:28:34 +01:00
Boris-Chengbiao Zhou b30a8bdc81 Update dependencies 2016-03-19 17:45:58 +01:00