From bf39ab55592a86935102da45f5d0318a944d7e0f Mon Sep 17 00:00:00 2001 From: dgarcia360 Date: Sun, 24 May 2020 18:24:59 +0100 Subject: [PATCH 1/4] Updated theme --- docs-requirements.txt | 4 ++++ docs/conf.py | 29 ++++++++++++++++------------- 2 files changed, 20 insertions(+), 13 deletions(-) create mode 100644 docs-requirements.txt diff --git a/docs-requirements.txt b/docs-requirements.txt new file mode 100644 index 0000000000..d016867f26 --- /dev/null +++ b/docs-requirements.txt @@ -0,0 +1,4 @@ +-r requirements.txt +sphinx==1.8.0 +sphinx_scylladb_theme +sphinx-autobuild==0.7.1 \ No newline at end of file diff --git a/docs/conf.py b/docs/conf.py index 4c0dfb58d7..c00e0329c7 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -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'] @@ -96,15 +96,25 @@ # 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 = {} +# 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 = { + '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 # " v documentation". @@ -125,7 +135,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. @@ -136,14 +146,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. From d3f993c1304c612a485bf5491757c45b406ab3e5 Mon Sep 17 00:00:00 2001 From: David Garcia Date: Thu, 28 May 2020 09:40:46 -0400 Subject: [PATCH 2/4] Update dependencies --- docs-requirements.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs-requirements.txt b/docs-requirements.txt index d016867f26..45968c47bc 100644 --- a/docs-requirements.txt +++ b/docs-requirements.txt @@ -1,4 +1,6 @@ -r requirements.txt sphinx==1.8.0 sphinx_scylladb_theme -sphinx-autobuild==0.7.1 \ No newline at end of file +sphinx-autobuild==0.7.1 +gevent>=1.0 +eventlet From eb8667ac1ba340d6fed81710647287b91387c9c8 Mon Sep 17 00:00:00 2001 From: David Garcia Date: Sun, 31 May 2020 06:07:49 -0400 Subject: [PATCH 3/4] Added GitHub Actions (#1) --- .github/workflows/pages.yml | 34 +++++++++++++++++++ docs/Makefile | 9 ++++- docs/_utils/deploy.sh | 10 ++++++ docs/_utils/preview | 3 ++ docs/_utils/preview.py | 5 +++ docs/_utils/preview.sh | 3 ++ docs/_utils/setup.sh | 7 ++++ .../docs-requirements.txt | 2 +- 8 files changed, 71 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/pages.yml create mode 100755 docs/_utils/deploy.sh create mode 100755 docs/_utils/preview create mode 100644 docs/_utils/preview.py create mode 100755 docs/_utils/preview.sh create mode 100755 docs/_utils/setup.sh rename docs-requirements.txt => docs/docs-requirements.txt (77%) diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml new file mode 100644 index 0000000000..5a3a9c2859 --- /dev/null +++ b/.github/workflows/pages.yml @@ -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 }} diff --git a/docs/Makefile b/docs/Makefile index bf300ec71d..e96d50a6cd 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -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 ' where is one of" @@ -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 + diff --git a/docs/_utils/deploy.sh b/docs/_utils/deploy.sh new file mode 100755 index 0000000000..b1ecd9f2b7 --- /dev/null +++ b/docs/_utils/deploy.sh @@ -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 diff --git a/docs/_utils/preview b/docs/_utils/preview new file mode 100755 index 0000000000..a93265f2f1 --- /dev/null +++ b/docs/_utils/preview @@ -0,0 +1,3 @@ +#!/bin/sh -e + +python3 _utils/preview.py diff --git a/docs/_utils/preview.py b/docs/_utils/preview.py new file mode 100644 index 0000000000..53773e6d07 --- /dev/null +++ b/docs/_utils/preview.py @@ -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') diff --git a/docs/_utils/preview.sh b/docs/_utils/preview.sh new file mode 100755 index 0000000000..a93265f2f1 --- /dev/null +++ b/docs/_utils/preview.sh @@ -0,0 +1,3 @@ +#!/bin/sh -e + +python3 _utils/preview.py diff --git a/docs/_utils/setup.sh b/docs/_utils/setup.sh new file mode 100755 index 0000000000..b88ff3dd3d --- /dev/null +++ b/docs/_utils/setup.sh @@ -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 diff --git a/docs-requirements.txt b/docs/docs-requirements.txt similarity index 77% rename from docs-requirements.txt rename to docs/docs-requirements.txt index 45968c47bc..0e399b46dc 100644 --- a/docs-requirements.txt +++ b/docs/docs-requirements.txt @@ -1,4 +1,4 @@ --r requirements.txt +-r ../requirements.txt sphinx==1.8.0 sphinx_scylladb_theme sphinx-autobuild==0.7.1 From 3e06a1b8e44d94ccee1aae866d642b6d40672b98 Mon Sep 17 00:00:00 2001 From: dgarcia360 Date: Mon, 1 Jun 2020 10:19:42 +0100 Subject: [PATCH 4/4] Fixed duplicated comment --- docs/conf.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index c00e0329c7..670d5fd6ca 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -101,10 +101,6 @@ # 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. -# 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 = { 'header_links': [ ('Scylla Cloud', 'https://docs.scylladb.com/scylla-cloud/'),