Commit a5598eb0 authored by Kallikovski's avatar Kallikovski
Browse files

sphinx-book-template-main

parent acbd0dfe
Pipeline #14489 failed with stages
*.html
*.bkp
*.json
image: python
variables:
SSH_PRIVATE_KEY: $SSH_PRIVATE_KEY
SSH_KNOWN_HOSTS: $SSH_KNOWN_HOSTS
build-webpages:
stage: build
script:
- pip install -U sphinx-book-theme myst-parser
- make html
artifacts:
paths:
- _build/html
deploy-webpages:
stage: deploy
# from https://docs.gitlab.com/ee/ci/ssh_keys/
before_script:
- if [[ ! -v SSH_PRIVATE_KEY ]]; then echo SSH_PRIVATE_KEY not set.; exit 1; fi
- if [[ ! -v SSH_KNOWN_HOSTS ]]; then echo SSH_KNOWN_HOSTS not set.; exit 1; fi
- eval $(ssh-agent -s)
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- echo "$SSH_KNOWN_HOSTS" >> ~/.ssh/known_hosts
- chmod 644 ~/.ssh/known_hosts
script:
- ssh $GITLAB_USER_LOGIN@joan.th-deg.de -- rm -rf public_html/$CI_PROJECT_NAME
- scp -r _build/html $GITLAB_USER_LOGIN@joan.th-deg.de:public_html/$CI_PROJECT_NAME
except:
- merge_requests
# Minimal makefile for Sphinx documentation
#
# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = _build
# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
.PHONY: help Makefile
# 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)
# Markdown examples
Emphasis using *Italics*, **bold**.
The paragraph continues
This is the second paragraph.
## Blockquotes
Kermit from the Muppet Movie:
> Life's like a movie. Write your own ending.
## Lists
- apple
- banana
- cherry
## Links
More info can be found on [Python docs – Exceptions](https://docs.python.org/3/reference/executionmodel.html#exceptions).
## Images
![Charles J. Sharp, CC BY-SA 4.0 <https://creativecommons.org/licenses/by-sa/4.0>, via Wikimedia Commons](https://upload.wikimedia.org/wikipedia/commons/thumb/8/81/Scarlet_darter_%28Crocothemis_erythraea%29_female_Bulgaria.jpg/320px-Scarlet_darter_%28Crocothemis_erythraea%29_female_Bulgaria.jpg)
## Code snippets
We can use `find -iname STRING` to search for a file in Unix.
The following code[^1] shuffles a list:
```python
from random import shuffle
foo = [1, 2, 3, 4]
shuffle(foo)
print(foo)
```
## The end
If you want to try these, follow this [Markdown tutorial](https://commonmark.org/help/tutorial). It also includes a web-based code editor.
[^1]: Code from [PythonSnippets.dev](https://pythonsnippets.dev/snippet/23/)
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
# import os
# import sys
# sys.path.insert(0, os.path.abspath('.'))
# -- Project information -----------------------------------------------------
project = 'Sphinx-book template'
copyright = 'Creative Commons Attribution 4.0 International License'
author = 'Gökçe Aydos'
# -- General configuration ---------------------------------------------------
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'myst_parser',
]
source_suffix = {
'.md': 'markdown',
}
# Add any paths that contain templates here, relative to this directory.
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 = ['_build', 'Thumbs.db', '.DS_Store', 'README.md']
# -- 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 = 'sphinx_book_theme'
# 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']
# Heading
This is a Sphinx-book template. Markdown examples can be found on the left
```{toctree}
:maxdepth: 2
:caption: 'Contents'
chapter1.md
```
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment