Skip to content

Commit 67bb54d

Browse files
authored
Refactor docs: split up & slim down read me
Fixes #557 #523 * Remove old conf file setup * Split changelog to its ownfile * Remove changelog from readme * Update introduction sentence * Fix wording of intro * Remove readme table of contents * Move links to there sections * Remove config * Create configuring.rst * Remove todo * Remove installing docs from readme * Create installing.rst * Remove contributing section from readme * Create contributing.rst * Include basic info in readme The rest gets pointed to our actual docs * Add new files to toctree * Fix configuring options title * Set logo_only to True Also, remove documentation of theme options. We have actual docs for this. * Include readme on index page
1 parent 419c6f5 commit 67bb54d

File tree

7 files changed

+320
-296
lines changed

7 files changed

+320
-296
lines changed

README.rst

Lines changed: 24 additions & 292 deletions
Original file line numberDiff line numberDiff line change
@@ -1,322 +1,54 @@
1-
.. _readthedocs.org: http://www.readthedocs.org
2-
.. _bower: http://www.bower.io
3-
.. _sphinx: http://www.sphinx-doc.org
4-
.. _sass: http://www.sass-lang.com
5-
.. _wyrm: http://www.github.com/snide/wyrm/
6-
.. _grunt: http://www.gruntjs.com
7-
.. _node: http://www.nodejs.com
8-
.. _demo: https://sphinx-rtd-theme.readthedocs.io/en/latest/
9-
.. _hidden: http://sphinx-doc.org/markup/toctree.html
101

112
**************************
123
Read the Docs Sphinx Theme
134
**************************
145

156
.. image:: https://img.shields.io/pypi/v/sphinx_rtd_theme.svg
167
:target: https://pypi.python.org/pypi/sphinx_rtd_theme
8+
:alt: Pypi Version
179
.. image:: https://travis-ci.org/rtfd/sphinx_rtd_theme.svg?branch=master
1810
:target: https://travis-ci.org/rtfd/sphinx_rtd_theme
11+
:alt: Build Status
1912
.. image:: https://img.shields.io/pypi/l/sphinx_rtd_theme.svg
2013
:target: https://pypi.python.org/pypi/sphinx_rtd_theme/
21-
:alt: license
14+
:alt: License
2215
.. image:: https://readthedocs.org/projects/sphinx-rtd-theme/badge/?version=latest
2316
:target: http://sphinx-rtd-theme.readthedocs.io/en/latest/?badge=latest
2417
:alt: Documentation Status
2518

26-
.. contents::
27-
:backlinks: none
28-
29-
View a working demo_ over on readthedocs.org_.
30-
31-
This is a mobile-friendly sphinx_ theme I made for readthedocs.org_.
32-
33-
If you'd like to update the theme,
34-
please make your edits to the SASS files here,
35-
rather than the .css files on checked into the repo.
36-
37-
Installation
38-
============
39-
40-
Via package
41-
-----------
42-
43-
Install the package (or add it to your ``requirements.txt`` file):
44-
45-
.. code:: bash
19+
The ``sphinx_rtd_theme`` is a sphinx_ theme designed to look modern and be mobile-friendly.
20+
This theme is primary focused to be used on readthedocs.org_ but can work with your
21+
own sphinx projects. To read more and see a working demo_ head over to readthedocs.org_.
4622

47-
pip install sphinx_rtd_theme
48-
49-
In your ``conf.py`` file:
50-
51-
.. code:: python
52-
53-
import sphinx_rtd_theme
54-
html_theme = "sphinx_rtd_theme"
55-
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
23+
.. _sphinx: http://www.sphinx-doc.org
24+
.. _readthedocs.org: http://www.readthedocs.org
25+
.. _demo: https://sphinx-rtd-theme.readthedocs.io/en/latest/
5626

57-
or (since v0.2.5):
5827

59-
.. code:: python
28+
Installing
29+
==========
6030

61-
html_theme = "sphinx_rtd_theme"
31+
The theme is disributed on PyPI_ and can be installed with pip::
6232

63-
Via git or download
64-
-------------------
33+
pip install sphinx_rtd_theme
6534

66-
Symlink or subtree the ``sphinx_rtd_theme/sphinx_rtd_theme`` repository into your documentation at
67-
``docs/_themes/sphinx_rtd_theme`` then add the following two settings to your Sphinx
68-
``conf.py`` file:
35+
For more information read the full installing docs
36+
`here <https://sphinx-rtd-theme.readthedocs.io/en/latest/installing.html>`__.
6937

70-
.. code:: python
38+
.. _PyPI: https://pypi.python.org/pypi/sphinx_rtd_theme
7139

72-
html_theme = "sphinx_rtd_theme"
73-
html_theme_path = ["_themes", ]
7440

7541
Configuration
7642
=============
7743

78-
You can configure different parts of the theme.
79-
80-
Project-wide configuration
81-
--------------------------
82-
83-
The theme's project-wide options are defined in the ``sphinx_rtd_theme/theme.conf``
84-
file of this repository, and can be defined in your project's ``conf.py`` via
85-
``html_theme_options``. For example:
86-
87-
.. code:: python
88-
89-
html_theme_options = {
90-
'typekit_id': '',
91-
'canonical_url': '',
92-
'analytics_id': '',
93-
'logo_only': False,
94-
'display_version': True,
95-
'prev_next_buttons_location': bottom,
96-
'style_external_links': False,
97-
# Toc options
98-
'collapse_navigation': False,
99-
'sticky_navigation': True,
100-
'navigation_depth': 4,
101-
'includehidden': True,
102-
'titles_only': False
103-
}
104-
105-
The following options are available:
106-
107-
Base options
108-
~~~~~~~~~~~~
109-
110-
* ``typekit_id`` String. This will let users specify a typekit id to use for displaying nicer fonts.
111-
* ``canonical_url`` String. This will specify a `canonical url <https://en.wikipedia.org/wiki/Canonical_link_element>`__
112-
to let search engines know they should give higher ranking to latest version of the docs.
113-
The url points to the root of the documentation and requires a trailing slash.
114-
* ``analytics_id`` String. Change the Google Analytics ID that is included on pages.
115-
* ``display_version`` Bool. With this disabled, the version number isn't shown at the top of the sidebar.
116-
* ``prev_next_buttons_location`` String. can take the value ``bottom``, ``top``, ``both`` , or ``None``
117-
and will display the "Next" and "Previous" buttons accordingly.
118-
* ``style_external_links`` Bool. Add an icon next to external links. Defaults to ``False``.
119-
120-
TOC Options
121-
~~~~~~~~~~~
122-
123-
These effect how we display the Table of Contents in the side bar. You can read more about them here: http://www.sphinx-doc.org/en/stable/templating.html#toctree
124-
125-
* ``collapse_navigation`` Bool. With this enabled, you will lose the ``[+]`` drop downs next to each section in the sidebar.
126-
This is useful for *very large* documents.
127-
* ``sticky_navigation`` Bool. This causes the sidebar to scroll with the main page content as you scroll the page.
128-
* ``navigation_depth`` Int. Indicate the max depth of the tree; by default, all levels are included.
129-
* ``includehidden`` Bool. Specifies if the sidebar includes toctrees marked with the ``:hidden:`` option
130-
* ``titles_only`` Bool. If True, removes headers within a page from the sidebar.
131-
132-
Page-level configuration
133-
------------------------
134-
135-
Pages support metadata that changes how the theme renders.
136-
You can currently add the following:
137-
138-
* ``:github_url:`` This will force the "Edit on GitHub" to the configured URL
139-
* ``:bitbucket_url:`` This will force the "Edit on Bitbucket" to the configured URL
140-
* ``:gitlab_url:`` This will force the "Edit on GitLab" to the configured URL
141-
142-
Changelog
143-
=========
144-
145-
master
146-
------
147-
148-
* Include fontawesome-webfont.woff2 in pip package
149-
* Updated wyrm_ and Font Awesome
150-
* Split multiple data types on different lines
151-
* Italicize ``.versionmodified``
152-
* Fix line number spacing to align with the code lines
153-
* Hide Edit links on auto created pages
154-
* Align ``.. centered::`` text to the center
155-
* Increase contrast for footnotes
156-
* Add language to the JS output variable
157-
* Include the lato italics font with the theme
158-
* Fix padding on field lists
159-
* Add setuptools entry point allowing to use ``sphinx_rtd_theme`` as
160-
Sphinx ``html_theme`` directly.
161-
162-
v0.2.4
163-
------
164-
165-
* Yet another patch to deal with extra builders outside Spinx, such as the
166-
singlehtml builders from the Read the Docs Sphinx extension
167-
168-
v0.2.3
169-
------
170-
171-
* Temporarily patch Sphinx issue with ``singlehtml`` builder by inspecting the
172-
builder in template.
173-
174-
v0.2.2
175-
------
176-
177-
* Roll back toctree fix in 0.2.1 (#367). This didn't fix the issue and
178-
introduced another bug with toctrees display.
179-
180-
v0.2.1
181-
------
182-
183-
* Add the ``rel`` HTML attribute to the footer links which point to
184-
the previous and next pages.
185-
* Fix toctree issue caused by Sphinx singlehtml builder (#367)
186-
187-
v0.2.0
188-
------
189-
190-
* Adds the ``comments`` block after the ``body`` block in the template
191-
* Added "Edit on GitLab" support
192-
* Many bug fixes
193-
194-
v0.1.10-alpha
195-
-------------
196-
197-
.. note:: This is a pre-release version
198-
199-
* Removes Sphinx dependency
200-
* Fixes hamburger on mobile display
201-
* Adds a ``body_begin`` block to the template
202-
* Added ``prev_next_buttons_location``
203-
204-
v0.1.9
205-
------
206-
207-
* Intermittent scrollbar visibility bug fixed. This change introduces a
208-
backwards incompatible change to the theme's layout HTML. This should only be
209-
a problem for derivative themes that have overridden styling of nav elements
210-
using direct decendant selectors. See `#215`_ for more information.
211-
* Safari overscroll bug fixed
212-
* Version added to the nav header
213-
* Revision id was added to the documentation footer if you are using RTD
214-
* An extra block, ``extrafooter`` was added to allow extra content in the
215-
document footer block
216-
* Fixed modernizr URL
217-
* Small display style changes on code blocks, figure captions, and nav elements
218-
219-
.. _#215: https://github.com/rtfd/sphinx_rtd_theme/pull/215
220-
221-
v0.1.8
222-
------
223-
224-
* Start keeping changelog :)
225-
* Support for third and fourth level headers in the sidebar
226-
* Add support for Sphinx 1.3
227-
* Add sidebar headers for :caption: in Sphinx toctree
228-
* Clean up sidebar scrolling behavior so it never scrolls out of view
229-
230-
How the Table of Contents builds
231-
================================
232-
233-
Currently the left menu will build based upon any ``toctree(s)`` defined in your ``index.rst`` file.
234-
It outputs 2 levels of depth, which should give your visitors a high level of access to your
235-
docs. If no toctrees are set the theme reverts to sphinx's usual local toctree.
236-
237-
It's important to note that if you don't follow the same styling for your rST headers across
238-
your documents, the toctree will misbuild, and the resulting menu might not show the correct
239-
depth when it renders.
240-
241-
Also note that by default the table of contents is set with ``includehidden=True``. This allows you
242-
to set a hidden toc in your index file with the `:hidden: <hidden_>`_ property that will allow you
243-
to build a toc without it rendering in your index.
244-
245-
By default, the navigation will "stick" to the screen as you scroll. However if your toc
246-
is vertically too large, it will revert to static positioning. To disable the sticky nav
247-
altogether change the setting in ``conf.py``.
248-
249-
250-
Contributing or modifying the theme
251-
===================================
252-
253-
The sphinx_rtd_theme is primarily a sass_ project that requires a few other sass libraries. I'm
254-
using bower_ to manage these dependencies and sass_ to build the css. The good news is
255-
I have a very nice set of grunt_ operations that will not only load these dependencies, but watch
256-
for changes, rebuild the sphinx demo docs and build a distributable version of the theme.
257-
The bad news is this means you'll need to set up your environment similar to that
258-
of a front-end developer (vs. that of a python developer). That means installing node and ruby.
259-
260-
Set up your environment
261-
-----------------------
262-
263-
#. Install sphinx_ into a virtual environment.
264-
265-
.. code:: bash
266-
267-
pip install sphinx sphinxcontrib-httpdomain
268-
269-
#. Install sass.
270-
271-
.. code:: bash
272-
273-
gem install sass
274-
275-
#. Install node, bower, grunt, and theme dependencies.
276-
277-
.. code:: bash
278-
279-
# Install node
280-
brew install node
281-
282-
# Install bower and grunt
283-
npm install -g bower grunt-cli
284-
285-
# Now that everything is installed, let's install the theme dependencies.
286-
npm install
287-
288-
Now that our environment is set up, make sure you're in your virtual environment, go to
289-
this repository in your terminal and run grunt:
290-
291-
.. code::
292-
293-
grunt
294-
295-
This default task will do the following **very cool things that make it worth the trouble**:
296-
297-
#. Install and update any bower dependencies.
298-
#. Run sphinx and build new docs.
299-
#. Watch for changes to the sass files and build css from the changes.
300-
#. Rebuild the sphinx docs anytime it notices a change to ``.rst``, ``.html``, ``.js``
301-
or ``.css`` files.
302-
303-
304-
Releasing the Theme
305-
===================
306-
307-
When you release a new version,
308-
you should do the following:
44+
The ``sphinx_rtd_theme`` is highly customizable on both the page level and on a global level.
45+
To see all the possible configuration options read the configuring docs
46+
`here <https://sphinx-rtd-theme.readthedocs.io/en/latest/configuring.html>`__.
30947

310-
#. Bump the version in ``sphinx_rtd_theme/__init__.py`` – we try to follow `semver <http://semver.org/>`_, so be careful with breaking changes.
311-
#. Run a ``grunt build`` to rebuild all the theme assets.
312-
#. Commit that change.
313-
#. Tag the release in git: ``git tag $NEW_VERSION``.
314-
#. Push the tag to GitHub: ``git push --tags origin``.
315-
#. Upload the package to PyPI: ``python setup.py sdist bdist_wheel upload``.
316-
#. In the ``readthedocs.org`` repo, edit the ``bower.json`` file to point at the correct version (``sphinx-rtd-theme": "https://github.com/rtfd/sphinx-rtd-theme.git#$NEW_VERSION"``).
317-
#. In the ``readthedocs.org`` repo, run ``gulp build`` to update the distributed theme files.
31848

319-
TODO
320-
====
49+
Contibuting
50+
===========
32151

322-
* Separate some sass variables at the theme level so you can overwrite some basic colors.
52+
If you would like to help improve the theme or have more control
53+
over the theme in case of a fork please read our contributing guide
54+
`here <https://sphinx-rtd-theme.readthedocs.io/en/latest/contributing.html>`__.

0 commit comments

Comments
 (0)