Meta infos

root directory

$ ls -als
$ ls -als
total 156
4 drwxr-xr-x 10  4096 nov.  30 18:21 .
4 drwxr-xr-x  4  4096 nov.  30 18:19 ..
4 drwxr-xr-x  3  4096 nov.  30 18:19 alternatives
4 -rwxr-xr-x  1  3804 nov.  30 18:21 conf.py
76 -rw-r--r--  1 76971 nov.  30 18:19 contre_les_tyrans.png
4 drwxr-xr-x  5  4096 nov.  30 18:19 dossiers
4 -rw-r--r--  1    93 oct.  27 18:29 feed.xml
4 drwxr-xr-x  3  4096 nov.  30 18:19 femmes
4 drwxr-xr-x  8  4096 nov.  30 18:21 .git
4 -rwxr-xr-x  1    49 nov.  30 18:19 .gitignore
4 -rw-rw-rw-  1   211 oct.  26 19:58 .gitlab-ci.yml
4 drwxr-xr-x  2  4096 oct.  19 18:09 index
4 -rwxr-xr-x  1   744 nov.  30 18:19 index.rst
4 -rw-rw-rw-  1  1154 mars  30  2020 Makefile
4 drwxr-xr-x  2  4096 nov.  30 18:21 meta
4 drwxr-xr-x  4  4096 nov.  30 18:19 nouvelles
4 drwxr-xr-x 10  4096 nov.  30 18:19 personnes
4 -rw-rw-rw-  1  1017 nov.  30 10:11 .pre-commit-config.yaml
4 -rw-rw-rw-  1   307 oct.  26 20:01 pyproject.toml
4 -rw-r--r--  1    77 nov.  30 18:19 README.md
4 -rw-r--r--  1   558 nov.  30 18:19 requirements.txt

pyproject.toml

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
[tool.poetry]
name = "assr38"
version = "0.1.0"
description = "ASSR38"
authors = ["Patrick <patbakou@pm.me>"]
license = "MIT"

[tool.poetry.dependencies]
python = "3.9.0"
sphinx = "*"
sphinx-panels = "*"
ablog = "*"
pydata-sphinx-theme = "*"
myst-parser = "*"
myst_nb = "*"


[tool.poetry.dev-dependencies]

conf.py

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
#
# Configuration file for the Sphinx documentation builder.
# http://www.sphinx-doc.org/en/stable/config

from datetime import datetime

# https://docs.python.org/3.9/library/zoneinfo.html
from zoneinfo import ZoneInfo

project = "! Non à la retraite à points !"
html_title = project
author = "Humain(e)s"
now = datetime.now(tz=ZoneInfo("Europe/Paris"))
version = f"{now.year}-{now.month:02}-{now.day:02} {now.hour:02}"
release = version
copyright = f"2019-{now.year}, {author} Creative Commons CC BY-NC-SA 3.0"
source_suffix = ".rst"
master_doc = "index"
language = None
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store", ".venv"]
html_theme = "default"
pygments_style = "sphinx"
extensions = ["sphinx.ext.intersphinx"]
intersphinx_mapping = {
    "https://cntvignoles.frama.io/congres_confederaux/": None,
    "https://cntvignoles.frama.io/statuts/": None,
    "https://cntvignoles.frama.io/syndicats/": None,
    "https://france1.frama.io/juridique/": None,
    "https://cntvignoles.frama.io/iledefrance/": None,
    "https://cntvignoles.frama.io/rhone_alpes/": None,
    "https://international.frama.io/cnt/": None,
    "https://gfagrenoble.frama.io/fagrenoble": None,
    "https://gassr38.frama.io/livret_accueil": None,
}
extensions += ["sphinx.ext.todo"]
todo_include_todos = True
extensions += [
    # https://ablog.readthedocs.io/manual/markdown/
    "myst_nb",
]
# MyST config
myst_update_mathjax = False
myst_admonition_enable = True
myst_deflist_enable = True
extensions += [
    "ablog",
]
# https://ablog.readthedocs.io/manual/ablog-configuration-options/
#####################################################################
blog_path = "nonalaretraiteapoints"
# Base URL for the website, required for generating feeds.
blog_baseurl = "https://grenoble1.frama.io/nonalaretraiteapoints/"
blog_title = "nonalaretraiteapoints"
# Post related
# Date display format (default is '%b %d, %Y') for published posts
post_date_format = "%Y-%m-%d"
# Number of seconds (default is 5) that a redirect page waits before
# refreshing the page to redirect to the post
post_redirect_refresh = 1
# Index of the image that will be displayed in the excerpt of the post.
# Default is 0, meaning no image.
# Setting this to 1 will include the first image, when available, to the excerpt.
# This option can be set on a per post basis using post directive option image
post_auto_image = 1
# Number of paragraphs (default is 1) that will be displayed as an excerpt from the post
post_auto_excerpt = 4
# Blog feeds
blog_feed_archives = True
blog_feed_fulltext = True
blog_feed_subtitle = False
blog_feed_titles = False
# Specify number of recent posts to include in feeds, default is None for all posts
blog_feed_length = None
# Font awesome
# ABlog templates will use of Font Awesome icons if one of the following is set: fontawesome_link_cdn
fontawesome_included = True
# https://ablog.readthedocs.io/manual/posting-and-listing/?highlight=blog_post_pattern#posting-with-page-front-matter
# Instead of adding blogpost: true to each page, you may also provide a
# pattern (or list of patterns) in your conf.py file using the blog_post_pattern option
blog_post_pattern = "news/*/*/*"
html_extra_path = ["feed.xml"]
liste_full = [
    "postcard.html",
    "recentposts.html",
    "sourcelink.html",
    "archives.html",
    "tagcloud.html",
    "categories.html",
    "searchbox.html",
]
html_sidebars = {
    "index": liste_full,
    "index/**": liste_full,
    "meta/**": liste_full,
    "alternatives/**": liste_full,
    "dossiers/**": liste_full,
    "nouvelles/**": liste_full,
    "personnes/**": liste_full,
}
extensions += [
    "sphinx_panels",
]
# Panels config
panels_add_bootstrap_css = False
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store", ".venv"]
pygments_style = "sphinx"
html_theme = "pydata_sphinx_theme"
html_theme_options = {
    "search_bar_text": "Search this site...",
    "search_bar_position": "navbar",
}

gitlab-ci.yaml

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
image: python:3.9.0-slim

pages:
  script:
  - pip install -r requirements.txt
  - sphinx-build -d _build/doctrees . _build/html
  - mv _build/html public
  artifacts:
    paths:
    - public
  only:
  - master

.pre-commit-config.yaml

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
---

# .pre-commit-config.yaml
# ========================
#
# pre-commit clean
# pre-commit install
# pre-commit install-hooks
#
# precommit hooks installation
#
# - pre-commit autoupdate
#
# - pre-commit run black
#
# continuous integration
# ======================
#
# - pre-commit run --all-files
#

repos:
  - repo: https://github.com/pre-commit/pre-commit-hooks
    rev: v3.3.0
    hooks:
    - id: trailing-whitespace
    - id: end-of-file-fixer
    - id: check-yaml
    - id: check-json
    - id: fix-encoding-pragma
      args: ['--remove']
    - id: forbid-new-submodules
    - id: mixed-line-ending
      args: ['--fix=lf']
      description: Forces to replace line ending by the UNIX 'lf' character.
    # - id: pretty-format-json
    #  args: ['--no-sort-keys']
    - id: check-added-large-files
      args: ['--maxkb=6000']
    - id: no-commit-to-branch
      args: [--branch, staging]

  - repo: https://github.com/ambv/black
    rev: 20.8b1
    hooks:
    - id: black
      language_version: python3.9

Makefile

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line.
SPHINXOPTS    =
SPHINXBUILD   = sphinx-build
SPHINXPROJ    = Tutopython
SOURCEDIR     = .
BUILDDIR      = _build

THIS_MAKEFILE := $(lastword $(MAKEFILE_LIST))

# Put it first so that "make" without argument is like "make help".
help:
	@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
	@echo " "
	@echo "Targets:"
	@echo " "
	@echo "- make check_all"
	@echo "- make req"
	@echo "- make updatetools"
	@echo "- make update"
	@echo " "


check_all:
	pre-commit run --all-files

req:
	poetry env info --path
	poetry show --tree
	poetry check
	poetry export -f requirements.txt --without-hashes  > requirements.txt
	cat requirements.txt

update:
	poetry update
	@$(MAKE) -f $(THIS_MAKEFILE) req
	git diff requirements.txt

updatetools:
	pre-commit autoupdate
	gitmoji --update
	git status

.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)