Skip to content

Commit

Permalink
Merge branch 'docutils-0.18' into docutils-0.18-issue-fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaoming committed Oct 5, 2022
2 parents 49ddc86 + bcfbfc8 commit 48b1cd5
Show file tree
Hide file tree
Showing 25 changed files with 161 additions and 103 deletions.
12 changes: 11 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ commands:
type: string
sphinx-version:
type: string
default: "16,17,18,20,21,22,23,24,30,31,32,33,34,35,40,41,latest"
default: "16,17,18,20,21,22,23,24,30,31,32,33,34,35,40,41,50,51,52,latest"
steps:
- checkout
- run: pip install --user tox
Expand Down Expand Up @@ -71,12 +71,22 @@ jobs:
steps:
- run-tox:
version: py39
py310:
docker:
- image: 'cimg/python:3.10'
steps:
- run-tox:
version: py310
sphinx-version: "42,43,44,45,50,51,52,latest"

workflows:
version: 2
tests:
jobs:
- build
- py310:
requires:
- build
- py39:
requires:
- build
Expand Down
12 changes: 7 additions & 5 deletions docs/demo/demo.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ should be grouped in pairs).``

If the ``--pep-references`` option was supplied, there should be a live link to PEP 258 here.

.. regression test for https://github.com/readthedocs/sphinx_rtd_theme/pull/1193
Very long URLs should be wrapped so lines do not overflow and cause horizontal scrolling: https://www.google.com/search?hl=en&q=very%20long%20url%20example%20of%20a%20url%20that%20is%20extremely%20long%20you%20probably%20want%20to%20avoid%20it%20but%20here%20we%20are

Math
====

Expand Down Expand Up @@ -264,17 +268,15 @@ Footnotes
Citations
---------

.. [11] This is the citation I made, let's make this extremely long so that we can tell that it doesn't follow the normal responsive table stuff.
.. [Citation] This is the citation I made, let's make this extremely long so that we can tell that it doesn't follow the normal responsive table stuff.
.. [12] This citation has some ``code blocks`` in it, maybe some **bold** and
*italics* too. Heck, lets put a link to a meta citation [13]_ too.
.. [13] This citation will have two backlinks.
Here's a reference to the above, [12]_, and a [nonexistent]_ citation.

Here is another type of citation: `citation`
Here's a reference to the above, [Citation]_, and a [nonexistent]_ citation.

Glossary
--------
Expand Down Expand Up @@ -302,7 +304,7 @@ A reference can be found under `Inline Markup`_, above. `Inline
hyperlink targets`_ are also possible.

Section headers are implicit targets, referred to by name. See
Targets_, which is a subsection of `Body Elements`_.
Targets_, which is a subsection of `References`_.

Explicit external targets are interpolated into references such as "Python_".

Expand Down
9 changes: 9 additions & 0 deletions docs/demo/level1/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

******************
Breadcrumb Level 1
******************

.. toctree::
:maxdepth: 3

level2/index.rst
9 changes: 9 additions & 0 deletions docs/demo/level1/level2/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

******************************************
:mod:`Breadcrumb Level 2 <test_py_module>`
******************************************

.. toctree::
:maxdepth: 3

level3/index.rst
9 changes: 9 additions & 0 deletions docs/demo/level1/level2/level3/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

******************
Breadcrumb Level 3
******************

.. toctree::
:maxdepth: 3

level4/index.rst
9 changes: 9 additions & 0 deletions docs/demo/level1/level2/level3/level4/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

******************
Breadcrumb Level 4
******************

.. toctree::
:maxdepth: 3

level5/index.rst
9 changes: 9 additions & 0 deletions docs/demo/level1/level2/level3/level4/level5/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

******************
Breadcrumb Level 5
******************

.. toctree::
:maxdepth: 3

level6/index.rst
4 changes: 4 additions & 0 deletions docs/demo/level1/level2/level3/level4/level5/level6/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

******************
Breadcrumb Level 6
******************
23 changes: 23 additions & 0 deletions docs/demo/lists_tables.rst
Original file line number Diff line number Diff line change
Expand Up @@ -346,3 +346,26 @@ List Tables

This is a long caption for a figure. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Donec porttitor dolor in odio posuere, vitae ornare libero mattis. In lobortis justo vestibulum nibh aliquet, non.


Tables with paragraphs
----------------------

.. regression test for https://github.com/readthedocs/sphinx_rtd_theme/issues/289
Test to see that tables behave well with nested paragraphs.

+------------+----------+-------------------------+
| Precedence | Operator | Description |
+============+==========+=========================+
| 1 | \:: | Scope resolution |
+------------+----------+-------------------------+
| 2 | ( ) | Function call |
| | | |
| | [ ] | Subscript |
| | | |
| | . | Member access |
| | | |
| | .{ } | Bit-field concatenation |
+------------+----------+-------------------------+

14 changes: 14 additions & 0 deletions docs/demo/test_py_module/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,20 @@ class Foo:
and etc, but those will *always* have the ``.descname`` or
``.descclassname`` class.
Term
It is also possible to include definitions inside docstrings.
They should be styled as a normal definition list.
:Field List:
It is also possible to include definitions inside docstrings.
They should be styled as a normal definition list.
.. [1] A footnote contains body elements, consistently indented by at
least 3 spaces.
.. [Citation] A citation contains body elements, consistently indented by at
least 3 spaces.
Normal ``<tt>`` (like the <tt> I just wrote here) needs to be shown with
the same style as anything else with ````this type of markup````.
Expand Down
6 changes: 6 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,9 @@ Development
:hidden:

demo/long

.. toctree::
:maxdepth: 3
:caption: Breadcrumbs

demo/level1/index.rst
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "sphinx_rtd_theme",
"main": "js/theme.js",
"version": "1.1.0-alpha.0",
"version": "1.0.1alpha1",
"scripts": {
"dev": "webpack-dev-server --open --config webpack.dev.js",
"build": "webpack --config webpack.prod.js",
Expand Down
4 changes: 3 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,17 @@ classifiers =
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Operating System :: OS Independent
Topic :: Documentation
Topic :: Software Development :: Documentation
[options]
include_package_data = True
zip_safe = False
packages = sphinx_rtd_theme
python_requires = >=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*
install_requires =
sphinx >=1.6
sphinx >=1.6,<6
docutils <0.19
Jinja2 <3.1
tests_require =
Expand Down
56 changes: 0 additions & 56 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,60 +93,4 @@ def run(self):
'build_assets': WebpackBuildCommand,
'watch': WebpackDevelopCommand,
},
zip_safe=False,
packages=['sphinx_rtd_theme'],
package_data={'sphinx_rtd_theme': [
'theme.conf',
'*.html',
'static/css/*.css',
'static/css/fonts/*.*',
'static/js/*.js',
]},
include_package_data=True,
# See http://www.sphinx-doc.org/en/stable/theming.html#distribute-your-theme-as-a-python-package
entry_points = {
'sphinx.html_themes': [
'sphinx_rtd_theme = sphinx_rtd_theme',
]
},
python_requires='>=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*',
install_requires=[
'sphinx>=1.6',
'docutils<0.18',
'Jinja2<3.1',
],
tests_require=[
'pytest',
],
extras_require={
'dev': [
'transifex-client',
'sphinxcontrib-httpdomain',
'bump2version',
'wheel',
],
},
classifiers=[
'Framework :: Sphinx',
'Framework :: Sphinx :: Theme',
'Development Status :: 5 - Production/Stable',
'License :: OSI Approved :: MIT License',
'Environment :: Console',
'Environment :: Web Environment',
'Intended Audience :: Developers',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Operating System :: OS Independent',
'Topic :: Documentation',
'Topic :: Software Development :: Documentation',
],
project_urls={
'Homepage': 'https://sphinx-rtd-theme.readthedocs.io/',
'Source Code': 'https://github.com/readthedocs/sphinx_rtd_theme',
'Issue Tracker': 'https://github.com/readthedocs/sphinx_rtd_theme/issues',
},
)
9 changes: 9 additions & 0 deletions sphinx_rtd_theme/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ def config_initiated(app, config):
_('The canonical_url option is deprecated, use the html_baseurl option from Sphinx instead.')
)


def extend_html_context(app, pagename, templatename, context, doctree):
# Add ``sphinx_version_info`` tuple for use in Jinja templates
context['sphinx_version_info'] = sphinx_version


# See http://www.sphinx-doc.org/en/stable/theming.html#distribute-your-theme-as-a-python-package
def setup(app):
if python_version[0] < 3:
Expand Down Expand Up @@ -60,4 +66,7 @@ def setup(app):
else:
app.config.html_add_permalinks = "\uf0c1"

# Extend the default context when rendering the templates.
app.connect("html-page-context", extend_html_context)

return {'parallel_read_safe': True, 'parallel_write_safe': True}
6 changes: 3 additions & 3 deletions sphinx_rtd_theme/breadcrumbs.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@
<div role="navigation" aria-label="{{ _('Page navigation') }}">
<ul class="wy-breadcrumbs">
{%- block breadcrumbs %}
<li><a href="{{ pathto(master_doc) }}" class="icon icon-home"></a> &raquo;</li>
<li><a href="{{ pathto(master_doc) }}" class="icon icon-home"></a></li>
{%- for doc in parents %}
<li><a href="{{ doc.link|e }}">{{ doc.title }}</a> &raquo;</li>
<li class="breadcrumb-item"><a href="{{ doc.link|e }}">{{ doc.title }}</a></li>
{%- endfor %}
<li>{{ title }}</li>
<li class="breadcrumb-item active">{{ title }}</li>
{%- endblock %}
{%- block breadcrumbs_aside %}
<li class="wy-breadcrumbs-aside">
Expand Down
4 changes: 0 additions & 4 deletions sphinx_rtd_theme/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@
{%- set lang_attr = 'en' if language == None else (language | replace('_', '-')) %}
{%- set sphinx_writer = 'writer-html5' if html5_doctype else 'writer-html4' -%}

{# Build sphinx_version_info tuple from sphinx_version string in pure Jinja #}
{%- set (_ver_major, _ver_minor, _ver_bugfix) = sphinx_version.split('.') | map('int') -%}
{%- set sphinx_version_info = (_ver_major, _ver_minor, _ver_bugfix) -%}

<!DOCTYPE html>
<html class="{{ sphinx_writer }}" lang="{{ lang_attr }}" >
<head>
Expand Down
2 changes: 1 addition & 1 deletion sphinx_rtd_theme/static/css/badge_only.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 48b1cd5

Please sign in to comment.