Commit Graph

25 Commits

Author SHA1 Message Date
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
Eric Huss bc23d08fa5
Rename playpen to playground. (#1241)
looks good
2020-06-22 16:34:25 +02:00
Eric Huss 21d8f394ae Fix "next chapter" spacer handling. (#1075) 2019-10-25 17:33:21 +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 0e1787c617 Don't run index preprocessor on `mdbook test` 2018-07-25 12:19:01 -05:00
Matt Ickstadt e5563182fc Add readme to cause test to fail
The test for `mdbook test` fails due to the index preprocessor which only runs on README files.
2018-07-25 12:14:27 -05:00
Andrew Gauger 2a55ff62f3 Recursively apply preprocessor (#682) 2018-05-20 18:36:19 +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 c89245b45b
Recursively apply replace_all() when running the links preprocessor (#564)
* Looks like we forgot to recursively apply replace_all() in #532

* Removed some print statements

* Made sure we ignore the rendered dummy_book
2018-01-22 06:44:28 +08:00
Michael Bryan 751da4f05f
Added a test to make sure you can include rust files in chapters 2017-12-10 22:59:35 +11:00
Michael Bryan f993677626
All tests finally pass! 2017-12-10 22:52:00 +11:00
Michael Bryan 21498631b3
Made sure the dummy book can build 2017-12-10 22:50:57 +11:00
Michael Bryan d56ff94ce6
Regression tests (#422)
* Created regression tests for the table of contents

* Refactoring to make the test more readable

* Fixed some bitrot and removed the (now redundant) tests/helper module

* Removed the include_str!() stuff and use just the dummy book for testing

* Regression tests now pass again!

* Pinned a `*` dependency to use a particular version

* Made sure test mocks return errors instead of panicking

* Addressed the rest of @budziq's review

* Replaced a file open/read with file_to_string
2017-11-16 15:51:12 +08:00