mirror of
https://github.com/readthedocs/sphinx_rtd_theme.git
synced 2026-10-14 18:32:01 -05:00
Compare commits
30
Commits
0.5.0
...
html-search
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8a2b2611d3 | ||
|
|
562bc2a35d | ||
|
|
24ceb6d93d | ||
|
|
e2b10425ef | ||
|
|
38752d455f | ||
|
|
e2b60d7e7b | ||
|
|
4366e9e3f8 | ||
|
|
33a9df7185 | ||
|
|
f8ce9db72a | ||
|
|
9d451fb079 | ||
|
|
80cc791120 | ||
|
|
cf6da7632d | ||
|
|
3d2453b3fd | ||
|
|
b5cafe8e44 | ||
|
|
ca9a8e256e | ||
|
|
1485644386 | ||
|
|
939584e54f | ||
|
|
f6c4e9cb62 | ||
|
|
58f07c0be0 | ||
|
|
006cd2162a | ||
|
|
79fd7487f0 | ||
|
|
00f402f8e9 | ||
|
|
6c943265c1 | ||
|
|
1d85625667 | ||
|
|
d5ed3d0ba1 | ||
|
|
7df2524941 | ||
|
|
fd83875eef | ||
|
|
ecc58ad802 | ||
|
|
aa71fd6cde | ||
|
|
bdd77df7bb |
No files matched your search
@@ -0,0 +1,54 @@
|
||||
version: 2.1
|
||||
|
||||
commands:
|
||||
run-tox:
|
||||
description: "Run tox"
|
||||
parameters:
|
||||
version:
|
||||
type: string
|
||||
steps:
|
||||
- checkout
|
||||
- run: pip install --user tox
|
||||
- run: tox -e "<<parameters.version>>-sphinx{16,17,18,20,21,22,23,24,30,31,32}"
|
||||
|
||||
jobs:
|
||||
py27:
|
||||
docker:
|
||||
- image: 'cimg/python:2.7'
|
||||
steps:
|
||||
- run-tox:
|
||||
version: py27
|
||||
py36:
|
||||
docker:
|
||||
- image: 'cimg/python:3.6'
|
||||
steps:
|
||||
- run-tox:
|
||||
version: py36
|
||||
py37:
|
||||
docker:
|
||||
- image: 'cimg/python:3.7'
|
||||
steps:
|
||||
- run-tox:
|
||||
version: py37
|
||||
py38:
|
||||
docker:
|
||||
- image: 'cimg/python:3.8'
|
||||
steps:
|
||||
- run-tox:
|
||||
version: py38
|
||||
py39:
|
||||
docker:
|
||||
- image: 'cimg/python:3.9'
|
||||
steps:
|
||||
- run-tox:
|
||||
version: py39
|
||||
|
||||
workflows:
|
||||
version: 2
|
||||
tests:
|
||||
jobs:
|
||||
- py39
|
||||
- py38
|
||||
- py37
|
||||
- py36
|
||||
- py27
|
||||
+5
-1
@@ -1,5 +1,9 @@
|
||||
version: 2
|
||||
|
||||
python:
|
||||
version: 3.6
|
||||
version: 3
|
||||
install:
|
||||
- requirements: docs/requirements.txt
|
||||
|
||||
sphinx:
|
||||
configuration: docs/conf.py
|
||||
-14
@@ -1,14 +0,0 @@
|
||||
language: python
|
||||
python:
|
||||
- 2.7
|
||||
- 3.6
|
||||
- 3.7
|
||||
install:
|
||||
- pip install tox-travis
|
||||
- pip install sphinx
|
||||
script:
|
||||
- tox
|
||||
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
@@ -1,6 +1,7 @@
|
||||
include *.txt
|
||||
include babel.cfg
|
||||
include LICENSE
|
||||
include bin/preinstall.js
|
||||
recursive-include sphinx_rtd_theme *.conf
|
||||
recursive-include sphinx_rtd_theme *.css
|
||||
recursive-include sphinx_rtd_theme *.eot
|
||||
|
||||
+2
-2
@@ -5,9 +5,9 @@ Read the Docs Sphinx Theme
|
||||
.. image:: https://img.shields.io/pypi/v/sphinx_rtd_theme.svg
|
||||
:target: https://pypi.python.org/pypi/sphinx_rtd_theme
|
||||
:alt: Pypi Version
|
||||
.. image:: https://travis-ci.org/readthedocs/sphinx_rtd_theme.svg?branch=master
|
||||
:target: https://travis-ci.org/readthedocs/sphinx_rtd_theme
|
||||
.. image:: https://circleci.com/gh/readthedocs/sphinx_rtd_theme.svg?style=svg
|
||||
:alt: Build Status
|
||||
:target: https://circleci.com/gh/readthedocs/sphinx_rtd_theme
|
||||
.. image:: https://img.shields.io/pypi/l/sphinx_rtd_theme.svg
|
||||
:target: https://pypi.python.org/pypi/sphinx_rtd_theme/
|
||||
:alt: License
|
||||
|
||||
@@ -5,6 +5,11 @@ Changelog
|
||||
master
|
||||
======
|
||||
|
||||
New Features
|
||||
------------
|
||||
|
||||
* New theme option to enable anonymous ip addresses when using Google Analytics (#889)
|
||||
|
||||
v0.5.0
|
||||
======
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@ For example:
|
||||
html_theme_options = {
|
||||
'canonical_url': '',
|
||||
'analytics_id': 'UA-XXXXXXX-1', # Provided by Google in your dashboard
|
||||
'analytics_anonymize_ip': False,
|
||||
'logo_only': False,
|
||||
'display_version': True,
|
||||
'prev_next_buttons_location': 'bottom',
|
||||
@@ -101,6 +102,13 @@ Miscellaneous options
|
||||
If specified, Google Analytics' javascript is included in your pages.
|
||||
Set the value to the ID provided to you by google (like ``UA-XXXXXXX``).
|
||||
|
||||
.. confval:: analytics_anonymize_ip
|
||||
|
||||
:type: boolean
|
||||
:default: ``False``
|
||||
|
||||
Anonymize visitor IP addresses in Google Analytics.
|
||||
|
||||
.. confval:: canonical_url
|
||||
|
||||
:type: URL
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""`sphinx_rtd_theme` lives on `Github`_.
|
||||
|
||||
.. _github: https://github.com/rtfd/sphinx_rtd_theme
|
||||
.. _github: https://github.com/readthedocs/sphinx_rtd_theme
|
||||
|
||||
"""
|
||||
|
||||
@@ -86,7 +86,7 @@ class TransifexCommand(distutils.cmd.Command):
|
||||
setup(
|
||||
name='sphinx_rtd_theme',
|
||||
version='0.5.0',
|
||||
url='https://github.com/rtfd/sphinx_rtd_theme/',
|
||||
url='https://github.com/readthedocs/sphinx_rtd_theme',
|
||||
license='MIT',
|
||||
author='Dave Snider, Read the Docs, Inc. & contributors',
|
||||
author_email='dev@readthedocs.org',
|
||||
|
||||
@@ -24,6 +24,8 @@
|
||||
{% set display_gitlab = True %}
|
||||
{% endif %}
|
||||
|
||||
{% set display_vcs_links = display_vcs_links if display_vcs_links is defined else True %}
|
||||
|
||||
<div role="navigation" aria-label="breadcrumbs navigation">
|
||||
|
||||
<ul class="wy-breadcrumbs">
|
||||
@@ -36,27 +38,27 @@
|
||||
{% endblock %}
|
||||
{% block breadcrumbs_aside %}
|
||||
<li class="wy-breadcrumbs-aside">
|
||||
{% if hasdoc(pagename) %}
|
||||
{% if display_github %}
|
||||
{% if hasdoc(pagename) and display_vcs_links %}
|
||||
{% if display_github %}
|
||||
{% if check_meta and 'github_url' in meta %}
|
||||
<!-- User defined GitHub URL -->
|
||||
<a href="{{ meta['github_url'] }}" class="fa fa-github"> {{ _('Edit on GitHub') }}</a>
|
||||
{% else %}
|
||||
<a href="https://{{ github_host|default("github.com") }}/{{ github_user }}/{{ github_repo }}/{{ theme_vcs_pageview_mode|default("blob") }}/{{ github_version }}{{ conf_py_path }}{{ pagename }}{{ suffix }}" class="fa fa-github"> {{ _('Edit on GitHub') }}</a>
|
||||
<a href="https://{{ github_host|default("github.com") }}/{{ github_user }}/{{ github_repo }}/{{ theme_vcs_pageview_mode or "blob" }}/{{ github_version }}{{ conf_py_path }}{{ pagename }}{{ suffix }}" class="fa fa-github"> {{ _('Edit on GitHub') }}</a>
|
||||
{% endif %}
|
||||
{% elif display_bitbucket %}
|
||||
{% if check_meta and 'bitbucket_url' in meta %}
|
||||
<!-- User defined Bitbucket URL -->
|
||||
<a href="{{ meta['bitbucket_url'] }}" class="fa fa-bitbucket"> {{ _('Edit on Bitbucket') }}</a>
|
||||
{% else %}
|
||||
<a href="https://bitbucket.org/{{ bitbucket_user }}/{{ bitbucket_repo }}/src/{{ bitbucket_version}}{{ conf_py_path }}{{ pagename }}{{ suffix }}?mode={{ theme_vcs_pageview_mode|default("view") }}" class="fa fa-bitbucket"> {{ _('Edit on Bitbucket') }}</a>
|
||||
<a href="https://bitbucket.org/{{ bitbucket_user }}/{{ bitbucket_repo }}/src/{{ bitbucket_version}}{{ conf_py_path }}{{ pagename }}{{ suffix }}?mode={{ theme_vcs_pageview_mode or "view" }}" class="fa fa-bitbucket"> {{ _('Edit on Bitbucket') }}</a>
|
||||
{% endif %}
|
||||
{% elif display_gitlab %}
|
||||
{% if check_meta and 'gitlab_url' in meta %}
|
||||
<!-- User defined GitLab URL -->
|
||||
<a href="{{ meta['gitlab_url'] }}" class="fa fa-gitlab"> {{ _('Edit on GitLab') }}</a>
|
||||
{% else %}
|
||||
<a href="https://{{ gitlab_host|default("gitlab.com") }}/{{ gitlab_user }}/{{ gitlab_repo }}/{{ theme_vcs_pageview_mode|default("blob") }}/{{ gitlab_version }}{{ conf_py_path }}{{ pagename }}{{ suffix }}" class="fa fa-gitlab"> {{ _('Edit on GitLab') }}</a>
|
||||
<a href="https://{{ gitlab_host|default("gitlab.com") }}/{{ gitlab_user }}/{{ gitlab_repo }}/{{ theme_vcs_pageview_mode or "blob" }}/{{ gitlab_version }}{{ conf_py_path }}{{ pagename }}{{ suffix }}" class="fa fa-gitlab"> {{ _('Edit on GitLab') }}</a>
|
||||
{% endif %}
|
||||
{% elif show_source and source_url_prefix %}
|
||||
<a href="{{ source_url_prefix }}{{ pagename }}{{ suffix }}">{{ _('View page source') }}</a>
|
||||
@@ -71,10 +73,10 @@
|
||||
{% if (theme_prev_next_buttons_location == 'top' or theme_prev_next_buttons_location == 'both') and (next or prev) %}
|
||||
<div class="rst-breadcrumbs-buttons" role="navigation" aria-label="breadcrumb navigation">
|
||||
{% if next %}
|
||||
<a href="{{ next.link|e }}" class="btn btn-neutral float-right" title="{{ next.title|striptags|e }}" accesskey="n">{{ _('Next') }} <span class="fa fa-arrow-circle-right"></span></a>
|
||||
<a href="{{ next.link|e }}" class="btn btn-neutral float-right" title="{{ next.title|striptags|e }}" accesskey="n">{{ _('Next') }} <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
|
||||
{% endif %}
|
||||
{% if prev %}
|
||||
<a href="{{ prev.link|e }}" class="btn btn-neutral float-left" title="{{ prev.title|striptags|e }}" accesskey="p"><span class="fa fa-arrow-circle-left"></span> {{ _('Previous') }}</a>
|
||||
<a href="{{ prev.link|e }}" class="btn btn-neutral float-left" title="{{ prev.title|striptags|e }}" accesskey="p"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> {{ _('Previous') }}</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
{% if (theme_prev_next_buttons_location == 'bottom' or theme_prev_next_buttons_location == 'both') and (next or prev) %}
|
||||
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
|
||||
{% if next %}
|
||||
<a href="{{ next.link|e }}" class="btn btn-neutral float-right" title="{{ next.title|striptags|e }}" accesskey="n" rel="next">{{ _('Next') }} <span class="fa fa-arrow-circle-right"></span></a>
|
||||
<a href="{{ next.link|e }}" class="btn btn-neutral float-right" title="{{ next.title|striptags|e }}" accesskey="n" rel="next">{{ _('Next') }} <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
|
||||
{% endif %}
|
||||
{% if prev %}
|
||||
<a href="{{ prev.link|e }}" class="btn btn-neutral float-left" title="{{ prev.title|striptags|e }}" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> {{ _('Previous') }}</a>
|
||||
<a href="{{ prev.link|e }}" class="btn btn-neutral float-left" title="{{ prev.title|striptags|e }}" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> {{ _('Previous') }}</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
@@ -16,12 +16,9 @@
|
||||
<p>
|
||||
{%- if show_copyright %}
|
||||
{%- if hasdoc('copyright') %}
|
||||
{% set path = pathto('copyright') %}
|
||||
{% set copyright = copyright|e %}
|
||||
© <a href="{{ path }}">{% trans %}Copyright{% endtrans %}</a> {{ copyright }}
|
||||
{% trans path=pathto('copyright'), copyright=copyright|e %}© <a href="{{ path }}">Copyright</a> {{ copyright }}.{% endtrans %}
|
||||
{%- else %}
|
||||
{% set copyright = copyright|e %}
|
||||
© {% trans %}Copyright{% endtrans %} {{ copyright }}
|
||||
{% trans copyright=copyright|e %}© Copyright {{ copyright }}.{% endtrans %}
|
||||
{%- endif %}
|
||||
{%- endif %}
|
||||
|
||||
@@ -36,7 +33,8 @@
|
||||
{# Translators: the phrase "revision" comes from Git, referring to a commit #}
|
||||
{% trans %}Revision{% endtrans %} <code>{{ commit }}</code>.
|
||||
</span>
|
||||
{%- elif last_updated %}
|
||||
{%- endif %}
|
||||
{%- if last_updated %}
|
||||
<span class="lastupdated">
|
||||
{% trans last_updated=last_updated|e %}Last updated on {{ last_updated }}.{% endtrans %}
|
||||
</span>
|
||||
@@ -46,12 +44,12 @@
|
||||
</div>
|
||||
|
||||
{%- if show_sphinx %}
|
||||
{% set sphinx_web = '<a href="http://sphinx-doc.org/">Sphinx</a>' %}
|
||||
{% set sphinx_web = '<a href="https://www.sphinx-doc.org/">Sphinx</a>' %}
|
||||
{% set readthedocs_web = '<a href="https://readthedocs.org">Read the Docs</a>' %}
|
||||
{# Translators: the variable "sphinx_web" is a link to the Sphinx project documentation with the text "Sphinx" #}
|
||||
{% trans sphinx_web=sphinx_web, readthedocs_web=readthedocs_web %}Built with {{ sphinx_web }} using a{% endtrans %}
|
||||
{# Translators: "theme" refers to a theme for Sphinx, which alters the appearance of the generated documenation #}
|
||||
<a href="https://github.com/rtfd/sphinx_rtd_theme">{% trans %}theme{% endtrans %}</a>
|
||||
<a href="https://github.com/readthedocs/sphinx_rtd_theme">{% trans %}theme{% endtrans %}</a>
|
||||
{# Translators: this is always used as "provided by Read the Docs", and should not imply Read the Docs is an author of the generated documentation. #}
|
||||
{% trans %}provided by {{ readthedocs_web }}{% endtrans %}.
|
||||
{%- endif %}
|
||||
|
||||
@@ -12,9 +12,9 @@
|
||||
<!DOCTYPE html>
|
||||
<html class="{{ sphinx_writer }}" lang="{{ lang_attr }}" >
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta charset="utf-8" />
|
||||
{{ metatags }}
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
{% block htmltitle %}
|
||||
<title>{{ title|striptags|e }}{{ titlesuffix }}</title>
|
||||
{% endblock %}
|
||||
@@ -118,7 +118,7 @@
|
||||
{% if logo and theme_logo_only %}
|
||||
<a href="{{ pathto(master_doc) }}">
|
||||
{% else %}
|
||||
<a href="{{ pathto(master_doc) }}" class="icon icon-home" alt="{{ _("Documentation Home") }}"> {{ project }}
|
||||
<a href="{{ pathto(master_doc) }}" class="icon icon-home"> {{ project }}
|
||||
{% endif %}
|
||||
|
||||
{% if logo %}
|
||||
@@ -229,6 +229,9 @@
|
||||
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
|
||||
|
||||
ga('create', '{{ theme_analytics_id }}', 'auto');
|
||||
{% if theme_analytics_anonymize_ip|tobool %}
|
||||
ga('set', 'anonymizeIp', true);
|
||||
{% endif %}
|
||||
ga('send', 'pageview');
|
||||
</script>
|
||||
|
||||
|
||||
@@ -1,54 +0,0 @@
|
||||
{#
|
||||
basic/search.html
|
||||
~~~~~~~~~~~~~~~~~
|
||||
|
||||
Template for the search page.
|
||||
|
||||
:copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS.
|
||||
:license: BSD, see LICENSE for details.
|
||||
#}
|
||||
{%- extends "layout.html" %}
|
||||
{% set title = _('Search') %}
|
||||
{%- block scripts %}
|
||||
{{ super() }}
|
||||
<script type="text/javascript" src="{{ pathto('_static/searchtools.js', 1) }}"></script>
|
||||
{%- endblock %}
|
||||
{% block footer %}
|
||||
<script type="text/javascript">
|
||||
jQuery(function() { Search.loadIndex("{{ pathto('searchindex.js', 1) }}"); });
|
||||
</script>
|
||||
{# this is used when loading the search index using $.ajax fails,
|
||||
such as on Chrome for documents on localhost #}
|
||||
<script type="text/javascript" id="searchindexloader"></script>
|
||||
{{ super() }}
|
||||
{% endblock %}
|
||||
{% block body %}
|
||||
<noscript>
|
||||
<div id="fallback" class="admonition warning">
|
||||
<p class="last">
|
||||
{% trans trimmed %}Please activate JavaScript to enable the search
|
||||
functionality.{% endtrans %}
|
||||
</p>
|
||||
</div>
|
||||
</noscript>
|
||||
|
||||
{% if search_performed %}
|
||||
{# Translators: Search is a noun, not a verb #}
|
||||
<h2>{{ _('Search Results') }}</h2>
|
||||
{% if not search_results %}
|
||||
<p>{{ _('Your search did not match any documents. Please make sure that all words are spelled correctly and that you\'ve selected enough categories.') }}</p>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
<div id="search-results">
|
||||
{% if search_results %}
|
||||
<ul>
|
||||
{% for href, caption, context in search_results %}
|
||||
<li>
|
||||
<a href="{{ pathto(item.href) }}">{{ caption }}</a>
|
||||
<p class="context">{{ context|e }}</p>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -1,4 +1,4 @@
|
||||
{%- if builder != 'singlehtml' %}
|
||||
{%- if pagename != "search" and 'singlehtml' not in builder %}
|
||||
<div role="search">
|
||||
<form id="rtd-search-form" class="wy-form" action="{{ pathto('search') }}" method="get">
|
||||
<input type="text" name="q" placeholder="{{ _('Search docs') }}" />
|
||||
|
||||
@@ -6,6 +6,7 @@ pygments_style = default
|
||||
[options]
|
||||
canonical_url =
|
||||
analytics_id =
|
||||
analytics_anonymize_ip = False
|
||||
collapse_navigation = True
|
||||
sticky_navigation = True
|
||||
navigation_depth = 4
|
||||
@@ -15,4 +16,5 @@ logo_only =
|
||||
display_version = True
|
||||
prev_next_buttons_location = bottom
|
||||
style_external_links = False
|
||||
style_nav_header_background =
|
||||
style_nav_header_background =
|
||||
vcs_pageview_mode =
|
||||
@@ -1,10 +1,5 @@
|
||||
[tox]
|
||||
envlist = py{27,36,37}-sphinx{16,17,18,20,21,22,23,24,30}
|
||||
|
||||
[tox:travis]
|
||||
2.7 = py27-sphinx{16,17,18,20,21,22,23,24,30}
|
||||
3.6 = py36-sphinx{16,17,18,20,21,22,23,24,30}
|
||||
3.7 = py37-sphinx{16,17,18,20,21,22,23,24,30}
|
||||
envlist = py{27,36,37,38,39}-sphinx{16,17,18,20,21,22,23,24,30,31,32}
|
||||
|
||||
[testenv]
|
||||
setev =
|
||||
@@ -23,6 +18,8 @@ deps =
|
||||
sphinx23: Sphinx < 2.4
|
||||
sphinx24: Sphinx < 2.5
|
||||
sphinx30: Sphinx < 3.1
|
||||
sphinx31: Sphinx < 3.2
|
||||
sphinx32: Sphinx < 3.3
|
||||
commands =
|
||||
py.test {posargs} tests/
|
||||
pytest {posargs} tests/
|
||||
sphinx-build -b html -d {envtmpdir}/doctrees docs/ {envtmpdir}/html
|
||||
Reference in new issue
Block a user