Commit Graph

25 Commits

Author SHA1 Message Date
David Drysdale a886ff55f8 Support {{#shiftinclude auto}}
As well as allowing explicitly-specified shift amounts, also
support an "auto" option that strips common leftmost whitespace
from an inclusion.
2024-03-02 18:25:19 +00:00
David Drysdale 6c7b25945d Add {{#shiftinclude}} to L/R shift on include
Syntax is the same as {{#include}} except with a shift value and colon
before the remaining arguments, e.g.

  {{#include -2:somefile.rs:myanchor}}

A positive value for the shift prepends spaces to each line.

A negative value for the shift removes chars from the beginning of each
line (including non-whitespace chars, although this will emit an error
log).
2024-03-02 16:32:52 +00:00
Eric Huss 42e635bb9e Update pulldown_cmark to 0.10 2024-02-05 14:11:27 -08:00
Eric Huss 1db52ff531 Fix search for custom heading attributes 2023-05-28 12:03:03 -07:00
Eric Huss e3be293420 Add an integration test for heading attributes 2023-05-28 12:02:59 -07:00
Matthew Woodcraft 000a93dc77 Test that long words are omitted from the search index.
Note they do appear in the 'docs' part of searchindex.json (so they will be
visible in search teasers).
2022-06-26 12:22:52 +01:00
Dylan DPC a5f861bf2b
Revert "Omit words longer than 80 characters from the search index" 2022-06-22 13:31:16 +02:00
Matthew Woodcraft 00a55b35a8 Test that long words are omitted from the search index.
Note they do appear in the 'docs' part of searchindex.json (so they will be
visible in search teasers).
2022-05-22 14:02:54 +01:00
Tom Milligan 972c61fa76
search: fix anchor ids for duplicate headers 2022-02-18 16:20:05 +00:00
Michael Howell 2a8af1c21d Include chapters with no headers in the search index 2021-08-31 12:48:21 -07:00
avitex 1038f0b7f5
Fix search index tests 2020-11-26 09:02:11 +11: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
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 6199e4df79 Bump elasticlunr. 2019-07-12 09:53:11 -07:00
Eric Huss 228e99ba11 Fix even more print page links. (#963) 2019-07-01 17:52:25 +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 2497e77bf1 Support strikethrough and tasklists. (#952) 2019-06-12 17:02:03 +02:00
Eric Huss cb4a3e0711 Fix more print.html links. (#871) 2019-05-08 23:50:59 +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
Steve Klabnik a481735fa2 failing test 2019-01-15 14:08:53 -05:00
Matt Ickstadt 1d1d4d7c30 Update tests to handle added dummy_book chapter 2018-07-25 12:45:20 -05:00
Matt Ickstadt e94078cc9c Fix tests 2018-07-23 12:08:04 -05:00
Andrew Gauger 2a55ff62f3 Recursively apply preprocessor (#682) 2018-05-20 18:36:19 +08:00
Matt Ickstadt 5fb3675151 Update elasticlunr-rs (#646)
* Update dependencies

* Use config structs from elasticlunr-rs

* Update searchindex fixture
2018-03-20 20:22:35 +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