Meta

Gitlab project

Issues

Pipelines

Git config

Git config gitlab

[init]
	defaultBranch = none
[fetch]
	recurseSubmodules = false
[core]
	repositoryformatversion = 0
	filemode = true
	bare = false
	logallrefupdates = true
[remote "origin"]
	url = https://gitlab-ci-token:64_7y_VaBA79yyqkUgGbLAi@gitlab.com/gdevops/tuto_html.git
	fetch = +refs/heads/*:refs/remotes/origin/*

Git config local

[core]
    repositoryformatversion = 0
    filemode = true
    bare = false
    logallrefupdates = true
[remote "origin"]
    url = git@gitlab.com:gdevops/tuto_html.git
    fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
    remote = origin
    merge = refs/heads/master
[user]
    name = Aaron
    email = swaaron@pm.me
[alias]
    dlog = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
    ci = commit
    co = chekout
    st = status

pyproject.toml

 1[tool.poetry]
 2name = "tuto_html"
 3version = "0.1.0"
 4description = "Tuto html"
 5authors = ["Noam <noamsw@pm.me>"]
 6
 7[tool.poetry.dependencies]
 8python = "^3.11"
 9sphinx-material = "*"
10sphinx-copybutton = "*"
11Sphinx = "*"
12
13
14[tool.poetry.dev-dependencies]
15
16[build-system]
17requires = ["poetry-core>=1.0.0"]
18build-backend = "poetry.core.masonry.api"

conf.py

  1# Configuration file for the Sphinx documentation builder.
  2#
  3# This file only contains a selection of the most common options. For a full
  4# list see the documentation:
  5# http://www.sphinx-doc.org/en/master/config
  6# -- Path setup --------------------------------------------------------------
  7# If extensions (or modules to document with autodoc) are in another directory,
  8# add these directories to sys.path here. If the directory is relative to the
  9# documentation root, use os.path.abspath to make it absolute, like shown here.
 10#
 11# import os
 12# import sys
 13# sys.path.insert(0, os.path.abspath('.'))
 14import platform
 15from datetime import datetime
 16from zoneinfo import ZoneInfo
 17
 18import sphinx
 19import sphinx_material
 20
 21# If extensions (or modules to document with autodoc) are in another directory,
 22# add these directories to sys.path here. If the directory is relative to the
 23# documentation root, use os.path.abspath to make it absolute, like shown here.
 24# sys.path.insert(0, os.path.abspath("./src"))
 25
 26
 27project = "Tuto HTML"
 28html_title = project
 29
 30author = f"DevOps people"
 31html_logo = "images/html_living.png"
 32html_favicon = "images/html_living.png"
 33release = "0.1.0"
 34now = datetime.now(tz=ZoneInfo("Europe/Paris"))
 35version = f"{now.year}-{now.month:02}-{now.day:02} {now.hour:02}H ({now.tzinfo})"
 36today = version
 37
 38extensions = [
 39    "sphinx.ext.autodoc",
 40    "sphinx.ext.doctest",
 41    "sphinx.ext.extlinks",
 42    "sphinx.ext.intersphinx",
 43    "sphinx.ext.todo",
 44    "sphinx.ext.mathjax",
 45    "sphinx.ext.viewcode",
 46    "sphinx_copybutton",
 47]
 48
 49# Add any paths that contain templates here, relative to this directory.
 50templates_path = ["_templates"]
 51exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
 52html_static_path = ["_static"]
 53html_show_sourcelink = True
 54html_sidebars = {
 55    "**": ["logo-text.html", "globaltoc.html", "localtoc.html", "searchbox.html"]
 56}
 57extensions.append("sphinx_material")
 58html_theme_path = sphinx_material.html_theme_path()
 59html_context = sphinx_material.get_html_context()
 60html_theme = "sphinx_material"
 61
 62extensions.append("sphinx.ext.intersphinx")
 63intersphinx_mapping = {
 64    "docker": ("https://gdevops.gitlab.io/tuto_docker/", None),
 65    "tuto_javascript": ("https://gdevops.gitlab.io/tuto_javascript/", None),
 66    "django": ("https://gdevops.gitlab.io/tuto_django/", None),
 67    "documentation": ("https://gdevops.gitlab.io/tuto_documentation/", None),
 68    "http": ("https://gdevops.gitlab.io/tuto_http/", None),
 69    "webframeworks": ("https://gdevops.gitlab.io/tuto_webframeworks/", None),
 70    "project": ("https://gdevops.gitlab.io/tuto_project/", None),
 71    "webframeworks": ("https://gdevops.gitlab.io/tuto_webframeworks/", None),
 72    "conda": ("https://conda.io/en/latest/", None),
 73    "sphinx": ("https://www.sphinx-doc.org/en/master", None),
 74    "sphinx_material": ("https://gdevops.gitlab.io/tuto_sphinx_material", None),
 75}
 76extensions.append("sphinx.ext.todo")
 77todo_include_todos = True
 78
 79
 80# material theme options (see theme.conf for more information)
 81# https://gitlab.com/bashtage/sphinx-material/blob/master/sphinx_material/sphinx_material/theme.conf
 82# Colors
 83# The theme color for mobile browsers. Hex color.
 84# theme_color = #3f51b5
 85# Primary colors:
 86# red, pink, purple, deep-purple, indigo, blue, light-blue, cyan,
 87# teal, green, light-green, lime, yellow, amber, orange, deep-orange,
 88# brown, grey, blue-grey, white
 89# Accent colors:
 90# red, pink, purple, deep-purple, indigo, blue, light-blue, cyan,
 91# teal, green, light-green, lime, yellow, amber, orange, deep-orange
 92# color_accent = blue
 93# color_primary = blue-grey
 94
 95# material theme options (see theme.conf for more information)
 96html_theme_options = {
 97    "base_url": "https://gdevops.gitlab.io/tuto_html/",
 98    "repo_url": "https://gitlab.com/gdevops/tuto_html",
 99    "repo_name": project,
100    "html_minify": False,
101    "html_prettify": True,
102    "css_minify": True,
103    "repo_type": "gitlab",
104    "globaltoc_depth": -1,
105    "color_primary": "green",
106    "color_accent": "cyan",
107    "theme_color": "#2196f3",
108    "nav_title": f"{project} ({today})",
109    "master_doc": False,
110    "nav_links": [
111        {
112            "href": "genindex",
113            "internal": True,
114            "title": "Index",
115        },
116        {
117            "href": "https://html.spec.whatwg.org/",
118            "internal": False,
119            "title": "HTML Living Standard",
120        },
121        {
122            "href": "https://developer.mozilla.org/en-US/docs/Web/HTML",
123            "internal": False,
124            "title": "Mozilla HTML (MDN)",
125        },
126        {
127            "href": "https://en.wikipedia.org/wiki/HTML5",
128            "internal": False,
129            "title": "Wikipedia HTML5",
130        },
131        {
132            "href": "https://gdevops.gitlab.io/tuto_htmx/",
133            "internal": False,
134            "title": "htmx",
135        },
136        {
137            "href": "https://gdevops.gitlab.io/tuto_devops/",
138            "internal": False,
139            "title": "Tuto devops",
140        },
141    ],
142    "heroes": {
143        "index": "Tuto HTML",
144    },
145    "table_classes": ["plain"],
146}
147
148
149language = "en"
150html_last_updated_fmt = ""
151
152todo_include_todos = True
153
154html_use_index = True
155html_domain_indices = True
156
157copyright = f"2018-{now.year}, {author} Built with sphinx {sphinx.__version__} Python {platform.python_version()}"

gitlab-ci.yaml

 1image: python:3.11.2-slim-bullseye
 2
 3pages:
 4  script:
 5  - pip install -r requirements.txt
 6  - sphinx-build -d _build/doctrees . _build/html
 7  - mv _build/html public
 8  artifacts:
 9    paths:
10    - public
11  only:
12  - main

.pre-commit-config.yaml

 1---
 2
 3# .pre-commit-config.yaml
 4# ========================
 5#
 6# pre-commit clean
 7# pre-commit install
 8# pre-commit install-hooks
 9#
10# precommit hooks installation
11#
12# - pre-commit autoupdate
13#
14# - pre-commit run black
15#
16# continuous integration
17# ======================
18#
19# - pre-commit run --all-files
20#
21
22repos:
23  - repo: https://github.com/pre-commit/pre-commit-hooks
24    rev: v4.0.1
25    hooks:
26    - id: trailing-whitespace
27    - id: end-of-file-fixer
28    - id: check-yaml
29    - id: check-json
30    - id: fix-encoding-pragma
31      args: ['--remove']
32    - id: forbid-new-submodules
33    - id: mixed-line-ending
34      args: ['--fix=lf']
35      description: Forces to replace line ending by the UNIX 'lf' character.
36    # - id: pretty-format-json
37    #   args: ['--no-sort-keys']
38    - id: check-added-large-files
39      args: ['--maxkb=500']
40    - id: no-commit-to-branch
41      args: [--branch, staging]
42
43
44

Makefile

 1# Minimal makefile for Sphinx documentation
 2#
 3
 4# You can set these variables from the command line.
 5SPHINXOPTS    =
 6SPHINXBUILD   = sphinx-build
 7SPHINXPROJ    = Tutopython
 8SOURCEDIR     = .
 9BUILDDIR      = _build
10
11THIS_MAKEFILE := $(lastword $(MAKEFILE_LIST))
12
13# Put it first so that "make" without argument is like "make help".
14help:
15	@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
16	@echo " "
17	@echo "Targets:"
18	@echo " "
19	@echo "- make check_all"
20	@echo "- make req"
21	@echo "- make updatetools"
22	@echo "- make update"
23	@echo "- make clearcache"
24	@echo " "
25
26clearcache:
27	poetry cache clear --all pypi
28
29
30check_all:
31	pre-commit run --all-files
32
33req:
34	poetry env info --path
35	poetry show --tree
36	poetry check
37	poetry export -f requirements.txt --without-hashes  > requirements.txt
38	cat requirements.txt
39
40update:
41	poetry update
42	@$(MAKE) -f $(THIS_MAKEFILE) req
43	
44
45updatetools:
46	pre-commit autoupdate
47
48.PHONY: help Makefile
49
50# Catch-all target: route all unknown targets to Sphinx using the new
51# "make mode" option.  $(O) is meant as a shortcut for $(SPHINXOPTS).
52%: Makefile
53	@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)