Compare commits

...
31 Commits
Author SHA1 Message Date
squidfunk 57f51f3a3d Prepare 0.2.4 release 2016-06-26 14:16:59 +02:00
squidfunk fc6b086db4 Fixed #35: Add styling for blockquotes 2016-06-26 14:10:13 +02:00
squidfunk 2784a4f781 Fixed #33: Protocol relative URL for webfonts doesn't work with file:// 2016-06-26 13:50:24 +02:00
squidfunk 62dc4c111e Fixed #34: IE11 on Windows 7 doesn't honor max-width on main tag 2016-06-26 13:45:14 +02:00
squidfunk 1a4490a39c Default favicon not properly set 2016-06-24 13:12:20 +02:00
squidfunk a1a896e1bb Prepare 0.2.3 release 2016-05-16 16:48:11 +02:00
squidfunk e30b60b1e6 Fixed #26: Better highlighting for keystrokes 2016-05-16 16:32:29 +02:00
squidfunk 016b1a227d Fixed #30: Suboptimal syntax highlighting for PHP 2016-05-11 18:43:02 +02:00
squidfunk 0f5c43df0c Fixed #25: Highlight inline fenced blocks 2016-05-11 18:31:15 +02:00
squidfunk 25a102f2b4 Update version 2016-03-20 20:07:38 +01:00
squidfunk 8f09451c13 Prepare 0.2.2 release 2016-03-20 19:59:25 +01:00
squidfunk eade56c912 Fixed #20: Fix rounded borders for tables 2016-03-17 17:53:02 +01:00
squidfunk 8ab2e5eb2a Fixed #15: Document pygments dependency for codehilite 2016-03-17 17:15:11 +01:00
squidfunk d58834222d Put version number in own container 2016-03-17 16:51:20 +01:00
Martin Donath f934776af6 Merge pull request #17 from sebastian-marinescu/patch-1
Update drawer.html // Styling version number
2016-03-17 16:40:55 +01:00
Sebastian G. Marinescu d2e2764bd6 Update drawer.html
Separate version-number into span so styling it via CSS is possible
2016-03-15 10:08:57 +01:00
squidfunk aedddcbc39 Fixed #16: Favicon could not be set through mkdocs.yml 2016-03-14 21:20:51 +01:00
squidfunk 4b9c8b9a49 Prepare 0.2.1 release 2016-03-12 13:25:05 +01:00
squidfunk a58cb0aea6 Added documentation for Google Analytics integration 2016-03-12 13:21:06 +01:00
squidfunk cf8e992c24 Fixed empty list in table of contents when no headline is defined 2016-03-12 13:20:19 +01:00
squidfunk bf227de93e Fixed #13: Table cells don't wrap 2016-03-12 13:15:15 +01:00
squidfunk c829555313 Set up tracking of site search for Google Analytics 2016-02-27 12:20:49 +01:00
squidfunk f6195de306 Corrected wrong path for static asset monitoring in Gulpfile 2016-02-27 12:19:18 +01:00
squidfunk 3e508f45f2 Fixed #10: Invisible header after closing search bar with ESC key 2016-02-25 19:05:53 +01:00
squidfunk 573b74881d Prepare 0.2.0 release 2016-02-24 18:11:04 +01:00
squidfunk a65b1a05d8 Added images showing colors to documentation 2016-02-24 18:10:11 +01:00
squidfunk bb5f98e617 Updated documentation 2016-02-24 17:31:01 +01:00
squidfunk e256360619 Remove bottom border on footer hover and fix default label 2016-02-24 17:30:42 +01:00
squidfunk 0eb02a0d10 Fixed #7: Better colors for links inside admonition notes and warnings 2016-02-24 16:40:00 +01:00
squidfunk 32a14cbb12 Fixed #6: Include multiple color palettes via mkdocs.yml 2016-02-24 16:24:32 +01:00
squidfunk bf8be26e0a Fixed #9: Text for prev/next footer navigation should be customizable 2016-02-24 12:40:02 +01:00
36 changed files with 605 additions and 165 deletions
+35
View File
@@ -1,3 +1,38 @@
mkdocs-material-0.2.4 (2016-06-26)
* Fixed improperly set set default favicon
* Fixed #33: Protocol relative URL for webfonts doesn't work with file://
* Fixed #34: IE11 on Windows 7 doesn't honor max-width on main tag
* Fixed #35: Add styling for blockquotes
mkdocs-material-0.2.3 (2016-05-16)
* Fixed #25: Highlight inline fenced blocks
* Fixed #26: Better highlighting for keystrokes
* Fixed #30: Suboptimal syntax highlighting for PHP
mkdocs-material-0.2.2 (2016-03-20)
* Fixed #15: Document pygments dependency for codehilite
* Fixed #16: Favicon could not be set through mkdocs.yml
* Fixed #17: Put version into own container for styling
* Fixed #20: Fix rounded borders for tables
mkdocs-material-0.2.1 (2016-03-12)
* Fixed #10: Invisible header after closing search bar with ESC key
* Fixed #13: Table cells don't wrap
* Fixed empty list in table of contents when no headline is defined
* Corrected wrong path for static asset monitoring in Gulpfile.js
* Set up tracking of site search for Google Analytics
mkdocs-material-0.2.0 (2016-02-24)
* Fixed #6: Include multiple color palettes via mkdocs.yml
* Fixed #7: Better colors for links inside admonition notes and warnings
* Fixed #9: Text for prev/next footer navigation should be customizable
* Refactored templates (replaced if/else with modifiers where possible)
mkdocs-material-0.1.3 (2016-02-21)
* Fixed #3: Ordered lists within an unordered list have ::before content
+1 -1
View File
@@ -254,7 +254,7 @@ gulp.task('assets:watch', function() {
/* Copy static assets */
gulp.watch([
'assets/assets/{fonts,images}/*'
'src/assets/{fonts,images}/*'
], ['assets:static']);
/* Minify views */
-3
View File
@@ -1,7 +1,6 @@
# Material
[![Travis CI][travis-image]][travis-link]
[![PyPI Downloads][pypi-dl-image]][pypi-dl-link]
[![PyPI Version][pypi-v-image]][pypi-v-link]
A material design theme for [MkDocs](http://www.mkdocs.org).
@@ -51,7 +50,5 @@ IN THE SOFTWARE.
[travis-image]: https://travis-ci.org/squidfunk/mkdocs-material.svg
[travis-link]: https://travis-ci.org/squidfunk/mkdocs-material
[pypi-dl-image]: https://img.shields.io/pypi/dm/mkdocs-material.png
[pypi-dl-link]: https://pypi.python.org/pypi/mkdocs-material
[pypi-v-image]: https://img.shields.io/pypi/v/mkdocs-material.png
[pypi-v-link]: https://pypi.python.org/pypi/mkdocs-material
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "mkdocs-material",
"version": "0.1.3",
"version": "0.2.4",
"description": "A material design theme for MkDocs",
"homepage": "http://squidfunk.github.io/mkdocs-material/",
"authors": [
+82 -16
View File
@@ -4,11 +4,11 @@
### Installing MkDocs
In order to install [MkDocs][], Python and `pip` the Python package manager
need to be up and running. Assuming you are a developer and have a basic
understanding of how things work and what StackOverflow is, we won't provide
guidelines on setting those up. You can verify if you're already good to go
with the following commands:
Before installing [MkDocs][], you need to make sure you have Python and `pip`
the Python package manager up and running. Assuming you are a developer and
have a basic understanding of how things work and what StackOverflow is, we
won't provide guidelines on setting those up. You can verify if you're already
good to go with the following commands:
``` sh
python --version
@@ -103,6 +103,33 @@ extra:
logo: 'images/logo.png'
```
### Changing the color palette
Material defines a default hue for every primary and accent color on Google's
material design [color palette][]. This makes it very easy to change the
overall look of the theme. Just set the variables `extra.palette.primary` and
`extra.palette.accent` to one of the colors defined in the palette:
``` yaml
extra:
palette:
primary: 'indigo'
accent: 'light blue'
```
Color names can be written upper- or lowercase but must match the names of the
material design [color palette][]. Valid values are: _red_, _pink_, _purple_,
_deep purple_, _indigo_, _blue_, _light blue_, _cyan_, _teal_, _green_, _light
green_, _lime_, _yellow_, _amber_, _orange_, _deep orange_, _brown_, _grey_ and
_blue grey_. The last three colors can only be used as a primary color.
![Material Screenshot](images/colors.png)
If the color is set via this configuration, an additional CSS file called
`palettes.css` is included that defines the color palettes. If you want to
keep things lean, clone the repository and recompile the theme with your
custom colors set. See [this article](customization.md) for more information.
### Changing the font family
Material uses the [Ubuntu font family][] by default, specifically the regular
@@ -117,15 +144,28 @@ extra:
code: 'Roboto Mono'
```
The text font will be loaded in font-weights 400 and 700, the monospaced font
in regular weight. If you want to load fonts from other destinations or don't
want to use the Google Fonts loading magic, just set `extra.font` to `'none'`:
The text font will be loaded in font-weights 400 and **700**, the monospaced
font in regular weight. If you want to load fonts from other destinations or
don't want to use the Google Fonts loading magic, just set `extra.font` to
`'none'`:
``` yaml
extra:
font: 'none'
```
### Localization
The **Previous** and **Next** labels in the footer can easily be changed by
defining the variables `extra.i18n.prev` and `extra.i18n.next`:
``` yaml
extra:
i18n:
prev: 'Previous'
next: 'Next'
```
### Adding a GitHub and Twitter account
If you have a GitHub and/or Twitter account, you can add links to your
@@ -139,11 +179,23 @@ extra:
twitter: 'my-twitter-handle'
```
### Google Analytics integration
Material makes it easy to integrate site tracking with Google Analytics.
Besides basic tracking, clicks on all outgoing links can be tracked, clicks on
the download and star button, as well as how site search is used. Tracking can
be activated in your project's `mkdocs.yml`:
``` yaml
google_analytics:
- 'UA-XXXXXXXX-X'
- 'auto'
```
### More advanced customization
If you want to change the colors or general appearance of the Material theme,
see [this article](customization.md) for more information on advanced
customization.
If you want to change the general appearance of the Material theme, see
[this article](customization.md) for more information on advanced customization.
## Extensions
@@ -153,8 +205,9 @@ have to switch them on explicitly.
### CodeHilite (recommended)
This extensions adds code highlighting to fenced code blocks. It might not be
the best code highlighter, but it works without JavaScript and on the server:
This extensions uses [Pygments][] (install with `pip install pygments`) to add
code highlighting to fenced code blocks. It might not be the best code
highlighter, but it works without JavaScript and on the server:
``` yaml
markdown_extensions:
@@ -168,12 +221,12 @@ further instructions
### Permalinks
In order to add [permalinks][] to the headers of your article, set the
`markdown_extensions.toc.permalink` variable to a symbol, e.g. ``:
`markdown_extensions.toc.permalink` variable to a symbol, e.g. `#`:
``` yaml
markdown_extensions:
- toc:
permalink: ''
permalink: '#'
```
The symbol can be chosen freely, it can even be a WebFont icon.
@@ -242,26 +295,39 @@ theme: 'material'
extra:
version: '0.1.0'
logo: 'images/logo.png'
palette:
primary: 'indigo'
accent: 'light blue'
font:
text: 'Roboto'
code: 'Roboto Mono'
i18n:
prev: 'Previous'
next: 'Next'
author:
github: 'my-github-handle'
twitter: 'my-twitter-handle'
# Google Analytics
google_analytics:
- 'UA-XXXXXXXX-X'
- 'auto'
# Extensions
markdown_extensions:
- codehilite(css_class=code)
- admonition
- toc:
permalink: ''
permalink: '#'
```
[MkDocs]: http://www.mkdocs.org
[color palette]: http://www.materialui.co/colors
[Ubuntu font family]: http://font.ubuntu.com
[Google Fonts]: https://www.google.com/fonts
[Roboto font]: https://www.google.com/fonts/specimen/Roboto
[Markdown extensions]: http://www.mkdocs.org/user-guide/writing-your-docs/#markdown-extensions
[Pygments]: http://pygments.org
[highlight.js]: https://highlightjs.org
[extra]: http://www.mkdocs.org/user-guide/styling-your-docs/#customising-a-theme
[permalinks]: https://en.wikipedia.org/wiki/Permalink
Binary file not shown.

After

Width:  |  Height:  |  Size: 254 KiB

+21 -5
View File
@@ -14,12 +14,26 @@ CSS that weighs less than 30kb (minified, gzipped and excluding Google Fonts
and Analytics). Yet, it is highly customizable and degrades gracefully in older
browsers.
## Quick start
Install with `pip`:
``` sh
pip install mkdocs-material
```
Add the following line to your `mkdocs.yml`:
``` yaml
theme: 'material'
```
## Features
- Beautiful, readable and very user-friendly design based on Google's material
design guidelines, packed in a full responsive template with a well-defined
color palette, great typography, as well as a beautiful search interface and
footer.
and [easily customizable color palette][], great typography, as well as a
beautiful search interface and footer.
- Well-tested and optimized Javascript and CSS including a cross-browser
fixed/sticky header, a drawer that even works without Javascript using
@@ -27,14 +41,14 @@ browsers.
the screen is too small and well-defined print styles.
- Extra configuration options like a [project logo][], links to the authors
[GitHub and Twitter accounts][] and display of the amount of stars the
project has on GitHub.
[GitHub and Twitter accounts][], display of the amount of stars the
project has on GitHub and [Google Analytics integration][].
- Easily [extendable and customizable][] due to a well-designed asset pipeline
built on-top of [Gulp][] with `npm` and `bower` and modular and abstracted
style definitions built with [SASS][].
- Web application capability on iOS - when the page is saved to the homescreen,
- Web application capability on iOS when the page is saved to the homescreen,
it behaves and looks like a native application.
See the [getting started guide](getting-started.md) for instructions how to get
@@ -44,7 +58,9 @@ it up and running.
[material design]: https://www.google.com/design/spec/material-design
[checkbox hack]: http://tutorialzine.com/2015/08/quick-tip-css-only-dropdowns-with-the-checkbox-hack/
[project logo]: getting-started.md#adding-a-logo
[easily customizable color palette]: getting-started.md#changing-the-color-palette
[GitHub and Twitter accounts]: getting-started.md#adding-a-github-and-twitter-account
[Google Analytics integration]: getting-started.md#google-analytics-integration
[extendable and customizable]: customization.md
[Gulp]: http://gulpjs.com
[SASS]: http://sass-lang.com
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+32 -27
View File
@@ -34,9 +34,9 @@
{% if config.extra.logo %}
<link rel="apple-touch-icon" href="{{ base_url }}/{{ config.extra.logo }}">
{% endif %}
{% set icon = icon | default('assets/images/favicon-e565ddfa3b.ico') %}
<link rel="shortcut icon" type="image/x-icon" href="{{ base_url }}/{{ icon }}">
<link rel="icon" type="image/x-icon" href="{{ base_url }}/{{ icon }}">
{% set favicon = favicon | default("assets/images/favicon-e565ddfa3b.ico", true) %}
<link rel="shortcut icon" type="image/x-icon" href="{{ base_url }}/{{ favicon }}">
<link rel="icon" type="image/x-icon" href="{{ base_url }}/{{ favicon }}">
<style>
@font-face {
font-family: 'Icon';
@@ -53,18 +53,15 @@
font-style: normal;
}
</style>
<link rel="stylesheet" href="{{ base_url }}/assets/stylesheets/application-eaf860cca2.css">
{% if config.extra.font != 'none' %}
{% set text = 'Ubuntu' %}
{% if config.extra.font and config.extra.font.text %}
{% set text = config.extra.font.text %}
{% endif %}
{% set code = 'Ubuntu Mono' %}
{% if config.extra.font and config.extra.font.code %}
{% set code = config.extra.font.code %}
{% endif %}
<link rel="stylesheet" href="{{ base_url }}/assets/stylesheets/application-a422ff04cc.css">
{% if config.extra.palette %}
<link rel="stylesheet" href="{{ base_url }}/assets/stylesheets/palettes-05ab2406df.css">
{% endif %}
{% if config.extra.font != "none" %}
{% set text = config.extra.get("font", {}).text | default("Ubuntu") %}
{% set code = config.extra.get("font", {}).code | default("Ubuntu Mono") %}
{% set font = text + ':400,700|' + code | replace(' ', '+') %}
<link rel="stylesheet" href="//fonts.googleapis.com/css?family={{ font }}">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family={{ font }}">
<style>
body, input {
font-family: '{{ text }}', Helvetica, Arial, sans-serif;
@@ -80,10 +77,13 @@
<script src="{{ base_url }}/assets/javascripts/modernizr-4ab42b99fd.js"></script>
{% block extrahead %}{% endblock %}
</head>
<body>
{% if repo_name == 'GitHub' and repo_url %}
{% set repo_id = repo_url | replace('https://github.com/', '') %}
{% if repo_id[-1:] == '/' %}
{% set palette = config.extra.get("palette", {}) %}
{% set primary = palette.primary | replace(' ', '-') | lower %}
{% set accent = palette.accent | replace(' ', '-') | lower %}
<body class="{% if primary %}palette-primary-{{ primary }}{% endif %} {% if accent %}palette-accent-{{ accent }}{% endif %}">
{% if repo_name == "GitHub" and repo_url %}
{% set repo_id = repo_url | replace("https://github.com/", "") %}
{% if repo_id[-1:] == "/" %}
{% set repo_id = repo_id[:-1] %}
{% endif %}
{% endif %}
@@ -104,11 +104,7 @@
<article class="article">
<div class="wrapper">
{% if not h1 %}
{% if page_title %}
<h1>{{ page_title }}</h1>
{% else %}
<h1>{{ site_name }}</h1>
{% endif %}
<h1>{{ page_title | default(site_name, true)}}</h1>
{% endif %}
{{ content }}
<aside class="copyright" role="note">
@@ -128,7 +124,8 @@
{% include "footer.html" %}
</footer>
{% endblock %}
</div></article>
</div>
</article>
<div class="results" role="status" aria-live="polite">
<div class="scrollable">
<div class="wrapper">
@@ -142,7 +139,7 @@
var base_url = '{{ base_url }}';
var repo_id = '{{ repo_id }}';
</script>
<script src="{{ base_url }}/assets/javascripts/application-a10a824a49.js"></script>
<script src="{{ base_url }}/assets/javascripts/application-997097ee0c.js"></script>
{% for path in extra_javascript %}
<script src="{{ path }}"></script>
{% endfor %}
@@ -154,7 +151,7 @@
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;
m.parentNode.insertBefore(a,m)
})(window, document,
'script', '//www.google-analytics.com/analytics.js', 'ga');
'script', 'https://www.google-analytics.com/analytics.js', 'ga');
/* General initialization */
ga('create', '{{ google_analytics[0] }}', '{{ google_analytics[1] }}');
ga('set', 'anonymizeIp', true);
@@ -162,13 +159,21 @@
/* Track outbound links */
var buttons = document.querySelectorAll('a');
Array.prototype.map.call(buttons, function(item) {
if (item.host != window.location.host) {
if (item.host != document.location.host) {
item.addEventListener('click', function() {
var action = item.getAttribute('data-action') || 'follow';
ga('send', 'event', 'outbound', action, item.href);
});
}
});
/* Register handler to log search on blur */
var query = document.querySelector('.query');
query.addEventListener('blur', function() {
if (this.value) {
var path = document.location.pathname;
ga('send', 'pageview', path + '?q=' + this.value);
}
});
</script>
{% endif %}
</body>
+12 -7
View File
@@ -1,5 +1,5 @@
<nav aria-label="Navigation">
{% set home = repo_url | default('/', true) %}
{% set home = repo_url | default("/", true) %}
<a href="{{ home }}" class="project">
<div class="banner">
{% if config.extra.logo %}
@@ -8,7 +8,12 @@
</div>
{% endif %}
<div class="name">
<strong>{{ site_name }} {{ config.extra.version }}</strong>
<strong>
{{ site_name }}
<span class="version">
{{ config.extra.version }}
</span>
</strong>
{% if repo_id %}
<br>
{{ repo_id }}
@@ -18,17 +23,17 @@
</a>
<div class="scrollable">
<div class="wrapper">
{% if repo_name == 'GitHub' and repo_url %}
{% if repo_name == "GitHub" and repo_url %}
<ul class="repo">
<li class="repo-download">
{% set version = config.extra.version | default('master') %}
<a href="{{ repo_url }}/archive/{{ version }}.zip" target="_blank" title="Download {{ site_name }} from GitHub" data-action="download">
{% set version = config.extra.version | default("master") %}
<a href="{{ repo_url }}/archive/{{ version }}.zip" target="_blank" title="Download" data-action="download">
<i class="icon icon-download"></i> Download
</a>
</li>
<li class="repo-stars">
<a href="{{ repo_url }}" target="_blank" title="Star {{ site_name }} on GitHub" data-action="star">
<i class="icon icon-star"></i> Star
<a href="{{ repo_url }}/stargazers" target="_blank" title="Stargazers" data-action="star">
<i class="icon icon-star"></i> Stars
<span class="count">&ndash;</span>
</a>
</li>
+6 -2
View File
@@ -3,7 +3,9 @@
<div class="previous">
{% if previous_page %}
<a href="{{ previous_page.url }}" title="{{ previous_page.title }}">
<span class="direction">Previous</span>
<span class="direction">
{{ config.extra.get("i18n", {}).prev | default("Previous") }}
</span>
<div class="page">
<div class="button button-previous" role="button" aria-label="Previous">
<i class="icon icon-back"></i>
@@ -20,7 +22,9 @@
<div class="next">
{% if next_page %}
<a href="{{ next_page.url }}" title="{{ next_page.title }}">
<span class="direction">Next</span>
<span class="direction">
{{ config.extra.get("i18n", {}).next | default("Next") }}
</span>
<div class="page">
<div class="stretch">
<div class="title">
+7 -9
View File
@@ -19,21 +19,19 @@
{% endfor %}
</span>
{% endif %}
{% if page_title %}
{{ page_title }}
{% else %}
{{ site_name }}
{% endif %}
{{ page_title | default(site_name, true) }}
</div>
</div>
{% if config.extra.author and config.extra.author.twitter %}
{% if config.extra.get("author", {}).twitter %}
{% set author = config.extra.author.twitter %}
<div class="button button-twitter" role="button" aria-label="Twitter">
<a href="https://twitter.com/{{ config.extra.author.twitter }}" title="@{{ config.extra.author.twitter }} on Twitter" target="_blank" class="toggle-button icon icon-twitter"></a>
<a href="https://twitter.com/{{ author }}" title="@{{ author }} on Twitter" target="_blank" class="toggle-button icon icon-twitter"></a>
</div>
{% endif %}
{% if config.extra.author and config.extra.author.github %}
{% if config.extra.get("author", {}).github %}
{% set author = config.extra.author.github %}
<div class="button button-github" role="button" aria-label="GitHub">
<a href="https://github.com/{{ config.extra.author.github }}" title="@{{ config.extra.author.github }} on GitHub" target="_blank" class="toggle-button icon icon-github"></a>
<a href="https://github.com/{{ author }}" title="@{{ author }} on GitHub" target="_blank" class="toggle-button icon icon-github"></a>
</div>
{% endif %}
<div class="button button-search" role="button" aria-label="Search">
+3 -2
View File
@@ -1,6 +1,7 @@
{
"assets/images/favicon.ico": "assets/images/favicon-e565ddfa3b.ico",
"assets/javascripts/application.js": "assets/javascripts/application-a10a824a49.js",
"assets/javascripts/application.js": "assets/javascripts/application-997097ee0c.js",
"assets/javascripts/modernizr.js": "assets/javascripts/modernizr-4ab42b99fd.js",
"assets/stylesheets/application.css": "assets/stylesheets/application-eaf860cca2.css"
"assets/stylesheets/application.css": "assets/stylesheets/application-a422ff04cc.css",
"assets/stylesheets/palettes.css": "assets/stylesheets/palettes-05ab2406df.css"
}
+3 -4
View File
@@ -3,7 +3,7 @@
<span class="section">{{ nav_item.title }}</span>
<ul>
{% for nav_item in nav_item.children %}
{% include 'nav.html' %}
{% include "nav.html" %}
{% endfor %}
</ul>
</li>
@@ -14,10 +14,9 @@
</a>
{% if nav_item == current_page %}
{% if h1 %}
{% set toc_item = toc | first %}
{% set toc = toc_item.children %}
{% set toc = (toc | first).children %}
{% endif %}
{% if toc %}
{% if toc and (toc | first) %}
<ul>
{% for toc_item in toc %}
<li class="anchor">
+2 -5
View File
@@ -36,11 +36,8 @@ theme_dir: material
# Options
extra:
version: 0.1.3
version: 0.2.4
logo: images/logo.png
font:
text: Ubuntu
code: Ubuntu Mono
author:
github: squidfunk
twitter: squidfunk
@@ -50,7 +47,7 @@ markdown_extensions:
- codehilite(css_class=code)
- admonition
- toc:
permalink:
permalink: '#'
# Page tree
pages:
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "mkdocs-material",
"version": "0.1.3",
"version": "0.2.4",
"description": "A material design theme for MkDocs",
"homepage": "http://squidfunk.github.io/mkdocs-material/",
"authors": [
+1 -1
View File
@@ -23,7 +23,7 @@ from setuptools import setup, find_packages
# Package description
setup(
name = 'mkdocs-material',
version = '0.1.3',
version = '0.2.4',
url = 'http://squidfunk.github.io/mkdocs-material/',
license = 'MIT',
description = 'A material design theme for MkDocs',
+4 -1
View File
@@ -253,7 +253,7 @@ document.addEventListener('DOMContentLoaded', function() {
/* Close search and jump to anchor when on same page */
var parts = link.href.split('#');
if (parts[0] == window.location.href.split('#')[0]) {
if (parts[0] == document.location.href.split('#')[0]) {
link.addEventListener('click', function(e) {
document.body.classList.remove('toggle-search');
document.body.classList.remove('locked');
@@ -373,6 +373,9 @@ document.addEventListener('DOMContentLoaded', function() {
window.addEventListener('keyup', function(e) {
var code = e.keyCode || e.which;
if (code == 27) {
query.blur();
/* Exit locked state */
document.body.classList.remove('toggle-search');
document.body.classList.remove('locked');
toggle.checked = false;
+15 -1
View File
@@ -55,10 +55,24 @@ pre {
/*
* Types and functions
*/
.kt, .kd, .n.f {
.kt, .kd {
color: #0086B3;
}
/*
* Function definition
*/
.nf, .n.f {
color: #795da3;
}
/*
* Classes
*/
.nx {
color: #0086b3;
}
/*
* Strings
*/
+8
View File
@@ -72,6 +72,14 @@ time, mark, audio, video {
border: 0;
}
/*
* Enforce correct rendering of main element - missing in user agent stylesheet
* of IE11 on Windows 7.
*/
main {
display: block;
}
/*
* Reset list styles
*/
@@ -46,10 +46,29 @@
/*
* Headlines, chapters, links and inline code
*/
h1, h2, a, code {
h1, h2, a {
color: $primary;
}
/*
* Inline code
*/
code {
background: #eee;
}
/*
* Keyboard tags
*/
kbd {
color: #555;
background-color: #fcfcfc;
border: solid 1px #ccc;
border-bottom-color: #bbb;
border-radius: 3px;
box-shadow: inset 0 -1px 0 #bbb;
}
/*
* Lower border for main headline
*/
@@ -57,11 +76,17 @@
border-bottom: 1px solid $black-lightest;
}
/*
* Underline links
*/
a {
border-bottom: 1px dotted;
}
/*
* Hovered and focused links
*/
a:hover,
a:focus {
a:hover, a:focus {
color: $accent;
}
@@ -70,6 +95,7 @@
*/
.headerlink {
color: $black-lighter;
border: none;
}
/*
@@ -86,20 +112,6 @@
th {
background: mix($primary, $white, 75%);
color: $white;
/*
* Round upper left border
*/
&:first-child {
border-top-left-radius: 3px;
}
/*
* Round upper right border
*/
&:last-child {
border-top-right-radius: 3px;
}
}
/*
@@ -109,6 +121,14 @@
border-top: 1px solid rgba($black, 0.05);
}
}
/*
* Blockquote styles
*/
blockquote {
border-left: 2px solid $black-light;
color: $black-light;
}
}
/*
@@ -117,6 +137,13 @@
.footer {
background: $primary;
color: $white;
/*
* Remove bottom border on links
*/
a {
border: none;
}
}
/*
@@ -166,4 +193,11 @@
&.warning {
background: $red-400;
}
/*
* Headlines, chapters, links and inline code
*/
a, a:hover {
color: $white;
}
}
@@ -190,6 +190,16 @@
*/
p > code {
white-space: nowrap;
padding: 2px 4px;
}
/*
* Keyboard tags
*/
kbd {
display: inline-block;
padding: 3px 5px;
line-height: 10px;
}
/*
@@ -223,6 +233,7 @@
table {
margin: 3.0em 0 1.5em;
font-size: 13px;
overflow: hidden;
/*
* The semi-cool solution, in case javascript is not available
@@ -242,7 +253,7 @@
padding: 12px 16px;
font-size: 12px;
text-align: left;
white-space: nowrap;
vertical-align: top;
}
/*
@@ -250,10 +261,17 @@
*/
td {
padding: 12px 16px;
white-space: nowrap;
vertical-align: top;
}
}
/*
* Blockquote styles
*/
blockquote {
padding-left: 16px;
}
/*
* Data table wrapper, in case javascript is available
*/
@@ -46,7 +46,7 @@ body, input {
/*
* Proportional fonts
*/
pre, code {
pre, code, kbd {
font-family: 'Courier New', 'Courier', monospace;
/*
@@ -74,14 +74,14 @@
}
/*
* Nested links
* Nested links and anchors
*/
.toc li ul {
margin-left: 12px;
}
/*
*
* Nested anchors
*/
.current + ul {
margin-bottom: 9px;
+221
View File
@@ -0,0 +1,221 @@
/*
* Copyright (c) 2016 Martin Donath <martin.donath@squidfunk.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
* IN THE SOFTWARE.
*/
/* ----------------------------------------------------------------------------
* Dependencies
* ------------------------------------------------------------------------- */
@import "bourbon";
@import "quantum-colors";
@import "quantum-shadows";
/* ----------------------------------------------------------------------------
* Application
* ------------------------------------------------------------------------- */
@import "palette";
@import "mixins/break";
/* ----------------------------------------------------------------------------
* Palette
* ------------------------------------------------------------------------- */
/*
* Build primary palette
*/
@each $name, $color in (
'red': $red-400,
'pink': $pink-500,
'purple': $purple-400,
'deep-purple': $deep-purple-400,
'indigo': $indigo-500,
'blue': $blue-500,
'light-blue': $light-blue-500,
'cyan': $cyan-500,
'teal': $teal-500,
'green': $green-500,
'light-green': $light-green-600,
'lime': $lime-600,
'yellow': $yellow-800,
'amber': $amber-600,
'orange': $orange-600,
'deep-orange': $deep-orange-400,
'brown': $brown-500,
'grey': $grey-600,
'blue-grey': $blue-grey-600
) {
/*
* Device specific background hacks related to rubberband
*/
.palette-primary-#{$name} {
/* Hack [Chrome, Opera]: Set background color in Chrome and Opera */
@supports (-webkit-appearance: none) {
background: $color;
}
/*
* Application header and footer
*/
.header, .footer {
background: $color;
}
/*
* Drawer container
*/
.drawer {
/*
* Color links
*/
.toc a {
/*
* Current active element
*/
&.current {
color: $color;
}
/*
* Hovered link
*/
&:hover, &:focus {
color: $color;
}
}
/*
* Color anchors menu
*/
.anchor a {
border-left: 2px solid $color;
}
}
/*
* Project information
*/
.project {
/* [tablet landscape-]: Set background color */
@include break-to-device(tablet landscape) {
background: $color;
}
}
/*
* Article
*/
.article {
/*
* Differing top and bottom rubberband backgrounds in iOS web application
*/
.ios.standalone & {
background: linear-gradient(
to bottom, $white 50%, $color 50%);
}
/*
* Headlines, chapters, links and inline code
*/
h1, h2, a, code {
color: $color;
}
/*
* Light permalinks
*/
.headerlink {
color: $black-lighter;
}
/*
* Data table headings
*/
table th {
background: mix($color, $white, 75%);
}
}
/*
* Search meta data
*/
.results .meta {
background: $color;
}
}
}
/*
* Build accent palette
*/
@each $name, $color in (
'red': $red-a400,
'pink': $pink-a400,
'purple': $purple-a200,
'deep-purple': $deep-purple-a200,
'indigo': $indigo-a200,
'blue': $blue-a200,
'light-blue': $light-blue-a700,
'cyan': $cyan-a700,
'teal': $teal-a700,
'green': $green-a700,
'light-green': $light-green-a700,
'lime': $lime-a700,
'yellow': $yellow-a700,
'amber': $amber-a700,
'orange': $orange-a400,
'deep-orange': $deep-orange-a200
) {
/*
* Device specific background hacks related to rubberband
*/
.palette-accent-#{$name} {
/*
* Article
*/
.article {
/*
* Hovered and focused links
*/
a:hover,
a:focus {
color: $color;
}
}
/*
* Repository buttons
*/
.repo a {
background: $color;
}
}
}
+39 -26
View File
@@ -58,11 +58,11 @@
{% endif %}
<!-- Favicon -->
{% set icon = icon | default('assets/images/favicon.ico') %}
{% set favicon = favicon | default("assets/images/favicon.ico", true) %}
<link rel="shortcut icon" type="image/x-icon"
href="{{ base_url }}/{{ icon }}" />
href="{{ base_url }}/{{ favicon }}" />
<link rel="icon" type="image/x-icon"
href="{{ base_url }}/{{ icon }}" />
href="{{ base_url }}/{{ favicon }}" />
<!-- Configure icons (placed here to omit issues with subdirectories) -->
<style>
@@ -86,19 +86,19 @@
<link rel="stylesheet" type="text/css"
href="{{ base_url }}/assets/stylesheets/application.css" />
<!-- Extra palettes -->
{% if config.extra.palette %}
<link rel="stylesheet" type="text/css"
href="{{ base_url }}/assets/stylesheets/palettes.css" />
{% endif %}
<!-- Configure webfonts -->
{% if config.extra.font != 'none' %}
{% set text = 'Ubuntu' %}
{% if config.extra.font and config.extra.font.text %}
{% set text = config.extra.font.text %}
{% endif %}
{% set code = 'Ubuntu Mono' %}
{% if config.extra.font and config.extra.font.code %}
{% set code = config.extra.font.code %}
{% endif %}
{% if config.extra.font != "none" %}
{% set text = config.extra.get("font", {}).text | default("Ubuntu") %}
{% set code = config.extra.get("font", {}).code | default("Ubuntu Mono") %}
{% set font = text + ':400,700|' + code | replace(' ', '+') %}
<link rel="stylesheet" type="text/css"
href="//fonts.googleapis.com/css?family={{ font }}" />
href="https://fonts.googleapis.com/css?family={{ font }}" />
<style>
body, input {
font-family: '{{ text }}', Helvetica, Arial, sans-serif;
@@ -120,16 +120,24 @@
<!-- Custom header -->
{% block extrahead %}{% endblock %}
</head>
<body>
<!-- Define palette -->
{% set palette = config.extra.get("palette", {}) %}
{% set primary = palette.primary | replace(' ', '-') | lower %}
{% set accent = palette.accent | replace(' ', '-') | lower %}
<body class="
{% if primary %}palette-primary-{{ primary }}{% endif %}
{% if accent %}palette-accent-{{ accent }}{% endif %}
">
<!--
Sadly the jinja template engine is not very flexible - it doesn't support
regular expressions out-of-the-box. Since there might be a slash at the
end of the repository name, we just do a string comparison and kill it.
-->
{% if repo_name == 'GitHub' and repo_url %}
{% set repo_id = repo_url | replace('https://github.com/', '') %}
{% if repo_id[-1:] == '/' %}
{% if repo_name == "GitHub" and repo_url %}
{% set repo_id = repo_url | replace("https://github.com/", "") %}
{% if repo_id[-1:] == "/" %}
{% set repo_id = repo_id[:-1] %}
{% endif %}
{% endif %}
@@ -173,11 +181,7 @@
<!-- Headline -->
{% if not h1 %}
{% if page_title %}
<h1>{{ page_title }}</h1>
{% else %}
<h1>{{ site_name }}</h1>
{% endif %}
<h1>{{ page_title | default(site_name, true)}}</h1>
{% endif %}
<!-- Article content -->
@@ -204,8 +208,8 @@
{% include "footer.html" %}
</footer>
{% endblock %}
</article>
</div>
</div>
</article>
<!-- Search results -->
<div class="results" role="status" aria-live="polite">
@@ -237,7 +241,7 @@
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;
m.parentNode.insertBefore(a,m)
})(window, document,
'script', '//www.google-analytics.com/analytics.js', 'ga');
'script', 'https://www.google-analytics.com/analytics.js', 'ga');
/* General initialization */
ga('create', '{{ google_analytics[0] }}', '{{ google_analytics[1] }}');
@@ -247,13 +251,22 @@
/* Track outbound links */
var buttons = document.querySelectorAll('a');
Array.prototype.map.call(buttons, function(item) {
if (item.host != window.location.host) {
if (item.host != document.location.host) {
item.addEventListener('click', function() {
var action = item.getAttribute('data-action') || 'follow';
ga('send', 'event', 'outbound', action, item.href);
});
}
});
/* Register handler to log search on blur */
var query = document.querySelector('.query');
query.addEventListener('blur', function() {
if (this.value) {
var path = document.location.pathname;
ga('send', 'pageview', path + '?q=' + this.value);
}
});
</script>
{% endif %}
</body>
+13 -10
View File
@@ -1,6 +1,6 @@
<!-- Navigation -->
<nav aria-label="Navigation">
{% set home = repo_url | default('/', true) %}
{% set home = repo_url | default("/", true) %}
<!-- Project information -->
<a href="{{ home }}" class="project">
@@ -17,7 +17,12 @@
<!-- Project name and verison -->
<div class="name">
<strong>{{ site_name }} {{ config.extra.version }}</strong>
<strong>
{{ site_name }}
<span class="version">
{{ config.extra.version }}
</span>
</strong>
<!-- Project repository name -->
{% if repo_id %}
@@ -33,21 +38,19 @@
<div class="wrapper">
<!-- Repository -->
{% if repo_name == 'GitHub' and repo_url %}
{% if repo_name == "GitHub" and repo_url %}
<ul class="repo">
<li class="repo-download">
{% set version = config.extra.version | default('master') %}
{% set version = config.extra.version | default("master") %}
<a href="{{ repo_url }}/archive/{{ version }}.zip" target="_blank"
title="Download {{ site_name }} from GitHub"
data-action="download">
title="Download" data-action="download">
<i class="icon icon-download"></i> Download
</a>
</li>
<li class="repo-stars">
<a href="{{ repo_url }}" target="_blank"
title="Star {{ site_name }} on GitHub"
data-action="star">
<i class="icon icon-star"></i> Star
<a href="{{ repo_url }}/stargazers" target="_blank"
title="Stargazers" data-action="star">
<i class="icon icon-star"></i> Stars
<span class="count">&ndash;</span>
</a>
</li>
+6 -2
View File
@@ -6,7 +6,9 @@
<div class="previous">
{% if previous_page %}
<a href="{{ previous_page.url }}" title="{{ previous_page.title }}">
<span class="direction">Previous</span>
<span class="direction">
{{ config.extra.get("i18n", {}).prev | default("Previous") }}
</span>
<div class="page">
<div class="button button-previous"
role="button" aria-label="Previous">
@@ -26,7 +28,9 @@
<div class="next">
{% if next_page %}
<a href="{{ next_page.url }}" title="{{ next_page.title }}">
<span class="direction">Next</span>
<span class="direction">
{{ config.extra.get("i18n", {}).next | default("Next") }}
</span>
<div class="page">
<div class="stretch">
<div class="title">
+9 -11
View File
@@ -26,28 +26,26 @@
{% endfor %}
</span>
{% endif %}
{% if page_title %}
{{ page_title }}
{% else %}
{{ site_name }}
{% endif %}
{{ page_title | default(site_name, true) }}
</div>
</div>
<!-- Twitter -->
{% if config.extra.author and config.extra.author.twitter %}
{% if config.extra.get("author", {}).twitter %}
{% set author = config.extra.author.twitter %}
<div class="button button-twitter" role="button" aria-label="Twitter">
<a href="https://twitter.com/{{ config.extra.author.twitter }}"
title="@{{ config.extra.author.twitter }} on Twitter" target="_blank"
<a href="https://twitter.com/{{ author }}"
title="@{{ author }} on Twitter" target="_blank"
class="toggle-button icon icon-twitter"></a>
</div>
{% endif %}
<!-- GitHub -->
{% if config.extra.author and config.extra.author.github %}
{% if config.extra.get("author", {}).github %}
{% set author = config.extra.author.github %}
<div class="button button-github" role="button" aria-label="GitHub">
<a href="https://github.com/{{ config.extra.author.github }}"
title="@{{ config.extra.author.github }} on GitHub" target="_blank"
<a href="https://github.com/{{ author }}"
title="@{{ author }} on GitHub" target="_blank"
class="toggle-button icon icon-github"></a>
</div>
{% endif %}
+3 -4
View File
@@ -6,7 +6,7 @@
<!-- Render pages of section -->
{% for nav_item in nav_item.children %}
{% include 'nav.html' %}
{% include "nav.html" %}
{% endfor %}
</ul>
</li>
@@ -29,12 +29,11 @@
with the children of the anchor.
-->
{% if h1 %}
{% set toc_item = toc | first %}
{% set toc = toc_item.children %}
{% set toc = (toc | first).children %}
{% endif %}
<!-- Render anchors of active page -->
{% if toc %}
{% if toc and (toc | first) %}
<ul>
{% for toc_item in toc %}