Commit Graph

79 Commits

Author SHA1 Message Date
Eric Huss 50bcf67f2b Consistent punctuation. 2020-05-10 08:42:53 -07:00
Gilles Rasigade 1731779a8d Add `header.hbs` template documentation 2020-05-10 08:42:53 -07:00
Gilles Rasigade f7e349d37f Add `head.hbs` template documentation 2020-05-10 08:42:53 -07:00
Eric Huss 2732c5e8f7 Update docs and tweak error messages. 2020-04-21 15:34:59 -07:00
Eric Huss 28ce8f5ac0 Some edition cleanup and fixes. 2020-04-21 12:26:48 -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 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
boyned//Kampfkarren 29d8747e01
Change erroneous syntax highlighting definition
Doing what it says results in:

```
2019-11-04 16:13:15 [WARN] (mdbook::renderer::html_handlebars::hbs_renderer): Previous versions of mdBook erroneously accepted `./src/theme` as an automatic theme directory
2019-11-04 16:13:15 [WARN] (mdbook::renderer::html_handlebars::hbs_renderer): Please move your theme files to `./theme` for them to continue being used
```
2019-11-04 16:14:38 -08:00
Steve Klabnik f79d5d4582 rust-lang-nursery -> rust-lang
Fixes #1080
2019-10-29 08:04:16 -05:00
Weihang Lo 6af6219e5b [Feature] expandable sidebar sections (ToC collapse) (#1027)
* render(toc): render expandable toc toggle

* ui(toc): js/css logic to toggle toc

* test: update rendered output css selector

* config: add `html.fold.[enable|level]`

* renderer: fold according to configs

* doc: add `output.html.fold`

* refactor: tidy fold config

- Derive default for `Fold`.
- Use `is_empty` instead of checking the length of chapters.
2019-10-19 09:56:08 +02:00
Andrew Pritchard e5f74b6c86 Option to display copy buttons. (#1050)
* Option to display copy buttons.

- Added field to playpen data structure
- Communicate through window.playpen_copyable
- Javascript updated to check before displaying copy buttons.

* html -> html_config

Also:
- update description of copyable in source code.
- update description of line_numbers (my last PR to this repository)
2019-10-17 12:44:54 +02:00
Carol (Nichols || Goulding) ac1749ff2f Implement a `rustdoc_include` preprocessor (#1003)
* Allow underscores in the link type name

* Add some tests for include anchors

* Include parts of Rust files and hide the rest

Fixes #618.

* Increase min supported Rust version to 1.35

* Add a test for a behavior of rustdoc_include I want to depend on

At first I thought this was a bug, but then I looked at some use cases
we have in TRPL and decided this was a feature that I'd like to use.
2019-10-06 00:27:03 +02:00
Eric Huss 93c9ae5700
Merge pull request #1037 from Flying-Toast/prefers-color-scheme
Automatically use a dark theme according to 'prefers-color-scheme'
2019-10-05 11:33:52 -07:00
Flying-Toast 9bdec5e7cc preferred-dark-theme defaults to default-theme 2019-10-04 19:32:03 -04:00
rnitta 5fe801a7d1 fix Search::use_boolean_and documents 2019-10-03 11:35:42 +09:00
Flying-Toast 1ef94c2a7e add preferred-dark-theme to book.toml example 2019-09-26 12:13:25 -04:00
Flying-Toast f0ac13e3e2 Document preferred-dark-theme config option 2019-09-26 12:09:30 -04:00
Andrew Pritchard 81ab2eb7db Added line numbers to editable sections of code.
- Added line numbers to config struct
- Added playpen_line_numbers field to hbs renderer.
- Added section to set `window.playpen_line_numbers = true` in page template
- Use line number global variable to show line numbers when required.
2019-09-24 21:27:02 +08: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
Matthias Eichstedt 9ec43b6c6d Remove redundant occurrence of 'in the' 2019-07-17 17:20:18 +02:00
Benoît CORTIER d8a68ba3f6 Document anchor-based partial include feature in the book 2019-07-14 21:55:51 -04:00
Eric Huss bb3398bdbb
Merge pull request #941 from rnitta/configurable-language
Change language attribute of the book to configurable
2019-06-24 08:56:22 -07:00
Eric Zubriski 84d4063e4a Fix-681 (#954)
* Adding section for code snippets.

* Reformatting sections.

* Update mdbook.md
2019-06-13 07:38:12 +02:00
rnitta 4f7c299de7 update language attribute to configurable 2019-05-30 11:53:49 +09:00
Eric Huss fc565df86b Some documentation fixes. (#925) 2019-05-19 00:05:57 +02:00
Michael Bryan 42b87e0fbc
Merge pull request #804 from Bassetts/default-theme-option
Default theme option
2018-10-30 21:18:48 +08:00
Michael Bryan b4538da9c3
Merge pull request #802 from Bassetts/git-button
Implement a git repository button
2018-10-23 19:16:45 +08:00
Jason Liquorish eccec9bb52 Update documentation for 2018-10-21 13:16:59 +01:00
Michael Bryan cffc385b0c
Updated the user guide's config section to mention specifying plugin commands 2018-10-20 14:16:07 +08:00
Jason Liquorish 10b69e60c8 Add documentation and tests 2018-10-15 21:40:59 +01:00
Jason Liquorish 5bfdf9fcc8 Added git-repository-icon option
Updated documentation and added tests.
2018-10-15 19:48:54 +01:00
Ramon Buckland ced74ca4dd
Updated the documentation for new preprocessor format (#787)
* Updated the documentation for new preprocessor format

* adjusted the descriptions for preprocessors
2018-09-10 19:51:18 +08:00
Danny Guo d9c1c77aae
Fix a typo 2018-08-20 23:48:18 -04:00
Matt Ickstadt 322e8fcf77 Rewrap guide markdown at 80 columns
Much of the book was wrapped at around 80 columns, but let's make this consistent.
2018-08-02 21:34:26 -05:00
Matt Ickstadt f30ce0184d Fix escaped link preprocessor 2018-08-02 19:04:35 -05:00
Matt Ickstadt a776aa9783 Update documentation for commands 2018-08-02 17:01:47 -05:00
Matt Ickstadt 8cd7061ff2 Add search.enable config field 2018-07-23 12:08:04 -05:00
Weihang Lo 41d372de26 Update documentation for preprocessor (#686) 2018-05-06 23:48:11 +08:00
Weihang Lo 69599646e7 Add index preprocessor (#685)
* Add index preprocessor

README.md is a de facto index file in markdown-based documentation.
Hence, we respect to README.md and convert it into index.html.

* Fix warning for unused variables

* Update tests for config

* Match file stem case-insensitively for IndexPreprocessor

* Add tests for IndexPreprocessor

* Update book example to fit index preprocessor
2018-05-04 19:41:28 +08:00
Davide Aversa 38279deed7 Add a note in MathJax documentation 2018-04-03 10:17:06 +02: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
bchatard 03c6c44e5b Fix typo in format configuration 2018-02-05 13:01:17 +01:00
Tshepang Lekhonkhobe 5d42738a79
doc: small fixes 2018-02-01 03:29:39 +02:00
boxdot bf9f58e11b Add docs for mdBook specific include feature (#593)
* Add docs for mdBook specific include feature.

Also:
* Fix bug in take_lines taking `end`-many lines instead of
  `end-start` many.
* Handle special case `include:number` as including a single line.
* Start counting lines at 1 and not 0.

* Merge mdBook and rust specific features into one chapter.
2018-01-31 18:57:47 +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
projektir 57f960a03b Documenting the editor #521 2018-01-16 21:26:13 -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