conf.py sample

Sample

# -*- coding: utf-8 -*-
source_suffix = '.rst'
master_doc = 'index'

project = u'sphinx-users.jp theme sample'
version = release = '1.0.1'
copyright = u'2011-2017, Sphinx-users.jp'

################################################################
# Extension and Theme setting
# You need to install `pip install sphinxjp.themes.sphinxjp`

html_theme = 'sphinxjp'

################################################################
# HTML theme options for `sphinxjp` theme

html_theme_options = {
    'hatena_bookmark': False,
    'hatena_star': False,
    'hatena_star_token': '<GET YOUR HATENA STAR TOKEN AND SET HERE>',
    'repository_url': 'https://github.com/sphinxjp/sphinxjp.themes.sphinxjp/',
}





###########################################################################
#          auto-created readthedocs.org specific configuration            #
###########################################################################


#
# The following code was added during an automated build on readthedocs.org
# It is auto created and injected for every build. The result is based on the
# conf.py.tmpl file found in the readthedocs.org codebase:
# https://github.com/rtfd/readthedocs.org/blob/master/readthedocs/doc_builder/templates/doc_builder/conf.py.tmpl
#


import sys
import os.path
from six import string_types

from sphinx import version_info

# Get suffix for proper linking to GitHub
# This is deprecated in Sphinx 1.3+,
# as each page can have its own suffix
if globals().get('source_suffix', False):
    if isinstance(source_suffix, string_types):
        SUFFIX = source_suffix
    else:
        SUFFIX = source_suffix[0]
else:
    SUFFIX = '.rst'

# Add RTD Static Path. Add to the end because it overwrites previous files.
if not 'html_static_path' in globals():
    html_static_path = []
if os.path.exists('_static'):
    html_static_path.append('_static')
html_static_path.append('/home/docs/checkouts/readthedocs.org/readthedocs/templates/sphinx/_static')

# Add RTD Theme only if they aren't overriding it already
using_rtd_theme = False
if 'html_theme' in globals():
    if html_theme in ['default']:
        # Allow people to bail with a hack of having an html_style
        if not 'html_style' in globals():
            import sphinx_rtd_theme
            html_theme = 'sphinx_rtd_theme'
            html_style = None
            html_theme_options = {}
            if 'html_theme_path' in globals():
                html_theme_path.append(sphinx_rtd_theme.get_html_theme_path())
            else:
                html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]

            using_rtd_theme = True
else:
    import sphinx_rtd_theme
    html_theme = 'sphinx_rtd_theme'
    html_style = None
    html_theme_options = {}
    if 'html_theme_path' in globals():
        html_theme_path.append(sphinx_rtd_theme.get_html_theme_path())
    else:
        html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
    using_rtd_theme = True

if globals().get('websupport2_base_url', False):
    websupport2_base_url = 'https://readthedocs.org/websupport'
    if 'http' not in settings.MEDIA_URL:
        websupport2_static_url = 'https://media.readthedocs.org/static/'
    else:
        websupport2_static_url = 'https://media.readthedocs.org//static'


#Add project information to the template context.
context = {
    'using_theme': using_rtd_theme,
    'html_theme': html_theme,
    'current_version': "master",
    'MEDIA_URL': "https://media.readthedocs.org/",
    'PRODUCTION_DOMAIN': "readthedocs.org",
    'versions': [
    ("latest", "/en/latest/"),
    ("stable", "/en/stable/"),
    ("master", "/en/master/"),
    ],
    'downloads': [ 
    ("htmlzip", "//readthedocs.org/projects/sphinxjpthemessphinxjp/downloads/htmlzip/master/"),
    ],
    'subprojects': [ 
    ],
    'slug': 'sphinxjpthemessphinxjp',
    'name': u'sphinxjp.themes.sphinxjp',
    'rtd_language': u'en',
    'canonical_url': 'http://sphinxjpthemessphinxjp.readthedocs.io/en/master/',
    'analytics_code': '',
    'single_version': False,
    'conf_py_path': '/docs/',
    'api_host': 'https://readthedocs.org',
    'github_user': 'sphinxjp',
    'github_repo': 'sphinxjp.themes.sphinxjp',
    'github_version': 'master',
    'display_github': True,
    'bitbucket_user': 'None',
    'bitbucket_repo': 'None',
    'bitbucket_version': 'master',
    'display_bitbucket': False,
    'READTHEDOCS': True,
    'using_theme': (html_theme == "default"),
    'new_theme': (html_theme == "sphinx_rtd_theme"),
    'source_suffix': SUFFIX,
    'user_analytics_code': '',
    'global_analytics_code': 'UA-17997319-1',
    
    'commit': '631beaec',
    
}
if 'html_context' in globals():
    html_context.update(context)
else:
    html_context = context

# Add custom RTD extension
if 'extensions' in globals():
    extensions.append("readthedocs_ext.readthedocs")
else:
    extensions = ["readthedocs_ext.readthedocs"]

HTML theme options

hatena_bookmark:
 Show hatena-bookmark bookmarked count and link. default is False. See also: http://b.hatena.ne.jp/help
hatena_star:Show hatena-star stars. default is False. See also: http://s.hatena.ne.jp/
hatena_star_token:
 If you set hatena_star = True, you need set this token. See also: http://s.hatena.ne.jp/
repository_url:Footer link to repository.