diff --git a/doc/usage.ipynb b/doc/usage.ipynb index 778b2127..5eb26c3e 100644 --- a/doc/usage.ipynb +++ b/doc/usage.ipynb @@ -692,6 +692,51 @@ "" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Automatic Creation of HTML and PDF output on GitLab Pages\n", + "\n", + "When using GitLab pages, you can use nbsphinx by adding the file `.gitlab-ci.yml` to your repo and copying the following lines into this file:\n", + "```\n", + "image: python:3-slim\n", + "\n", + "variables:\n", + " PIP: python3 -m pip\n", + " SPHINX: python3 -m sphinx -W --keep-going --color\n", + "\n", + "build-docs:\n", + " stage: build\n", + " script:\n", + " - apt-get update -y\n", + " - apt-get install -y --no-install-recommends pandoc\n", + " - $PIP install -r doc/requirements.txt\n", + " - $SPHINX -d doctrees doc html -b html\n", + " - $SPHINX -d doctrees doc linkcheck -b linkcheck\n", + " artifacts:\n", + " when: always\n", + " paths:\n", + " - html\n", + " - linkcheck/output.*\n", + " \n", + "pages:\n", + " stage: deploy\n", + " variables:\n", + " GIT_STRATEGY: none\n", + " script:\n", + " - mv html public\n", + " artifacts:\n", + " paths:\n", + " - public\n", + " rules:\n", + " - if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH\n", + "```\n", + "Note: \n", + "\n", + "You migh have to change the line `docs/` to `docs/source` in case that you have this folder structure, which is the default when using `sphinx-quickstart. " + ] + }, { "cell_type": "markdown", "metadata": {},