Commit Graph

19 Commits

Author SHA1 Message Date
Matt Ickstadt
8cd7061ff2 Add search.enable config field 2018-07-23 12:08:04 -05:00
Dylan Maccora
07719a8e0e Adding for content to book.toml on init (#627)
* Obtaining author name from gitconfig

* Writing theme to config on init

* Addressing a FIXME came across

* Add request for book title.
2018-03-14 23:27:56 +08: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
Michael Bryan
9fe19d8f31
Increase Documentation Coverage (#543)
* Added documentation to the `config` module

* Added an example to the `config` module

* Updated the docs in lib.rs regarding implementing backends

* Started writing an alternate backends walkthrough

* Mentioned the output.foo.command key

* Added example output

* Added a config section to the backends tutorial

* Finished off the backends tutorial

* Made sure travis checks mdbook-wordcount

* Fixed the broken link at in the user guide

* Changed how travis builds the project

* Added a conclusion

* Went through and documented a lot of stuff

* Added a preprocessors chapter and updated For Developers
2018-01-21 22:35:11 +08:00
Jaime Valdemoros
b599956516 Move preprocess field location and add tests 2018-01-16 22:39:11 +00:00
Michael Bryan
be949ceae8
Cleaned up the is_legacy_format() function 2018-01-14 04:54:11 +08:00
Michael Bryan
a1b6ccc29a
Override configuration using environment variables (#541)
* Added the ability to update config settings from env vars

* Added tests

* Documented that you can override configuration with environment
variables

* Refactored the config get() methods to use toml-query

* Made the `Updateable` trait more generic
2018-01-14 02:38:43 +08:00
vabc3
e825357848 Add option to disable section label in html (#533) 2018-01-08 00:31:46 +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
Justin Ridgewell
61356ce5fe Implement playpen defaults
Avoids issues where we enable `editable` but forget to specify `editor`
(eg, https://github.com/rust-lang/rust-by-example/issues/963).  Since we
already include Ace editor, seems like we can just treat it as the
default.
2017-12-21 00:18:12 -05:00
Michael Bryan
8b21da9950
Fleshed out book creation 2017-12-10 22:50:57 +11:00
Chris Spiegel
b0b09bad3f Clean up build configuration.
This rolls all "create missing" handling into BuildConfig, and moves the
build-dir option from the "book" table to the "build" table. Some
documentation cleanup surrounding the build table is also updated.
2017-11-30 07:39:58 -08:00
Chris Spiegel
93874edebf Add a create-missing option to book.toml. 2017-11-29 20:02:58 -08:00
Michael Bryan
5eff572dbb
Updated the warning to give some basic migration instructions 2017-11-12 21:37:39 +08:00
Michael Bryan
238dfb7d1d
Added in legacy config format support 2017-11-12 21:37:38 +08:00
Michael Bryan
c25c5d72c8
Went back and simplified Config to be a smart wrapper around toml::Table 2017-11-12 21:37:38 +08:00
Michael Bryan
3aa6436679
Added in things from @Phaiax's review 2017-11-12 21:37:38 +08:00
Michael Bryan
18c725ee12
Integration tests pass again 2017-11-12 21:37:37 +08:00
Michael Bryan
1743f2a39f
Removed the now redundant config files 2017-11-12 21:37:37 +08:00