Skip to content
Permalink
Browse files

Separate Sphinx source and build directory (#463)

* Separate sphinx docs source and build directory

* update docs build/watch scripts

* move docs scripts to /docs

* remove indices section
  • Loading branch information
parano committed Jan 8, 2020
1 parent acfa967 commit 59fbc69529b707cc67aab15b28ed522c22c73d5e
@@ -70,7 +70,7 @@ instance/
.scrapy

# Sphinx documentation
docs/_build/
docs/build/

# PyBuilder
target/
@@ -117,9 +117,6 @@ yarn-error.log
yarn.lock
package-lock.json

# docs
built-docs

# MacOS X
.DS_Store

This file was deleted.

@@ -1,9 +1,10 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = source
BUILDDIR = build

@@ -16,4 +17,4 @@ help:
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
@@ -2,4 +2,4 @@
set -e

GIT_ROOT=$(git rev-parse --show-toplevel)
sphinx-build $GIT_ROOT/docs $GIT_ROOT/built-docs
cd $GIT_ROOT/docs && make html
@@ -25,11 +25,11 @@ if errorlevel 9009 (
exit /b 1
)

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%

:end
popd
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -2,7 +2,7 @@
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# http://www.sphinx-doc.org/en/master/config
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Path setup --------------------------------------------------------------

@@ -13,16 +13,16 @@
import os
import sys

sys.path.insert(0, os.path.abspath(".."))

# Adding BentoML source directory for accessing BentoML version
sys.path.insert(0, os.path.abspath('../..'))
import bentoml


# -- Project information -----------------------------------------------------

project = "BentoML"
copyright = "2020 BentoML Org"
author = "BentoML.org"
project = 'BentoML'
copyright = '2020, bentoml.org'
author = 'bentoml.org'
version = bentoml.__version__


@@ -31,25 +31,27 @@
# 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.napoleon", "sphinx_click.ext"]
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.napoleon",
"sphinx_click.ext",
"recommonmark",
]

# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]
templates_path = ['_templates']

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = []


master_doc = "index"

# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme_path = ["_themes"]
html_theme = "sphinx_rtd_theme"
html_theme_options = {
"collapse_navigation": True,
@@ -59,7 +61,8 @@
"titles_only": False,
}


# 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 = ["_static"]
html_static_path = ['_static']
File renamed without changes.
File renamed without changes.
@@ -7,18 +7,18 @@ GIT_ROOT=$(git rev-parse --show-toplevel)
trap 'kill $(jobs -p)' EXIT

echo "Initial docs build..."
sphinx-build $GIT_ROOT/docs $GIT_ROOT/built-docs
cd $GIT_ROOT/docs && make html

echo "Starting local http server for preview..."
python3 -m http.server --directory $GIT_ROOT/built-docs &
python3 -m http.server --directory $GIT_ROOT/docs/build/html &

echo "Open browser..."
open -a "Google Chrome" http://0.0.0.0:8000/

fswatch -o $GIT_ROOT/docs $GIT_ROOT/bentoml | while read; \
do \
echo "Change detected, rebuilding docs..."
sphinx-build -E $GIT_ROOT/docs $GIT_ROOT/built-docs
cd $GIT_ROOT/docs && make html

# refresh page
osascript -e '
@@ -84,7 +84,13 @@
]


docs_requires = ["sphinx", "sphinx-click", "sphinx_rtd_theme", "sphinxcontrib-fulltoc"]
docs_requires = [
"sphinx",
"sphinx-click",
"sphinx_rtd_theme",
"sphinxcontrib-fulltoc",
"recommonmark",
]

dev_all = install_requires + dev_requires + optional_requires + docs_requires

0 comments on commit 59fbc69

Please sign in to comment.
You can’t perform that action at this time.