Skip to content

Commit

Permalink
Merge pull request #841 from d0ugal/remove-external-themes
Browse files Browse the repository at this point in the history
Remove external themes from MkDocs
  • Loading branch information
d0ugal committed Mar 1, 2016
2 parents e839df3 + cc1c9a3 commit a171479
Show file tree
Hide file tree
Showing 10 changed files with 35 additions and 105 deletions.
6 changes: 1 addition & 5 deletions docs/about/license.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,9 @@ The legal stuff.

## Included projects

Themes used under license from the Bootstrap, ReadTheDocs, GhostWriter and
Bootswatch projects.
Themes used under license from the ReadTheDocs projects.

* Bootstrap theme - [View license](//github.com/twbs/bootstrap/blob/master/LICENSE).
* ReadTheDocs theme - [View license](//github.com/snide/sphinx_rtd_theme/blob/master/LICENSE).
* Bootswatch theme - [View license](//github.com/thomaspark/bootswatch/blob/gh-pages/LICENSE).
* Highlight.js GitHub theme - [View license](//github.com/isagalaev/highlight.js/blob/master/LICENSE).

Many thanks to the authors and contributors of those wonderful projects.

Expand Down
2 changes: 1 addition & 1 deletion docs/about/release-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ details about these specific themes.
[MkDocs Bootstrap]: http://mkdocs.github.io/mkdocs-bootstrap/
[MkDocs Bootswatch]: http://mkdocs.github.io/mkdocs-bootswatch/

They will be included with MkDocs by default until the 1.0 release. After that
They will be included with MkDocs by default until a future release. After that
they will be installable with pip: `pip install mkdocs-bootstrap` and `pip
install mkdocs-bootswatch`

Expand Down
10 changes: 5 additions & 5 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ S3, or anywhere else you choose.

### Great themes available

There's a stack of good looking themes included by default. Choose from
bootstrap, readthedocs, or any of the 12 bootswatch themes.
You can also check out a list of 3rd party themes in the
[MkDocs wiki](https://github.com/mkdocs/mkdocs/wiki/MkDocs-Themes),
or better yet, add your own.
There's a stack of good looking themes available for MkDocs. Choose between
the built in themes [mkdocs](/user-guide/styling-your-docs/#mkdocs) and
[readthedocs](/user-guide/styling-your-docs/#readthedocs) or check out a list
of 3rd party themes in the [MkDocs wiki](https://github.com/mkdocs/mkdocs/wiki
/MkDocs-Themes) (or better yet, add your own).

### Preview your site as you work

Expand Down
7 changes: 7 additions & 0 deletions docs/user-guide/custom-themes.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ A guide to creating and distributing custom themes.

---

!!! Note

If you are looking for third party themes, they are listed in the MkDocs
[community wiki](https://github.com/mkdocs/mkdocs/wiki/MkDocs-Themes). If
you want to share a theme you create, you should list it on the Wiki.


When creating a new theme, you can either follow the steps in this guide to
create one from scratch or you can download the `mkdocs-basic-theme` as a
basic, yet complete, theme with all the boilerplate required. **You can find
Expand Down
70 changes: 3 additions & 67 deletions docs/user-guide/styling-your-docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,74 +30,10 @@ the [custom themes](#custom-themes) section below.

![ReadTheDocs](https://docs.readthedocs.org/en/latest/_images/screen_mobile.png)

## Bootstrap and Bootswatch themes
### Third Party Themes

MkDocs version 0.x also includes themes provided by two packages, [MkDocs Bootstrap] and
[MkDocs Bootswatch]. The Bootstrap package provides a theme based on [Bootstrap]
and the Bootswatch package provides 12 themes based on the [Bootswatch] project.

!!! note

The Bootstrap and Bootswatch themes will not be included by default from
MkDocs version 1.0. They will need to be installed manually with `pip
install mkdocs-bootstrap` or `pip install mkdocs-bootswatch`.

[Bootstrap]: http://getbootstrap.com/
[Bootswatch]: http://bootswatch.com/
[MkDocs Bootstrap]: http://mkdocs.github.io/mkdocs-bootstrap/
[MkDocs Bootswatch]: http://mkdocs.github.io/mkdocs-bootswatch/

### Bootstrap

![Bootstrap](http://bootstrapdocs.com/v2.3.1/docs/assets/img/examples/bootstrap-example-fluid.png)

### Amelia

![Amelia](http://bootswatch.com/2/amelia/thumbnail.png)

### Cerulean

![Cerulean](http://bootswatch.com/cerulean/thumbnail.png)

### Cosmo

![Cosmo](http://bootswatch.com/cosmo/thumbnail.png)

### Cyborg

![Cyborg](http://bootswatch.com/cyborg/thumbnail.png)

### Flatly

![Flatly](http://bootswatch.com/flatly/thumbnail.png)

### Journal

![Journal](http://bootswatch.com/journal/thumbnail.png)

### Readable

![Readable](http://bootswatch.com/readable/thumbnail.png)

### Simplex

![Simplex](http://bootswatch.com/simplex/thumbnail.png)

### Slate

![Slate](http://bootswatch.com/slate/thumbnail.png)

### Spacelab

![Spacelab](http://bootswatch.com/spacelab/thumbnail.png)

### United

![United](http://bootswatch.com/united/thumbnail.png)

### Yeti

![Yeti](http://bootswatch.com/yeti/thumbnail.png)
Third party themes can be found in the MkDocs [community wiki](
https://github.com/mkdocs/mkdocs/wiki/MkDocs-Themes).

## Customising a Theme

Expand Down
35 changes: 17 additions & 18 deletions mkdocs/config/config_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,30 +297,29 @@ class Theme(OptionallyRequired):
def run_validation(self, value):
themes = utils.get_theme_names()

if value in themes:

# These themes have been moved to the mkdocs-bootstrap and
# mkdocs-bootswatch packages. At some point we wont depend on
# these by default.
moved_themes = [
'bootstrap', 'amelia', 'cerulean', 'cosmo', 'cyborg',
'flatly', 'journal', 'readable', 'simplex', 'slate',
'spacelab', 'united', 'yeti'
]
# These themes have been moved to the mkdocs-bootstrap and
# mkdocs-bootswatch packages. At some point we wont depend on
# these by default.
moved_themes = [
'bootstrap', 'amelia', 'cerulean', 'cosmo', 'cyborg',
'flatly', 'journal', 'readable', 'simplex', 'slate',
'spacelab', 'united', 'yeti'
]

if value not in moved_themes:
return value
if value in themes:
return value

self.warnings.append(
("The theme '{0}' will be removed in an upcoming MkDocs "
"release. See http://www.mkdocs.org/about/release-notes/ "
elif value in moved_themes:
raise ValidationError(
("The theme '{0}' is no longer included in MkDocs by default "
"and must be installed with pip. See http://www.mkdocs.org"
"/about/release-notes/#add-support-for-installable-themes"
"for more details").format(value)
)
return value

raise ValidationError(
"Unrecognised theme '{0}'. The available installed themes"
"are: ".format(value, ', '.join(themes))
"Unrecognised theme '{0}'. The available installed themes "
"are: {1}".format(value, ', '.join(themes))
)


Expand Down
4 changes: 1 addition & 3 deletions mkdocs/tests/utils/utils_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,7 @@ def test_get_themes(self):

self.assertEqual(
sorted(utils.get_theme_names()),
sorted(['flatly', 'cerulean', 'slate', 'bootstrap', 'yeti',
'spacelab', 'united', 'readable', 'simplex', 'mkdocs',
'cosmo', 'journal', 'cyborg', 'readthedocs', 'amelia']))
['mkdocs', 'readthedocs'])

@mock.patch('pkg_resources.iter_entry_points', autospec=True)
def test_get_themes_warning(self, mock_iter):
Expand Down
2 changes: 0 additions & 2 deletions requirements/project-min.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,5 @@ click==3.3
Jinja2==2.7.1
livereload==2.3.2
Markdown==2.5
mkdocs-bootstrap==0.1.1
mkdocs-bootswatch==0.1.0
PyYAML==3.10
tornado==4.1
2 changes: 0 additions & 2 deletions requirements/project.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,5 @@ click>=3.3
Jinja2>=2.7.1
livereload>=2.3.2
Markdown>=2.5
mkdocs-bootstrap>=0.1.1
mkdocs-bootswatch>=0.1.0
PyYAML>=3.10
tornado>=4.1
2 changes: 0 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,6 @@ def get_packages(package):
'Jinja2>=2.7.1',
'livereload>=2.3.2',
'Markdown>=2.3.1,<2.5' if PY26 else 'Markdown>=2.3.1',
'mkdocs-bootstrap>=0.1.1',
'mkdocs-bootswatch>=0.1.0',
'PyYAML>=3.10',
'tornado>=4.1',
],
Expand Down

0 comments on commit a171479

Please sign in to comment.