Commit Graph

1462 Commits

Author SHA1 Message Date
Behnam Esfahbod 99945542ca [renderer] Add normalize_path()
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.
2017-09-06 00:52:17 -07:00
Behnam Esfahbod 956a5cc7fd Fix heading links in nested pages
Plus fixing the whitespace chars not being replaced by hyphen.

Also expand tests for link creations, and add test for nested pages.

Fixes <https://github.com/azerupi/mdBook/issues/416>
Fixes <https://github.com/azerupi/mdBook/issues/417>
2017-09-06 00:52:17 -07:00
Behnam Esfahbod cef62ec42e Fix build and test warnings
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.
2017-09-06 00:52:17 -07:00
Behnam Esfahbod b1362bfa06 [watch] Fix build warnings 2017-09-06 00:52:15 -07:00
Behnam Esfahbod a529ca5e65 [Cargo.toml] Fix package.exclude warnings
IIUC, the existing exclude rule has meant to do what it will do in the
future (gitignore-like matching, not glob-only matching). This fix makes
the rule to do what it was expected to do, and is forward-compatible,
therefore fixing the warning messages.
2017-09-06 00:52:15 -07:00
Michal Budzynski 6bc3039b4f Both static and ACE editable snippets have optional play button
- 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
2017-09-06 00:18:24 +02:00
Michal Budzynski cd90fdd407 first prototype of play-button enabling only if crate list supported
also minor refactor of clipboard handling
TODO:
- `no_run` support
- test with ACE
- disable play button with tooltip instead of hiding
2017-09-06 00:18:24 +02:00
Mathieu David a6a7c95c78 Merge pull request #343 from budziq/appveyor_css
fixed `cargo build --features=regenerate-css` on win 10 / nightly
2017-09-05 19:33:57 +02:00
Mathieu David 0a4a2b66da Fix the print title that was using the title from the last rendered chapter. Fixes #414 2017-09-01 08:22:24 +02:00
Mathieu David 2f3c14d609 ignore vscode dir in git 2017-09-01 08:22:01 +02:00
Mathieu David ebcf1e495d Merge pull request #413 from behnam/gitignore
[book] Prevent over-matching in gitignore rule
2017-08-31 19:27:38 +02:00
Behnam Esfahbod 40a4840867 [book] Prevent over-matching in gitignore rule
To only ignore the output destination (default: `book`) and no other
file/directory with the same name under the mdbook root, we should
prefix the gitignore rule with a leading slash (default: `/book`).
2017-08-30 16:01:45 -07:00
steveklabnik 313f9b9403 Bump version in Cargo.toml for next release 2017-08-29 12:53:32 -04:00
Steve Klabnik d94c097495 Merge pull request #411 from steveklabnik/master
Fix toml problem and release 0.0.23
2017-08-29 12:51:11 -04:00
steveklabnik b7372d3bf2 Fix toml problem and release 0.0.23
The toml crate removed its serde dependency in 0.3, but in 0.4, it
went away. Cargo didn't warn on this, but now it does. As such, we
need a release so that rust's build doesn't warn constantly.
2017-08-29 10:53:20 -04:00
Michal Budzynski d0a6aea3aa fixed `cargo build --features=regenerate-css` on windows 10
also added cargo build --features=regenerate-css to appveyor.yml
2017-08-12 13:20:26 +02:00
Mathieu David a1926bbe8e Update documentation for mathjax 2017-08-11 13:55:11 +02:00
Mathieu David 094c1e7a52 Add documentation about additional-js 2017-08-11 13:55:11 +02:00
Mathieu David 4528e24080 Improve wording of documentation 2017-08-11 13:55:11 +02:00
Michal Budzynski 31983cae6c fixed missing playpen css class when codeblock properties had whitespace 2017-08-11 12:39:27 +02:00
Michal Budzynski ddf31dcc08 Fixed `mdbook test` for {{#playpen file.rs}}
- now `mdbook test` does full link expansion to temp file prior to running
- also minor reformat and cleanup of `HtmlHandlebars::render_item`
2017-08-07 21:42:28 +02:00
Michal Budzynski c36eca15c2 renamed `Playpen` to `Playground` in ajax error handling 2017-08-06 17:10:52 +02:00
Mathieu David 798225bcdc Merge pull request #393 from budziq/playpen_errors
handle play.rust-lang.org communication errors in playpens
2017-08-06 15:16:11 +02:00
Michal Budzynski eed1a0a591 handle play.rust-lang.org communication errors in playpens
also add 15s communication timeout
2017-08-06 14:59:19 +02:00
Mathieu David 35a447d08a Merge pull request #338 from projektir/ace_editor
Ace editor
2017-08-05 12:24:12 +02:00
projektir 16aa545c5b Integrating Ace #247 2017-08-03 22:45:33 -04:00
projektir 6601dbdd61 Adding ace.js, Rust highlighter, and themes #247 2017-08-03 20:00:39 -04:00
Mathieu David 373e36ebfb Merge pull request #380 from ffissore/master
Fixed wrong filename when post processing html
2017-08-03 16:27:18 +02:00
Mathieu David ef435825b0 Merge pull request #377 from Michael-F-Bryan/dry-themes
Make themes module more DRY
2017-08-03 14:06:45 +02:00
Michael Bryan 2f8d5ce263 Removed a lot of the repetition in Theme::new() 2017-08-03 07:01:52 +08:00
Michael Bryan ce2d7153f7 removed some repetition from the themes module 2017-08-02 23:31:37 +08:00
Mathieu David 6628757d8e Merge pull request #374 from Michael-F-Bryan/moar-tests
High level integration tests
2017-08-02 17:01:40 +02:00
Michael Bryan e2eb40bded Got some feedback from azerupi and added a DummyBook builder 2017-08-02 22:29:28 +08:00
Mathieu David 4f754a73ba Remove the empty introduction chapter 2017-08-02 15:04:03 +02:00
Mathieu David ba719c00be Possible fix for automatic deployment to gh-pages (GH_TOKEN has been updated on Travis) 2017-08-02 12:58:59 +02:00
Mathieu David 64f6f78663 Merge pull request #385 from azerupi/readme-pin-ci
Add a note about version pinning in the README
2017-08-01 14:32:43 +02:00
Mathieu David 3b0d2d1238 Add a note about version pinning for people doing automatic deployments of their books 2017-08-01 14:16:39 +02:00
Mathieu David 6ab3d3da2a ignore MacOS .DS_Store temporary files 2017-08-01 13:55:51 +02:00
Michal Budzynski ee29b9d5f6 added clone derives and made the separating space mandatory in links with paths 2017-08-01 13:50:12 +02:00
Michal Budzynski d7ecb1a80c Rewrite of {{#}} links handling in preprocess module
- Replaced link parser with a Regex
- Implemented {{#include}} links
- Will display relatively nice error when cannot open {{#}} linked file
- Escaped links no longer render with escape char
- utils::fs::file_to_path no takes AsRef<Path>
- sorted export/mod in lib.rs
2017-08-01 13:50:12 +02:00
Michal Budzynski f3f6b40ea9 Moved playpen.rs `renderer` helper to `preprocess/links.rs` module 2017-08-01 13:50:12 +02:00
Michał Budzyński c482650e56 Merge pull request #384 from budziq/travis-rustup-beta
fix travis ci for beta channel
2017-08-01 01:39:29 +02:00
Michał Budzyński 5da75bc798 fix travis ci for beta channel
travis started to fail for beta channel.
2017-08-01 01:04:05 +02:00
Federico Fissore 07b80723b6 Fixed wrong filename when post processing html 2017-07-24 11:37:31 +02:00
Michael Bryan 0c3a2b80f8 Tested MDBook::init with custom args 2017-07-10 18:23:51 +08:00
Michael Bryan 29e00c0d97 Broke the integration tests out into individual sections 2017-07-10 18:17:19 +08:00
Michael Bryan 7e8819f4d2 Bye bye println() debugging 2017-07-09 22:08:57 +08:00
Michael Bryan c90c0f7848 Updated the book testing to take into account #340 2017-07-09 20:02:31 +08:00
Michael Bryan cd11035a69 trivial change to make travis run again 2017-07-09 19:59:29 +08:00
Michael Bryan 8b7c95e02f Made sure the rendered content actually contains the original text 2017-07-09 19:59:29 +08:00