Giter Club home page Giter Club logo

sphinx_rtd_theme's Introduction

Read the Docs Sphinx Theme

Pypi Version Build Status License Documentation Status

This Sphinx theme was designed to provide a great reader experience for documentation users on both desktop and mobile devices. This theme is used primarily on Read the Docs but can work with any Sphinx project. You can find a working demo of the theme in the theme documentation

Installation

This theme is distributed on PyPI and can be installed with pip:

$ pip install sphinx-rtd-theme

To use the theme in your Sphinx project, you will need to edit your conf.py file's html_theme setting:

html_theme = "sphinx_rtd_theme"

See also:

Supported browsers
Officially supported and tested browser/operating system combinations
Supported dependencies
Supported versions of Python, Sphinx, and other dependencies.
Example documentation
A full example of this theme output, with localized strings enabled.

Configuration

This theme is highly customizable on both the page level and on a global level. To see all the possible configuration options, read the documentation on configuring the theme.

Contributing

If you would like to help modify or translate the theme, you'll find more information on contributing in our contributing guide.

sphinx_rtd_theme's People

Contributors

agjohnson avatar astrojuanlu avatar benjaoming avatar blendify avatar carreau avatar chebee7i avatar cloudops-wstevens avatar csatarigergely avatar danieloaks avatar davidfischer avatar dependabot-preview[bot] avatar ehough avatar ericholscher avatar humitos avatar ivoz avatar jessetan avatar jodal avatar jonathanj avatar jonels-msft avatar macagua avatar mitya57 avatar mondeja avatar nienn avatar rdil avatar segevfiner avatar simonbiggs avatar snide avatar stsewd avatar titilambert avatar tony avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sphinx_rtd_theme's Issues

Font weight with custom fonts

Need to replace all the font-weights being used with variables. I think it's causing some issues in Windows chrome when weights like "bold" are being used instead of "700".

This will likely require a wyrm push as well.

Copyright notice

We should probably consider including the copyright notice/footer somewhere in the design.

import sphinx_rtd_theme breaks builds in readthedocs

I have put

import sphinx_rtd_theme
html_theme = "sphinx_rtd_theme"
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]

so I can use sphinx_rtd_theme locally, but when I commit this and push this to my bitbucket repo which readthedocs builds upon, the build fails:

Exception occurred:
  File "/var/build/user_builds/docs-windows/checkouts/latest/conf.py", line 95, in <module>
    import sphinx_rtd_theme
ImportError: No module named sphinx_rtd_theme
The full traceback has been saved in /tmp/sphinx-err-jkBFke.log, if you want to report the issue to the developers.
Please also report this if it was a user error, so that a better error message can be provided next time.
Either send bugs to the mailing list at <http://groups.google.com/group/sphinx-dev/>,
or report them in the tracker at <http://bitbucket.org/birkenfeld/sphinx/issues/>. Thanks!

New build system

https://github.com/snide/wyrm is a dependency of the project.

We are python.

To build it requires node. Then ruby. In the particular instance of the sphinx_rtd_theme, I have a proposal:

https://github.com/hcatlin/libsass + https://pypi.python.org/pypi/libsass/0.2.4 and I can make a python script to build the CSS for us! πŸ’ƒ Then there is no need for ruby or node.

We can use snide/wyrm as a gitsubmodule or vendorize (directly copy it in) or make a pypi package of wyrm directly.

What do you think? Can I give it a shot? The benefit is it would stay 100% python.

Tables in notes are illegible with new theme

To reproduce this issue, render something like the following:

.. note:: Every other line in this table will have white text on a white background.
            This is bad.

    +---------+                                                                     
    | Example |                                                                        
    +=========+                                                                     
    | Thing1  |                                                                     
    +---------+                                                                     
    | Thing2  |                                                                     
    +---------+                                                                     
    | Thing3  |                                                                     
    +---------+  

Hidden toctrees cause sidebar to raise exception

If one tries using a 'catchall' hidden toctree somewhere in their index.rst (e.g. as a catchall for documents that are explicitly linked inline but which aren't otherwise part of toctree elements), the call to the toctree() template method/object in this theme's sidebar raises an AttributeError.

I dug and this is because Sphinx's code (sphinx.environment.get_toctree_for()) returns None when fetching hidden toctrees, unless the includehidden kwarg is given (this seems to be covered by **kwargs all the way back to the method used in-template, FWIW.)

I need to rethink how the doctree in question is structured anyways, given how the new theme exposes its navigation (:heart:). Regardless, I think at least there should be an FAQ for this item; or the template call should say includehidden=True. Otherwise users who innocently use a basic Sphinx feature will be confused like I was :)

Search Results masked or not working

I'm comparing this with the kr theme, as it appears in https://github.com/ericholscher/ericholscher.com

--- all on OS/X Mavericks -----
Firefox 25: both render search items (yellow highlight of term once you follow link)
Chrome 31.0.1650.57: rtd: No search context in results; no highlighted terms in items kr: no search context in results highlighted terms in search results pages;
Safari 7.0: rtd: No search functionality; kr: search results, w/ context, highlighted terms in result page;

Style for sphinx.ext.autodoc.

@snide The theme looks attractive, clean and much more readable than the current RTD theme (even other popular sphinx themes).

An area really critical to sphinx / readthedocs is sphinx.ext.autodoc.

Current theme sphinx.ext.autodoc: http://tmuxp.readthedocs.org/en/latest/api.html

Examples

Current RTD theme: http://django-tastypie.readthedocs.org/en/latest/api.html

Others sphinx.ext.autodoc examples:

Builds are now failing on readthedocs.org

I followed the Readme and when I run make html everything builds fine and looks good locally. However the latest build on readthedocs.org has this error.

Making output directory...

Exception occurred:
  File "/var/build/user_builds/epicserve-docs/checkouts/latest/conf.py", line 1, in <module>
    import sphinx_rtd_theme
ImportError: No module named sphinx_rtd_theme
The full traceback has been saved in /tmp/sphinx-err-PNBx0R.log, if you want to report the issue to the developers.
Please also report this if it was a user error, so that a better error message can be provided next time.
Either send bugs to the mailing list at <http://groups.google.com/group/sphinx-dev/>,
or report them in the tracker at <http://bitbucket.org/birkenfeld/sphinx/issues/>. Thanks!

So how does one use this theme locally and on the readthedocs.org site?

Handling of 3rd level in doctree

Hi,

the theme works great with two levels but has some problems with 3+ levels. The main problem I see is that it's hard to go back up to the parent document once level 3 is reached or easily see the current position in the doctree since the breadcrumbs only show the root and current page and the menu does not highlight anything (also no parents)

One negative example: https://quodlibet.readthedocs.org/en/latest/guide/tags/tags.html

I've modified the theme for another project:

Here is an example: http://lazka.github.io/pgi-docs/api/ClutterGst_2.0/classes/VideoSink.html

  1. Set toctree maxdepth=3 but hide any non current entries in level 3 so only the active page from level 3 is shown.
.wy-menu-vertical li .toctree-l3 {
    display: none;
}

.wy-menu-vertical li .current {
    display: block;
}
  1. Extend the breadcrumbs to show all parents to allow easier navigation to the parent document.
<ul class="wy-breadcrumbs">
  <li><a href="{{ pathto(master_doc) }}">Docs</a> &raquo;</li>
  {% for parent in parents %}
  <li></li><a href="{{ parent.link|e }}">{{ parent.title }}</a> &raquo;</li>
  {% endfor %}
  <li><a href="">{{ title }}</a></li>
  ...

pip setup is broken

@snide nice work!

I tried to apply it to my project, but it looks like PyPI distribution is missing a file:

➜ pip install sphinx_rtd_theme
Downloading/unpacking sphinx-rtd-theme
  Downloading sphinx_rtd_theme-0.1.3.tar.gz
  Running setup.py egg_info for package sphinx-rtd-theme
    Traceback (most recent call last):
      File "<string>", line 16, in <module>
      File "/Users/dvs/.venv/unipag-doc/build/sphinx-rtd-theme/setup.py", line 30, in <module>
        install_requires=open('requirements.txt').read().splitlines(),
    IOError: [Errno 2] No such file or directory: 'requirements.txt'
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):

  File "<string>", line 16, in <module>

  File "/Users/dvs/.venv/unipag-doc/build/sphinx-rtd-theme/setup.py", line 30, in <module>

    install_requires=open('requirements.txt').read().splitlines(),

IOError: [Errno 2] No such file or directory: 'requirements.txt'

----------------------------------------
Command python setup.py egg_info failed with error code 1 in /Users/dvs/.venv/unipag-doc/build/sphinx-rtd-theme
Storing complete log in /Users/dvs/.pip/pip.log

params (within class) not rendered correctly

letΒ΄s take this example:

.. py:class:: FileListing(path, filter_func=None, sorting_by=None, sorting_order=None)

    Returns a list of FileObjects for a given directory, see :ref:`fileobject`.

    :param path: Relative path to a location within `site.storage.location`.
    :param filter_func: Filter function, see example below.
    :param sorting_by: Sort the files by any attribute of FileObject.
    :param sorting_order: Sorting order, either "asc" or "desc".

when rendered, the word "Parameters:" is vertically not aligned with "path" (the first item within parameters). this is only true if you have more than one parameter.

Bad selector for highlighted code.

A typical code block might appear as:

<div class="highlight-python">

which is handled by:

div[class^='highlight']

However, Sphinx sometimes represents code blocks as:

<div class="last highlight-python">

And these blocks are not highlighted by the above rule.

Missing style for ".literal-block"

Great job on this new theme, it looks awesome!

I've noticed something wrong with the generated CSS for the pre.literal-block:
See in sphinx_rtd_theme/static/css/theme.css:

pre.literal-block{@extends .codeblock;}

As a result, the current .. parsed-literal:: are not styled.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.