Commit graph

284 commits

Author SHA1 Message Date
Michal Budzynski
3a809e4a1c Added local fallback for clipboard.js 2017-05-31 21:51:19 +02:00
Michal Budzynski
dfc24bec01 Fixed tooltip styling
Also fixed problem with garbage being put in clipboard
when triggered repeatedly
2017-05-31 21:07:47 +02:00
Michal Budzynski
e567d22f1c Initial implementation of clipboard handling 2017-05-31 19:56:17 +02:00
Michal Budzynski
8bfcd9939c Updated highlight.js to v9.12.0
Fixing problem with raw strings syntax highlighting
Also backported updates to atelier-dune-light.css
2017-05-31 15:12:20 +02:00
Michal Budzynski
453b97bec0 Reformatted "Serving on " message for easier consumption
Now we have: `Serving on: http://localhost:3000`
2017-05-27 11:34:46 +02:00
superstring
7de24f86a9 Change --ws-port to --websocket-port 2017-05-26 19:18:32 +08:00
superstring
027c21aef7 Fix websocket port option for serve 2017-05-26 12:04:20 +08:00
aaaxx
cc1cb9edb0 CSS: better fallback stack for monospaced fonts
List of system fonts (R, I, B means roman, italic and bold. Ubuntu probably comes with more fonts, but I couldn't find a list to confirm.):

```txt
Windows
----------
Consolas            R RI  B BI
Courier             R
Courier New         R RI  B BI
Lucida Console      R

Mac
----------
Andale Mono         R
Courier             R RI  B BI
Courier New         R RI  B BI
Menlo               R RI  B BI
Monaco              R

Ubuntu
----------
Ubuntu Mono         R RI  B BI
DejaVu Sans Mono    R RI  B BI
```

```css
font-family: Consolas, "Ubuntu Mono", Menlo, "DejaVu Sans Mono", monospace, monospace;
```

Consolas and Ubuntu are professionally designed fonts ([Lucas de Groot][1] and [Dalton Maag][2]), with true, calligraphic italic, so they go at the top of the stack.

Menlo is [based on DejaVu Sans Mono][3], the only difference being a few tweaked glyphs, so DejaVu serves as a fallback for it.

As for Courier New, other than being unreadably spindly, it's the default monospaced font in all browsers, so there's no need to include it in the stack.

The `monospace, monospace;` declaration is, by now, [a standard hack][4] that overrides some browsers' behaviour of defaulting the `monospace` elements to smaller font size. Without it, any relative font size you apply to them will be calculated from that reduced size (seems to be 13 px in all browsers).


[1]: https://en.wikipedia.org/wiki/Luc(as)_de_Groot
[2]: https://en.wikipedia.org/wiki/Dalton_Maag
[3]: http://www.leancrew.com/all-this/2009/10/the-compleat-menlovera-sans-comparison/
[4]: https://stackoverflow.com/questions/38781089/font-family-monospace-monospace
2017-05-24 06:07:58 +02:00
Michal Budzynski
9c8c819ec3 Inline code with hyperlink is now highlighted
Inline code with hyperlink has now a different color then
standard inline code and has a on hover underline.
2017-05-20 17:10:53 +02:00
Michal Budzynski
75bbd55128 Changes made with rustfmt including use_try_shorthand
Updated the project rustfmt.toml to include `use_try_shorthand = true`.
Run rustfmt on all rust sources.
2017-05-19 13:04:37 +02:00
Mathieu David
379ed9dc16 Merge pull request #284 from budziq/indentation
Fix indentation of hidden code blocks
2017-05-18 09:36:53 +02:00
Michal Budzynski
e4dd03c8f0 Fix indentation of hidden code blocks
Hidden code blocks are no longer indented with
one additional space (required for doctests to compile in some cases)
Now the behavior is similar to the rustdoc's
2017-05-18 00:04:09 +02:00
Michał Budzyński
c99ce06370 Do not add playpen boilerplate quick_main! is used
code snippets using quick_main! macro from error-chain
https://docs.rs/error-chain/0.10.0/error_chain/macro.quick_main.html
no longer have `fn main` implicitly added
2017-05-17 22:27:03 +02:00
Michael-F-Bryan
94dce4f796 Added google_analytics so it can be inserted into handlebars 2017-05-16 13:28:59 +08:00
Michael-F-Bryan
ada1f29b34 Added a google_analytics field to BookConfig
This commit:
- Adds an Option<String> field to the BookConfig which should
  contain your google analytics ID
- Allows the google analytics ID to be extracted from the config
  file (key is google_analytics_id)
- Adds a test to make sure the field is populated from a config
  file correctly
2017-05-16 13:15:04 +08:00
Michael-F-Bryan
4a634f08da Updated google analytics to index.hbs and hbs_renderer.rs 2017-05-16 13:05:21 +08:00
Phil Ruffwind
3066597acc Change MathJax to use CDNJS
Because the MathJax CDN will soon be retired.
2017-05-05 17:08:59 -04:00
Corey Farwell
4f4120b5a4 Fix incorrect conditional.
I accidentally introduced this in 4525810737.
2017-04-27 09:16:19 -04:00
Corey Farwell
4525810737 Rewrite an emptiness check. 2017-04-17 21:58:34 -04:00
Corey Farwell
5d72d966ad Wrap long line. 2017-04-17 21:56:01 -04:00
Corey Farwell
15dcca87d8 Refactor to prevent excessive indentation. 2017-04-17 21:55:32 -04:00
Corey Farwell
c6e81337fb Implement new 'no-create' build flag.
Fixes https://github.com/azerupi/mdBook/issues/253.
2017-04-17 21:53:27 -04:00
CrazyMerlyn
65d7e86024 Remove the extra run button on runnable rust files
The playpen helper now uses a simple pre block instead of a pre block
with class playpen as it led to nested playpens.
2017-04-16 18:17:59 +05:30
Mathieu David
b5ec813d2f Merge pull request #250 from regexident/master
Added monospace font with support for box-drawing chars
2017-04-15 20:37:17 +02:00
Vincent Esche
41735b4579 Added monospace font with support for box-drawing chars 2017-04-15 14:16:28 +02:00
Steve Klabnik
9cb232058b Merge pull request #243 from steveklabnik/gh241
Accept nightly examples.
2017-04-14 15:19:07 -04:00
mthh
df5472ab5a Should fix sections created with chapter of more than two digits 2017-04-07 12:46:28 +02:00
mthh
d768963c30 Revert "should fix sections created with chapter of more than two digits"
This reverts commit 8e7ec6e1fd.
2017-04-07 10:47:45 +02:00
mthh
8e7ec6e1fd should fix sections created with chapter of more than two digits 2017-04-07 02:37:46 +02:00
steveklabnik
80f01d70c6 Accept nightly examples.
This also brings us to parity with rustdoc regarding attributes in
general; while this PR was focused on enabling nightly, that was a
happy accident.
2017-03-31 17:06:03 -04:00
Tshepang Lekhonkhobe
793a88260c move misplaced example 2017-03-30 14:09:14 +02:00
Mathieu David
1632d2e339 Merge pull request #230 from crazymerlyn/ignore_arrow_keys_with_modifier
Fix keyboard navigation to trigger only if no modifier key is pressed
2017-03-26 18:49:27 +02:00
CrazyMerlyn
ed1a216121 Fix header links
Header fragment links now use "id" attribute instead of the depreciated
"name" attribute.

Similar headers are given numbered ids to avoid id collisions.
For instance, if there are three headers named "Example", their ids
would be "#example", "#example-1", and "#example-2" respectively.
2017-03-23 23:24:26 +05:30
CrazyMerlyn
f814e96459 Fix keyboard navigation to trigger only if no modifier key is pressed 2017-03-23 13:29:04 +05:30
Steve Klabnik
c6a5d12002 Merge pull request #222 from steveklabnik/gh29
Implement playpen support for ```rust
2017-03-10 08:59:15 -08:00
steveklabnik
b120ce7397 inject allow(unused_variables) 2017-03-10 09:46:11 -05:00
Carol (Nichols || Goulding)
56f597b90c Update to highlight.js 9.10.0 2017-03-09 22:45:59 -05:00
steveklabnik
c5f9625feb inject main 2017-03-06 13:27:25 -05:00
steveklabnik
79f00eeea3 Implement playpen support for ```rust
Fixes #29
2017-03-06 12:23:15 -05:00
Mathieu David
e218257e42 fix anchor links 2017-02-28 12:42:11 +01:00
Mathieu David
1345c05b18 Fix anchors, Fixes #211 2017-02-28 12:40:05 +01:00
Mathieu David
01341a7705 Fix code blocks with comma separated classes 2017-02-28 01:41:06 +01:00
Mathieu David
58cfef00f2 Merge pull request #209 from steveklabnik/gh204
Print version: fix up header links
2017-02-20 16:12:00 +01:00
Steve Klabnik
6af3eea24b Print version: fix up header links 2017-02-20 09:28:49 -05:00
Mathieu David
c88656284c Regenerate css 2017-02-19 11:13:19 +01:00
Corey Farwell
cfa4295d79 Bump toml crate to 0.3. 2017-02-18 20:22:55 -05:00
Mathieu David
d7f38d08fd Merge pull request #205 from frewsxcv/clippy
Address warnings found by rust-clippy.
2017-02-17 11:05:33 +01:00
Steve Klabnik
ec42e2f771 convert to one pass
thanks @burntsushi ❤️
2017-02-16 19:31:52 -05:00
Steve Klabnik
280dabecd7 update regex dep 2017-02-16 17:11:16 -05:00
Steve Klabnik
38b3516b60 Implement links in section headers.
This project already had a transitive dependency on regex; let's use it.

This isn't the most efficient solution, but it should be fine. It ends
up doing five full scans of the text. There's probably an easier way but
I'm mostly just trying to get this to work for now.

This also implements the same algorithm that rustdoc does for generating
the name for the link.

Fixes #204
2017-02-16 17:07:17 -05:00