* 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.
* Handle input path with regards to custom css
Before, when someone like the Reference set their extra css as
"theme/reference.css" in their book.toml, this path would be treated as
relative to the invocation of mdbook, and not respect the input path. This
PR modifies these relative paths to do so.
Fixes the build of https://github.com/rust-lang/rust/pull/47753 which
blocks updating rustc to mdbook 0.1
* don't use file-name
the style name is theme/reference.css, this results in a Err(StripPrefixError(())), which means that we push only the file_name, losing the theme bit
Tested this on macOS with VoiceOver, and it does not pick up the title as the text of the button. Kind of makes sense, since title and aria-label are not the same. This will make sure that the buttons and links are labeled properly.
Advantages:
- Easier to reason about
- Can easily disable some modules when debugging
- Shared dependencies are explicit (playpen_text)
- Enables some fancier things later one (e.g. run `codeSnippets` slightly later, to avoid blocking the page)
I'm aware that `codeSnippets` should be split into the highlighter and the editor, but I'm not sure I understand exactly how they interact so I've left it as it is for now.
* 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
* Added a windows-specific `tee` equivalent
* Changed how the windows "tee" command gets quoted
* Temporarily disabled the backends_receive_render_context_via_stdin test
* feat(theme/stylus/menu): Make sticky
* feat(theme/stylus/menu): Faint bottom border
* feat(theme/book): Auto hide menu when scrolling down
* feat(theme/stylus/menu): Don't hide title
* feat(theme/stylus/menu): Only show bottom border when sticky
* fix(theme/stylus/menu): Don't hide when sidebar is expanded
* feat(theme/book): Show menu bar on hover
* fix(theme/index): Use nav element for Table of Content
* fix(renderer/html_handlebars/helpers/toc): Use ol instead of ul
Chapters and sections are ordered, so we should use the appropriate HTML tag.
* fix(renderer/html_handlebars/helpers/toc): Hide section number from screen readers
Screen readers have this functionality build-in, no need to present this. Ideally, this should not even be in the DOM tree, since the numbers can be shown by using CSS.
* fix(theme/index): Remove tabIndex="-1" from .page
Divs are not focusable by default
* fix(theme): Make sidebar accessible
Using aria-hidden (together with tabIndex) takes the links out of the tab order.
http://heydonworks.com/practical_aria_examples/#progressive-collapsibles
* fix(theme/index): Wrap content inside main tag
The main tag helps users skip additional content on the page.
* fix(theme/book): Don't focus .page on page load
The main content is identified by the main tag, not by auto-focusing it on page load.
* fix(theme/index): Make page controls accessible
* fix: Make theme selector accessible
- Use ul and li (since it is a list)
- Add aria-expanded and aria-haspopup to the toggle button
- Use button instead of div (buttons are accessible by default)
- Handle Esc key (close popup)
- Adjust CSS to keep same visual style
* fix(theme/stylus/sidebar): Make link clickable area wider
Links now expand to fill the entire row.
* fix(theme): Wrap header buttons and improve animation performance
Previously, the header had a fixed height, which meant that sometimes the print button was not visible. Animating the left property is expensive, which lead to laggy animations - transform is much cheaper and has the same effect.
* fix(theme/stylus/theme-popup): Theme button inherits color
Bug introduced while making the popup accessible
* fix(theme/book): Handle edge case when toggling sidebar
Bug introduced when switching from animating left to using transform.
* 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
* 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
* Prohibit 'print.md' files
Fix#258 by emmiting an error whenever an mdBook contains a
"print.md" file in its root.
* Apply suggested changes
* Add tests
* Implement partial include of source files.
The macro `{{include some_file}}` accepts now optional line number
arguments, s.t. the specified line range is included. The following
forms are supported:
* `{{include some_file::}}` is equivalent to `{{include some_file}}`
* `{{include some_file:from:}}` includes lines [from, infinity)
* `{{include some_file::to}}` includes lines [0, to]
* `{{include some_file:from:to}}` includes lines [from, to]
* Remove the special case IncludeFull which is IncludeFrom(0).
* Use Range, RangeFrom, RangeTo and RangeFull to represent include-ranges.
Also:
* Move out introduced methods as free functions.
* Introduce RangeArgument trait as long it is unstable in stdlib.
* Use itertools for joining of lines on the fly.
* Split tests.
* Simplify include file argument parsing.
* Make utils::string private and link collections_range feature issue.
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.
* Refactor navigation helpers
* Target::find: take previous_item by reference
This makes more sense for find as an interface, though it causes a
second clone in some cases. Maybe rustc is smart here?
* Test next and previous navigation helpers
* Add more next/previous tests
This commit changes the url used to call the playground, and the
request parameter format to go with it. The older evaluate is
available in the playground as a form of backwards compatibility
and swithcing now opens way for using newer features.
On the web, the normalized path separator is forward-slash (`/`), so we
use the built-in `is_separator()` method to replace any path separator
with the forward-slash, to ensure consistent output on unix and windows
machines.
Move non-test test module files into their own directories to prevent
cargo from running them as tests. Then suppress the left-over warnings.
Move *dummy book* code and data into a shared folder, and leave the rest
of helper utilities (one function) in the original module.
- list of available crates is dynamically loaded from play.rust-lang.org
- play button is enabled only if crates used in snippet are available on playground
- ACE editor's play button is dynamically updated on each text change
- `no_run` is honored by always disabling the play button
- minor cleanups