Skip to content

Commit 3a38cab

Browse files
authored
Update docs config (#208)
* Update docs config: auto-detect version, remove Travis button - Read version/release from emails.__version__ instead of hardcoded 0.5 - Remove travis_button option from theme configs (Travis CI is no longer used) - Fix intersphinx_mapping format for modern Sphinx * Use docs/requirements.txt for documentation build dependencies in CI * Add missing docs/_static directory
1 parent 1819154 commit 3a38cab

5 files changed

Lines changed: 21 additions & 5 deletions

File tree

.github/workflows/tests.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,22 @@ jobs:
6161
- name: run django tests
6262
run: tox -e ${{ matrix.tox }}
6363

64+
docs:
65+
name: "docs"
66+
runs-on: ubuntu-latest
67+
steps:
68+
- uses: actions/checkout@v4
69+
- uses: actions/setup-python@v5
70+
with:
71+
python-version: '3.12'
72+
cache: pip
73+
- name: install dependencies
74+
run: |
75+
pip install -e .
76+
pip install sphinx -r docs/requirements.txt
77+
- name: build docs
78+
run: sphinx-build -W -b html docs docs/_build/html
79+
6480
typecheck:
6581
name: "typecheck"
6682
runs-on: ubuntu-latest

docs/_static/.gitkeep

Whitespace-only changes.

docs/conf.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
import sys, os
22
sys.path.append(os.path.abspath('_themes'))
3+
sys.path.append(os.path.abspath('..'))
34
sys.path.append(os.path.abspath('.'))
45

56
from conf_base import *
67
from conf_theme_alabaster import *
78

89
#from conf_theme_flask import *
910

10-
version = '0.5'
11-
release = '0.5.1'
11+
from emails import __version__ as _emails_version
12+
version = '.'.join(_emails_version.split('.')[:2])
13+
release = _emails_version
1214
html_theme_path = ['_themes', ] + html_theme_path

docs/conf_base.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@
117117
html_theme_options = {
118118
'github_user': 'lavr',
119119
'github_repo': 'python-emails',
120-
'travis_button': True
121120
}
122121

123122
# Theme options are theme-specific and customize the look and feel of a theme
@@ -279,4 +278,4 @@
279278

280279

281280
# Example configuration for intersphinx: refer to the Python standard library.
282-
intersphinx_mapping = {'http://docs.python.org/': None}
281+
intersphinx_mapping = {'python': ('https://docs.python.org/3', None)}

docs/conf_theme_alabaster.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,5 @@
1111
'github_user': 'lavr',
1212
'github_repo': 'python-emails',
1313
'github_banner': True,
14-
'travis_button': True,
1514
'code_font_size': '0.8em'
1615
}

0 commit comments

Comments
 (0)