diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6c816d62..1efc23e0 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -65,11 +65,25 @@ jobs: - name: Lint run: tox -e package -e lint -e pyupgrade + # Build docs + docs: + name: Build docs + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + with: + python-version: 3.9 + - name: Install deps + run: pip install -e . && pip install sphinx + - name: Build docs + run: sphinx-build -b html docs docs/build + # Create a new semantic release # Only runs on the original repo, not forks release: if: github.repository_owner == 'stephenmcd' - needs: [test, lint] + needs: [test, lint, docs] runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 diff --git a/docs/conf.py b/docs/conf.py index 0328eff9..3181fed1 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -13,27 +13,24 @@ import sys from datetime import datetime +import cartridge + if "DJANGO_SETTINGS_MODULE" not in os.environ: docs_path = os.getcwd() cartridge_path_parts = (docs_path, "..") sys.path.insert(0, docs_path) sys.path.insert(0, os.path.realpath(os.path.join(*cartridge_path_parts))) os.environ["DJANGO_SETTINGS_MODULE"] = "docs_settings" - # Django 1.7's setup is required before touching translated strings. import django - try: - django.setup() - except AttributeError: # < 1.7 - pass + django.setup() +# When a full build is run (eg from the root of the repo), we +# run all the Mezzanine utils for dynamically generated docs. if sys.argv[-2:] == ["docs", "docs/build"]: from mezzanine.utils import docs - import cartridge - docs.build_settings_docs(docs_path, prefix="SHOP_") - docs.build_changelog(docs_path, package_name="cartridge") # docs.build_modelgraph(docs_path, package_name="cartridge") try: @@ -76,7 +73,6 @@ # General information about the project. project = "Cartridge" - copyright = "2009 - %s, Stephen McDonald" % datetime.now().year # The version info for the project you're documenting, acts as replacement for @@ -105,6 +101,11 @@ # for source files. exclude_trees = ["_build"] +# List of files to be excluded when looking for source files. +#  Added settings.rst its still will be included in configuration.rst +#  only that prevents error of duplicate reference labels. +exclude_patterns = ["settings.rst"] + # The reST default role (used for this markup: `text`) to use for all documents. # default_role = None @@ -159,7 +160,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 = ["_static"] +# html_static_path = ["_static"] # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # using the given strftime format. @@ -232,6 +233,5 @@ # latex_use_modindex = True -html_use_index = False html_theme_path = ["."] html_theme = "mezzanine_theme" diff --git a/docs/settings.rst b/docs/settings.rst index 8358880a..5cdc5ba3 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -79,7 +79,7 @@ Default: ``10.0`` Default tax rate in % when no custom tax handling is implemented. -Default: ``0`` +Default: ``0.0`` .. _SHOP_DISCOUNT_FIELD_IN_CART: @@ -268,4 +268,4 @@ Default: ``True`` Show the links to the wishlist, and allow adding products to it. -Default: ``True`` +Default: ``True`` \ No newline at end of file