nervtn-docs/source/conf.py

274 lines
7.8 KiB
Python
Raw Normal View History

# -*- coding: utf-8 -*-
import os
project = 'Nerv Tales Network Documentation'
basename = 'nervtn-docs'
project_uid = basename # ISBN, etc.
baseurl = 'https://tn.nerv-project.eu'
copyright = '2021, Nerv Project ASBL'
author = 'Nerv Project ASBL'
publisher = 'Nerv Project ASBL'
site_url = 'https://tn.nerv-project.eu/'
vcs_uri = "https://procrastinator.nerv-project.eu/"
use_bibtex = True
use_git = True
language = 'en'
2023-08-18 02:20:43 +02:00
html_extra_path = [
"_static/robots.txt",
"_static/favicon.ico",
]
version = "0.1"
release = "0.1"
if use_git:
from git import Repo
repository_name = 'nerv-project/'
repository_name += basename
repo = Repo(
os.path.join(
os.path.dirname(os.path.realpath(__file__)),
'..'
)
)
repo.config_reader()
if not repo.head.is_detached:
version = repo.head.ref.name
release = version + ' [' + repo.commit().hexsha[:20] + ']'
repository_uri = vcs_uri + repository_name
issues_uri = repository_uri + "/issues/{issue}"
issues_pr_uri = repository_uri + "/merge_requests/{pr}"
issues_commit_uri = repository_uri + "/commit/{commit}"
issues_user_uri = vcs_uri + "/{user}"
extensions = [
'sphinxemoji.sphinxemoji',
'sphinxcontrib.actdiag',
'sphinxcontrib.blockdiag',
'sphinxcontrib.nwdiag',
'sphinxcontrib.seqdiag',
'sphinx_galleria',
'sphinx.ext.extlinks',
'sphinx.ext.intersphinx',
'sphinx.ext.todo',
'sphinx_issues',
'sphinx_sitemap',
'sphinx_fasvg',
]
if use_git:
extensions.append('sphinx_git')
if use_bibtex:
extensions.append('sphinxcontrib.bibtex')
locale_dirs = ['locale/']
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
exclude_patterns = []
pygments_style = 'sphinx'
html_logo = '_static/logo.svg'
html_theme = 'nervproject'
html_theme_options = {
"logoalt": project,
"social": [
2023-08-18 02:20:43 +02:00
('solid', 'building', 'BCE 0756.741.342', 'https://kbopub.economie.fgov.be/kbopub/toonondernemingps.html?ondernemingsnummer=756741342', False),
('solid', 'receipt', 'TVA BE0756741342', 'https://kbopub.economie.fgov.be/kbopub/toonondernemingps.html?ondernemingsnummer=756741342', False),
('solid', 'books', 'KBR Éditeur 15066', 'https://www.kbr.be', False),
('brands', 'mastodon', 'mastodon', 'https://tiphon.nerv-project.eu/@nerv_project', True),
('solid', 'mug-hot', 'forgejo', 'https://procrastinator.nerv-project.eu/nerv-project', True),
('solid', 'hashtag', 'xmpp', 'xmpp:asbl@clac.nerv-project.eu', True),
('regular', 'comments', 'movim', 'https://clac.nerv-project.eu/', False),
('solid', 'film', 'peertube', 'https://clap.nerv-project.eu/video-channels/kujiu_channel/videos', False),
('brands', 'youtube', 'youtube', 'https://www.youtube.com/channel/UC6LcFMVZUOs4WbKvV3p1xVw', False),
('solid', 'podcast', 'podcasts', 'https://kreskenn.nerv-project.eu', False),
('solid', 'paragraph', 'gemini', 'gemini://nerv-project.eu', False),
('solid', 'rss', 'rss', 'https://nerv-project.eu/blog/atom.xml', False),
('solid', 'rss', 'newsletter (rss)', 'https://morpork.nerv-project.eu/blog/atom.xml', False),
('solid', 'envelope', 'newsletter', 'https://e8eb781a.sibforms.com/serve/MUIEAJvJnY3tRS7Nh4RvCneup4b6zYrTqGw3TUsq3igy7_QACEbhSd8G26qTXES6uJS-fGtcGBaji0Os0eWK2CY2it80LrbbXL7WRdNibWlpKtLD2sv43rRROQxdBktxF0qci_7hXvkRuAKLRk_X3NtNCkRUV2prn0BHb4g4tr8vck_yic-nw_ZQlmAPWSrFd1FwGBGTqf1M_Frm', False),
],
2023-08-18 02:20:43 +02:00
"mastodon_user": "@nerv_project@tiphon.nerv-project.eu",
'external_languages': [
# ('code', 'name', 'baseurl'),
('en', 'en', 'https://tn.nerv-project.eu/en'),
('fr', 'fr', 'https://tn.nerv-project.eu/fr'),
('nl', 'nl', 'https://tn.nerv-proect.eu/nl'),
],
"fathom": {
'url': '//casanabo.nerv-project.eu',
'id': 'BJLEM',
},
"license": {
'type': 'EUPL-1.2',
'text': 'EUPL-1.2',
'subtype': '',
'version': '',
'url': 'https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12'
}
}
html_static_path = ['_static']
html_sidebars = {
'**': [
'about.html',
2023-08-18 02:20:43 +02:00
'util/sidetoc.html',
'social.html',
'util/searchbox.html',
],
}
html_baseurl = baseurl
htmlhelp_basename = basename
2023-08-18 02:20:43 +02:00
gemini_baseurl = 'gemini://tn.nerv-project.eu/'
gemini_footer = """
Nerv Project ASBL - BCE 0756.741.342 - TVA BE0756741342 - KBR Éditeur 15066 - IBAN BE02751210684040 - BIC AXABBE22.
Licensed under EUPL 1.2
Created with Sphinx.
"""
pyppeteer_pdf_options = {
'printBackground': True,
'format': 'A4',
'margin': {
'top': '0mm',
'bottom': '0mm',
'left': '0mm',
'right': '0mm'
}
}
latex_engine = 'xelatex'
latex_toplevel_sectioning = 'chapter'
latex_show_urls = 'footnote'
latex_elements = {
# 'figure_align': 'htbp',
# 'extraclassoptions': '',
'papersize': 'a4paper',
'pointsize': '12pt',
'extraclassoptions': 'twoside',
'fontpkg': r'''
\defaultfontfeatures{Ligatures=TeX}
\setmainfont{Luciole}
\setsansfont{Luciole}
'''
}
latex_show_pagerefs = True
latex_documents = [
(master_doc, basename + '.tex', project,
author, 'book'),
]
man_pages = [
(master_doc, basename.lower(), project, [author], 1)
]
texinfo_documents = [
(master_doc, basename, project,
author, basename, '',
'Miscellaneous'),
]
epub_title = project
epub_author = author
epub_publisher = publisher
epub_copyright = copyright
epub_identifier = project_uid
epub_uid = ''
epub_exclude_files = [
'index.xhtml',
'search.xhtml',
'blog.xhtml',
'submit_success.xhtml',
'contact.xhtml',
'403.xhtml',
'404.xhtml',
'blog/archive.xhtml',
'blog/category.xhtml',
'blog/drafts.xhtml',
'blog/author.xhtml',
'blog/language.xhtml',
'blog/location.xhtml',
'blog/location/braine-lalleud.xhtml',
'blog/language/francais.xhtml',
'blog/author/kujiu.xhtml',
'blog/2014.xhtml',
'blog/2015.xhtml',
'blog/2016.xhtml',
'blog/2017.xhtml',
'blog/2018.xhtml',
'blog/2019.xhtml',
'blog/2020.xhtml',
'blog/2021.xhtml',
'blog/2022.xhtml',
'blog/2023.xhtml',
'blog/2024.xhtml',
'google82f190054a773ed9.xhtml',
'nav.xhtml',
]
epub_theme = 'epub'
epub_show_urls = 'footnote'
diag_antialias = True
diag_transparency = True
diag_html_image_format = "SVG"
diag_latex_image_format = "PDF"
diag_fontpath = os.path.dirname(os.path.realpath(__file__))
diag_fontpath = os.path.join(diag_fontpath, '_static', 'biolinumrah.ttf')
diag_debug = False
actdiag_antialias = diag_antialias
actdiag_transparency = diag_transparency
actdiag_html_image_format = diag_html_image_format
actdiag_latex_image_format = diag_latex_image_format
actdiag_fontpath = diag_fontpath
actdiag_debug = diag_debug
blockdiag_antialias = diag_antialias
blockdiag_transparency = diag_transparency
blockdiag_html_image_format = diag_html_image_format
blockdiag_fontpath = diag_fontpath
blockdiag_latex_image_format = diag_latex_image_format
blockdiag_debug = diag_debug
nwdiag_antialias = diag_antialias
nwdiag_transparency = diag_transparency
nwdiag_html_image_format = diag_html_image_format
nwdiag_latex_image_format = diag_latex_image_format
nwdiag_fontpath = diag_fontpath
nwdiag_debug = diag_debug
seqdiag_antialias = diag_antialias
seqdiag_transparency = diag_transparency
seqdiag_html_image_format = diag_html_image_format
seqdiag_latex_image_format = diag_latex_image_format
seqdiag_fontpath = diag_fontpath
seqdiag_debug = diag_debug
if use_bibtex:
from pybtex.style import formatting
from pybtex.richtext import Text, Tag
class NervPybtexStyle(formatting.BaseStyle):
def format_article(self, entry):
return Text(Tag('em', entry.fields['key']))
bibtex_bibfiles = ['refs.bib']
bibtex_default_style = 'unsrtalpha'
bibtex_reference_style = 'label'