forked from intel/pmem-csi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
conf.py
45 lines (36 loc) · 1.14 KB
/
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
import json
import os
import sys
from os import getenv
#support for modified code block
from pygments.lexers.shell import BashSessionLexer
from sphinx.highlighting import lexers
#############
#
# Add a special lexer to add a class to console lexer
#
#############
def setup(app):
app.add_css_file("override.css")
class copyAllConsole (BashSessionLexer):
name = 'ShellSession'
lexers['ShellSession'] = copyAllConsole(startinLine=True)
# Get settings from conf.json
with open('conf.json') as jsonFile:
conf = json.load(jsonFile)
for item in conf:
globals()[item] = (conf[item])
sphinx_md_useGitHubURL = True
baseBranch = "devel"
commitSHA = getenv('GITHUB_SHA')
githubBaseURL = 'https://github.com/' + (getenv('GITHUB_REPOSITORY') or 'intel/pmem-csi') + '/'
githubFileURL = githubBaseURL + "blob/"
githubDirURL = githubBaseURL + "tree/"
if commitSHA:
githubFileURL = githubFileURL + commitSHA + "/"
githubDirURL = githubDirURL + commitSHA + "/"
else:
githubFileURL = githubFileURL + baseBranch + "/"
githubDirURL = githubDirURL + baseBranch + "/"
sphinx_md_githubFileURL = githubFileURL
sphinx_md_githubDirURL = githubDirURL