summaryrefslogtreecommitdiff
path: root/source/conf.py
diff options
context:
space:
mode:
authorJan Dittberner <jandd@cacert.org>2018-10-27 14:26:40 +0200
committerJan Dittberner <jandd@cacert.org>2018-10-27 14:26:40 +0200
commit8ba1692ba7e8d572aa1f7fddd9b89d4316399ad6 (patch)
tree7d5645d36a06a03b551bb2dd975e9738fbbc3d62 /source/conf.py
parent844119e0863da10d94b465150cde119b848f29b8 (diff)
downloadcacert-codedocs-8ba1692ba7e8d572aa1f7fddd9b89d4316399ad6.tar.gz
cacert-codedocs-8ba1692ba7e8d572aa1f7fddd9b89d4316399ad6.tar.xz
cacert-codedocs-8ba1692ba7e8d572aa1f7fddd9b89d4316399ad6.zip
Add build documentation for this project
- Add intersphinx configuration for infradocs - Ensure availability of CAcert root certificates - add building.rst that describes how to get and build the documentation source code
Diffstat (limited to 'source/conf.py')
-rw-r--r--source/conf.py24
1 files changed, 19 insertions, 5 deletions
diff --git a/source/conf.py b/source/conf.py
index a80f538..f3750f4 100644
--- a/source/conf.py
+++ b/source/conf.py
@@ -14,10 +14,26 @@
#
from datetime import datetime
import os
+import certifi
+import requests
# import sys
# sys.path.insert(0, os.path.abspath('.'))
from git import repo
+from docutils import nodes, utils
+
+try:
+ print('Checking connection to infradocs.cacert.org')
+ requests.head('https://infradocs.cacert.org/')
+ print('Connection to infradocs.cacert.org OK')
+except requests.exceptions.SSLError as err:
+ print('SSL Error. Adding CAcert certificates to Certifi store...')
+ cafile = certifi.where()
+ with open(os.path.join(
+ os.path.dirname(__file__), '..', 'cacert.pem'), 'rb') as infile:
+ cacertca = infile.read()
+ with open(cafile, 'ab') as outfile:
+ outfile.write(cacertca)
# -- Project information -----------------------------------------------------
@@ -29,10 +45,8 @@ author = 'CAcert development team'
version = '0.1'
# The full version, including alpha/beta/rc tags
release = "{}-git:{} built:{}".format(
- version,
- repo.Repo('..').git.describe('--always', '--dirty'),
- datetime.utcnow().replace(microsecond=0))
-
+ version, repo.Repo('..').git.describe('--always', '--dirty'),
+ datetime.utcnow().replace(microsecond=0))
# -- General configuration ---------------------------------------------------
@@ -197,7 +211,7 @@ epub_exclude_files = ['search.html']
# -- Options for intersphinx extension ---------------------------------------
# Example configuration for intersphinx: refer to the Python standard library.
-intersphinx_mapping = {'https://docs.python.org/': None}
+intersphinx_mapping = {'infradocs': ('https://infradocs.cacert.org', None)}
# -- Options for todo extension ----------------------------------------------