diff options
| author | bors <bors@rust-lang.org> | 2015-07-27 21:20:11 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2015-07-27 21:20:11 +0000 |
| commit | 75e4a78d15a837675eb6795b5afe4e1e3d27166c (patch) | |
| tree | ef9d732963978c49af8e5ab6815f2e4da103226b /src/libsyntax/parse | |
| parent | 3e6b03c2d87a1f54bfde2ea82b1f85aa4df04909 (diff) | |
| parent | f6e9240a99e86d2c799dc29f179dd2870e51f71d (diff) | |
| download | rust-75e4a78d15a837675eb6795b5afe4e1e3d27166c.tar.gz rust-75e4a78d15a837675eb6795b5afe4e1e3d27166c.zip | |
Auto merge of #26216 - azerupi:doc-experiments, r=steveklabnik
So I have tried to improve the rustbook engine:
- The sidebar now looks a lot more like gitbook (I thinks it cleaner)
- Added the Open Sans font, in my opinion more readable for prolonged periods of time
- Changed the style for code blocks a little
I encountered 1 problem. In `build.rs` I added this google font url (I commented out the non-relevant parts for clarity)
```rust
let rustdoc_args: &[String] = &[
//"".to_string(),
//preprocessed_path.display().to_string(),
//format!("-o{}", out_path.display()),
//format!("--html-before-content={}", prelude.display()),
//format!("--html-after-content={}", postlude.display()),
//format!("--markdown-playground-url=http://play.rust-lang.org"),
//format!("--markdown-css={}", item.path_to_root.join("rust-book.css").display()),
format!("--markdown-css=http://fonts.googleapis.com/css?family=Open+Sans:400italic,700italic,400,700"),
//"--markdown-no-toc".to_string(),
];
```
As you can see, I had to escape `=` with `=` because the string would get truncated if I didn't. Is that normal behaviour? Is that for security measures? If it is, isn't it a little weak if you can circumvent it by escaped characters? I don't know the reason behind, but I thought it was at least worth mentioning :)
Take your time for this PR, I still want to add multiple improvements:
- Like gitbook, possibility to change font by user
- Put `css` and `js` in their respective files (not hardcoded in rust)
- button to hide sidebar
- ...
So I'm not in a hurry to get this merged ;) But if you think it's good enough to be merged, go ahead. I will make another PR when I have other improvements.
In the image below is a screen of the improvements

Diffstat (limited to 'src/libsyntax/parse')
0 files changed, 0 insertions, 0 deletions
