Skip to content

Commit

Permalink
Merge pull request #530 from d0ugal/package-themes
Browse files Browse the repository at this point in the history
Move builtin themes to external packages other than MkDocs and ReadTheDocs
  • Loading branch information
d0ugal committed Jun 27, 2015
2 parents 8172bcb + 764b24b commit ff05df3
Show file tree
Hide file tree
Showing 242 changed files with 764 additions and 28,724 deletions.
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ env:
- TOXENV=flake8
install:
- pip install tox
script: tox
script:
- git clean -f -d -x
- tox
matrix:
fast_finish: true
before_install: pip install codecov
Expand Down
4 changes: 3 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
recursive-include mkdocs/themes *.ico *.js *.css *.png *.html *.eot *.svg *.ttf *.woff
include README.md
include LICENSE.md
recursive-include mkdocs *.ico *.js *.css *.png *.html *.eot *.svg *.ttf *.woff *.xml
recursive-exclude * __pycache__
recursive-exclude * *.py[co]
10 changes: 7 additions & 3 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
build: false
environment:
matrix:
- TOXENV: py27-unittests
- TOXENV: py33-unittests
- TOXENV: py34-unittests
- TOXENV: py27-integration
- TOXENV: py27-min-req
- TOXENV: py27-unittests
- TOXENV: py33-integration
- TOXENV: py33-min-req
- TOXENV: py33-unittests
- TOXENV: py34-integration
- TOXENV: py34-min-req
- TOXENV: py34-unittests
- TOXENV: flake8
init:
- "ECHO %TOXENV%"
Expand All @@ -18,6 +21,7 @@ install:
- "c:\\python27\\python c:\\get-pip.py"
- "c:\\python27\\Scripts\\pip install tox"
test_script:
- "git clean -f -d -x"
- "c:\\python27\\Scripts\\tox --version"
- "c:\\python27\\Scripts\\pip --version"
- "c:\\python27\\Scripts\\tox"
30 changes: 29 additions & 1 deletion docs/about/release-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,42 @@ You can determine your currently installed version using `mkdocs --version`:

## Version 0.15.0 (2015-??-??)

### Major Additions

#### Add support for installable themes

MkDocs now supports themes that are distributed via Python packages. With this
addition, the Bootstrap and Bootswatch themes have been moved to external git
repositories and python packages. See their individual documentation for more
details about these specific themes.

- [MkDocs Bootstrap]
- [MkDocs Bootswatch]

[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 installable with pip: `pip install mkdocs-bootstrap` and `pip
install mkdocs-bootswatch`

See the documentation for [Styling your docs] for more information about using
and customising themes and [Custom themes] for creating and distributing new
themes

[Styling your docs]: /user-guide/styling-your-docs.md
[Custom themes]: /user-guide/custom-themes.md

### Other Changes and Additions

* Fix issues when using absolute links to Markdown files. (#628)
* Add support for [site_description] and [site_author] to the [ReadTheDocs]
theme. (#631)
* Bugfix: Ensure consistent ordering of auto-populated pages. (#638)

[site_description]: /user-guide/configuration.md#site_description
[site_author]: /user-guide/configuration.md#site_author
[ReadTheDocs]: /user-guide/styling-your-docs.md#read-the-docs
[ReadTheDocs]: /user-guide/styling-your-docs.md#readthedocs

## Version 0.14.0 (2015-06-09)

Expand Down
4 changes: 4 additions & 0 deletions docs/css/extra.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,7 @@ div.col-md-9 p.admonition-title:first-of-type {
div.col-md-9 h1:first-of-type .headerlink {
display: none;
}

code.no-highlight {
color: black;
}
77 changes: 50 additions & 27 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,23 +38,29 @@ Get your project documentation looking just the way you want it by customizing t

In order to install MkDocs you'll need [Python] installed on your system, as well as the Python package manager, [pip]. You can check if you have these already installed like so:

$ python --version
Python 2.7.2
$ pip --version
pip 1.5.2
```bash
$ python --version
Python 2.7.2
$ pip --version
pip 1.5.2
```

MkDocs supports Python 2.6, 2.7, 3.3 and 3.4.

On Windows we recommend that you install Python and pip with [Chocolatey].

Install the `mkdocs` package using pip:

$ pip install mkdocs
```bash
$ pip install mkdocs
```

You should now have the `mkdocs` command installed on your system. Run `mkdocs --version` to check that everything worked okay.

$ mkdocs --version
mkdocs, version 0.14.0
```bash
$ mkdocs --version
mkdocs, version 0.14.0
```

---

Expand All @@ -63,8 +69,10 @@ You should now have the `mkdocs` command installed on your system. Run `mkdocs

Getting started is super easy.

$ mkdocs new my-project
$ cd my-project
```bash
$ mkdocs new my-project
$ cd my-project
```

Let's take a moment to review the initial project that's been created for us.

Expand All @@ -74,8 +82,10 @@ There's a single configuration file named `mkdocs.yml`, and a folder named `docs

MkDocs comes with a built-in webserver that lets you preview your documentation as you work on it. We start the webserver by making sure we're in the same directory as the `mkdocs.yml` config file, and then running the `mkdocs serve` command:

$ mkdocs serve
Running at: http://127.0.0.1:8000/
```bash
$ mkdocs serve
Running at: http://127.0.0.1:8000/
```

Open up [http://127.0.0.1:8000/](http://127.0.0.1:8000/) in your browser, and you'll see the index page being displayed:

Expand All @@ -99,27 +109,32 @@ Go ahead and edit the `doc/index.md` document, and change the initial heading to

Let's also add a second page to our documentation:

$ curl 'jaspervdj.be/lorem-markdownum/markdown.txt' > docs/about.md
```bash
$ curl 'jaspervdj.be/lorem-markdownum/markdown.txt' > docs/about.md
```

We'd like our documentation site to include some navigation headers, so we'll edit the configuration file and add some information about the order and title to use for out headers:

site_name: MkLorum
pages:
- Home: index.md
- About: about.md
```no-highlight
site_name: MkLorum
pages:
- Home: index.md
- About: about.md
```

Refresh the browser and you'll now see a navigation bar with `Home` and `About` headers.

## Theming our documentation

While we're here can also change the configuration file to alter how the documentation is displayed. Let's go ahead and change the theme. Edit the `mkdocs.yml` file to the following:

site_name: MkLorum
pages:
- Home: index.md
- About: about.md
theme: readthedocs

```no-highlight
site_name: MkLorum
pages:
- Home: index.md
- About: about.md
theme: readthedocs
```

Refresh the browser again, and you'll now see the ReadTheDocs theme being used.

Expand All @@ -129,24 +144,32 @@ Refresh the browser again, and you'll now see the ReadTheDocs theme being used.

That's looking good. We're ready to deploy the first pass of our `MkLorum` documentation now. Let's build the documentation.

$ mkdocs build
```bash
$ mkdocs build
```

This will create a new directory, named `site`. Let's take a look inside the directory:

$ ls site
about css fonts img index.html js
```bash
$ ls site
about css fonts img index.html js
```

Notice that our source documentation has been output as two HTML files named `index.html` and `about/index.html`. We also have various other media that's been copied into the `site` directory as part of the documentation theme.

If you're using source code control such as `git` you probably don't want to check your documentation builds into the repository. Add a line containing `site/` to your `.gitignore` file.

$ echo "site/" >> .gitignore
```bash
$ echo "site/" >> .gitignore
```

If you're using another source code control you'll want to check it's documentation on how to ignore specific directories.

After some time, files may be removed from the documentation but they will still reside in the `site` directory. To remove those stale files, just run mkdocs with the `--clean` switch.

$ mkdocs build --clean
```bash
$ mkdocs build --clean
```


## Deploying
Expand Down
Loading

0 comments on commit ff05df3

Please sign in to comment.