Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: "CI Docs"

on:
push:
branches:
- master

jobs:
release:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: 3.7
- name: Setup dependencies
run: |
sudo apt-get install libev4 libev-dev
sudo apt-get install build-essential python-dev
cd docs
./_utils/setup.sh
- name: Build docs
run: |
cd docs
make dirhtml
- name: Deploy
run : ./docs/_utils/deploy.sh
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
9 changes: 8 additions & 1 deletion docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ PAPEROPT_a4 = -D latex_paper_size=a4
PAPEROPT_letter = -D latex_paper_size=letter
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .

.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest
.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest preview

help:
@echo "Please use \`make <target>' where <target> is one of"
Expand Down Expand Up @@ -128,3 +128,10 @@ doctest:
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
@echo "Testing of doctests in the sources finished, look at the " \
"results in $(BUILDDIR)/doctest/output.txt."
preview:
./_utils/setup.sh
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
./_utils/preview.sh

10 changes: 10 additions & 0 deletions docs/_utils/deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

git clone "https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" --branch gh-pages --single-branch gh-pages
cp -r docs/_build/dirhtml/* gh-pages/
cd gh-pages
git config --local user.email "action@scylladb.com"
git config --local user.name "GitHub Action"
git add .
git commit -m "Publish docs" || true
git push origin gh-pages --force
3 changes: 3 additions & 0 deletions docs/_utils/preview
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh -e

python3 _utils/preview.py
5 changes: 5 additions & 0 deletions docs/_utils/preview.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from livereload import Server, shell
server = Server()
server.watch('*.rst', shell('make dirhtml'))
server.watch('*.md', shell('make dirhtml'))
server.serve(host='localhost', root='_build/dirhtml')
3 changes: 3 additions & 0 deletions docs/_utils/preview.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh -e

python3 _utils/preview.py
7 changes: 7 additions & 0 deletions docs/_utils/setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

python -m pip install --upgrade pip
pip install -r docs-requirements.txt
cd ..
CASS_DRIVER_NO_CYTHON=1 python setup.py develop
CASS_DRIVER_NO_CYTHON=1 python setup.py build_ext --inplace --force
25 changes: 12 additions & 13 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.viewcode']
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.viewcode', 'sphinx_scylladb_theme']

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
Expand Down Expand Up @@ -96,15 +96,21 @@

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
html_theme = 'custom'
html_theme = 'sphinx_scylladb_theme'

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#html_theme_options = {}
html_theme_options = {
'header_links': [
('Scylla Cloud', 'https://docs.scylladb.com/scylla-cloud/'),
('Scylla University', 'https://university.scylladb.com/'),
('ScyllaDB Home', 'https://www.scylladb.com/')],
'github_issues_repository': 'scylladb/python-driver'
}

# Add any paths that contain custom themes here, relative to this directory.
html_theme_path = ['./themes']
# html_theme_path = ['./themes']

# The name for this set of Sphinx documents. If None, it defaults to
# "<project> v<release> documentation".
Expand All @@ -125,7 +131,7 @@
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = []
# html_static_path = []

# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
Expand All @@ -136,14 +142,7 @@
#html_use_smartypants = True

# Custom sidebar templates, maps document names to template names.
html_sidebars = {
'**': [
'about.html',
'navigation.html',
'relations.html',
'searchbox.html'
]
}
html_sidebars = {'**': ['side-nav.html']}

# Additional templates that should be rendered to pages, maps page names to
# template names.
Expand Down
6 changes: 6 additions & 0 deletions docs/docs-requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
-r ../requirements.txt
sphinx==1.8.0
sphinx_scylladb_theme
sphinx-autobuild==0.7.1
gevent>=1.0
eventlet