Skip to content

Commit 0f3087f

Browse files
authored
Fix RTD (#435)
1 parent 41c4b1a commit 0f3087f

File tree

6 files changed

+33
-25
lines changed

6 files changed

+33
-25
lines changed

Diff for: .github/workflows/checks.yml

+3
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ jobs:
1717
- python-version: 3
1818
env:
1919
TOXENV: flake8
20+
- python-version: "3.11"
21+
env:
22+
TOXENV: docs
2023

2124
steps:
2225
- uses: actions/checkout@v2

Diff for: .readthedocs.yml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
version: 2
2+
formats: all
3+
sphinx:
4+
configuration: docs/conf.py
5+
fail_on_warning: true
6+
7+
build:
8+
os: ubuntu-20.04
9+
tools:
10+
# For available versions, see:
11+
# https://docs.readthedocs.io/en/stable/config-file/v2.html#build-tools-python
12+
python: "3.11" # Keep in sync with .github/workflows/checks.yml
13+
14+
python:
15+
install:
16+
- requirements: docs/requirements.txt
17+
- path: .

Diff for: docs/conf.py

+2-23
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
#
7171
# This is also used if you do content translation via gettext catalogs.
7272
# Usually you set "language" from the command line for these cases.
73-
language = None
73+
language = "en"
7474

7575
# There are two options for replacing |today|: either, you set today to some
7676
# non-false value, then it is used:
@@ -114,7 +114,7 @@
114114

115115
# The theme to use for HTML and HTML Help pages. See the documentation for
116116
# a list of builtin themes.
117-
html_theme = 'default'
117+
html_theme = "sphinx_rtd_theme"
118118

119119
# Theme options are theme-specific and customize the look and feel of a theme
120120
# further. For a list of options available for each theme, see the
@@ -288,24 +288,3 @@
288288

289289
# If true, do not generate a @detailmenu in the "Top" node's menu.
290290
# texinfo_no_detailmenu = False
291-
292-
293-
# Following is taken from https://github.com/snide/sphinx_rtd_theme#
294-
# using-this-theme-locally-then-building-on-read-the-docs
295-
296-
# on_rtd is whether we are on readthedocs.org,
297-
# this line of code grabbed from docs.readthedocs.org
298-
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
299-
300-
if not on_rtd: # only import and set the theme if we're building docs locally
301-
import sphinx_rtd_theme
302-
html_theme = 'sphinx_rtd_theme'
303-
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
304-
305-
# otherwise, readthedocs.org uses their theme by default, no need to specify it
306-
307-
308-
# Wrap text in tables
309-
# https://github.com/snide/sphinx_rtd_theme/issues/117#issuecomment-41571653
310-
def setup(app):
311-
app.add_css_file("theme_overrides.css")

Diff for: docs/custom-images-contract.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ Contract statements
2525
1. Docker image should be able to run via ``start-crawl`` command without arguments.
2626
``start-crawl`` should be :ref:`executable and located on the search path <scripts-example>`.
2727

28-
.. code-block:: bash
28+
.. code-block:: bash
2929
30-
docker run myscrapyimage start-crawl
30+
docker run myscrapyimage start-crawl
3131
3232
Crawler will be started by unpriviledged user ``nobody`` in a writable directory ``/scrapinghub``.
3333
``HOME`` environment variable will be set to ``/scrapinghub`` as well. Beware that this directory is added

Diff for: docs/requirements.txt

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
sphinx==7.2.6
2+
sphinx-rtd-theme==2.0.0

Diff for: tox.ini

+7
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,10 @@ deps =
4242
flake8>=3.7.9
4343
commands =
4444
flake8 --exclude=.git,.tox,venv* {posargs:shub tests}
45+
46+
[testenv:docs]
47+
changedir = docs
48+
deps =
49+
-rdocs/requirements.txt
50+
commands =
51+
sphinx-build -W -b html . {envtmpdir}/html

0 commit comments

Comments
 (0)