Skip to content

Commit

Permalink
DOC: add section about GitLab Pages
Browse files Browse the repository at this point in the history
  • Loading branch information
kolibril13 authored and mgeier committed Jan 9, 2022
1 parent d9db915 commit 8f6343a
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions doc/usage.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -692,6 +692,51 @@
"</div>"
]
},
{
"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": {},
Expand Down

0 comments on commit 8f6343a

Please sign in to comment.