Commit Graph

303 Commits

Author SHA1 Message Date
Michal Budzynski c1c06d6dc1 Auto focus on content to allow keyboard navigation 2017-06-15 23:15:41 +02:00
Michal Budzynski ee9fa8c86f Fix for playpen buttons missing on mobile safari and chrome IOS 2017-06-13 16:59:29 +02:00
Michal Budzynski a6275ebcdb copying to clipboard no longer copies the compilation results from "play" 2017-06-12 14:02:53 +02:00
Mathieu David 9ce6eebe43 Merge branch 'master' of git://github.com/Cldfire/mdBook into Cldfire-master 2017-06-12 11:19:31 +02:00
Mathieu David 350c86155b Merge branch 'custom_js' of git://github.com/budziq/mdBook into budziq-custom_js 2017-06-12 11:09:07 +02:00
Michal Budzynski 08fd255a56 Move from localStorage to store.js (v2.0.3)
Fixes a lot of browser incompatibilities in localStorage/cookie handling
Including but not limited to:

- loss of styling and functionality on chromium private mode
- loss of styling and functionality on safari and safari private mode
- awaiting verification if problems in mobile safari are solved.
2017-06-12 01:53:25 +02:00
Michal Budzynski f607978780 Hide sidebar on link selection when it occupies large space
in relation to the whole screen width (solves problems on phones)
2017-06-11 15:13:31 +02:00
Michal Budzynski f96e7e5cba Implemented support for additional JS 2017-06-11 15:08:09 +02:00
pravic 56163f69f8 One more ES5 fix. 2017-06-09 22:48:57 +03:00
pravic eba90f5440 Fix ES5 compatibility. 2017-06-09 21:59:29 +03:00
Cldfire 44efc65c63 Add `Ayu` theme
Also adds the a new variable, `$inline-code-color`, to base.styl. The `Ayu` theme needed this to change the text color of inline code.
2017-06-06 16:35:44 -04:00
Mathieu David f1121cf8c2 fix build failure 2017-06-04 20:47:34 +02:00
Mathieu David 1a8e54bb52 remove unused methods 2017-06-04 20:41:31 +02:00
Mathieu David bb4ceb481f Allow an additional custom stylesheets, closes #178 2017-06-04 20:41:31 +02:00
Mathieu David 2e812db13c Fix for google-analytics 2017-06-04 20:41:31 +02:00
Mathieu David 70383d0a25 New config structs supports json again (the old style) for a little deprecation period 2017-06-04 20:41:31 +02:00
Mathieu David d3ae2eda56 Replace the old book structure with the new one 2017-06-04 20:41:31 +02:00
Mathieu David 170bf8b1eb New configuration struct + tests #285 2017-06-04 20:41:31 +02:00
Michal Budzynski be3418a269 Now changes to `theme` directory trigger rebuild for `mdbook serve`
As `theme` dir is no longer under `src`. Updates to "theme" did not
trigger book rebuild.
Also fixed misleading docs about `theme` dir being located in `src`
2017-06-01 13:11:39 +02:00
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