conf.py (modules-5.1.1.tar.bz2) | : | conf.py (modules-5.2.0.tar.bz2) | ||
---|---|---|---|---|
skipping to change at line 75 | skipping to change at line 75 | |||
pipe = Popen('git rev-parse --abbrev-ref HEAD', stdout=PIPE, stderr=DEVNULL, shell=True) | pipe = Popen('git rev-parse --abbrev-ref HEAD', stdout=PIPE, stderr=DEVNULL, shell=True) | |||
git_current_branch = pipe.stdout.read() | git_current_branch = pipe.stdout.read() | |||
if git_current_desc: | if git_current_desc: | |||
version = git_current_tag.lstrip('v').rstrip() | version = git_current_tag.lstrip('v').rstrip() | |||
if git_current_tag == git_current_desc: | if git_current_tag == git_current_desc: | |||
return version, '' | return version, '' | |||
else: | else: | |||
branch = git_current_branch.rstrip() | branch = git_current_branch.rstrip() | |||
tags = git_current_desc.lstrip(git_current_tag + '-').rstrip() | tags = git_current_desc.lstrip(git_current_tag + '-').rstrip() | |||
# workaround for RTD, where master branch is not detected | # workaround for RTD, where main branch is not detected | |||
if branch == 'master' or os.environ.get('READTHEDOCS', None) == 'Tru | if branch == 'main' or os.environ.get('READTHEDOCS', None) == 'True' | |||
e': | : | |||
return version, version + '+' + tags | return version, version + '+' + tags | |||
else: | else: | |||
return version, version + '+' + branch + '-' + tags | return version, version + '+' + branch + '-' + tags | |||
else: | else: | |||
return '5.1.1', '' | return '5.2.0', '' | |||
# The short X.Y version. | # The short X.Y version. | |||
# The full version, including alpha/beta/rc tags. | # The full version, including alpha/beta/rc tags. | |||
if os.access('version.py', os.R_OK): | if os.access('version.py', os.R_OK): | |||
# get version and release information from version.py file | # get version and release information from version.py file | |||
exec(open('version.py').read()) | exec(open('version.py').read()) | |||
else: | else: | |||
# or fetch them from git repository data | # or fetch them from git repository data | |||
version, release = get_version_release_from_git() | version, release = get_version_release_from_git() | |||
skipping to change at line 122 | skipping to change at line 122 | |||
# -- Options for HTML output ---------------------------------------------- | # -- Options for HTML output ---------------------------------------------- | |||
# The theme to use for HTML and HTML Help pages. See the documentation for | # The theme to use for HTML and HTML Help pages. See the documentation for | |||
# a list of builtin themes. | # a list of builtin themes. | |||
# | # | |||
os_rtd = os.environ.get('READTHEDOCS', None) == 'True' | os_rtd = os.environ.get('READTHEDOCS', None) == 'True' | |||
if os_rtd: | if os_rtd: | |||
html_theme = 'sphinx_rtd_theme' | html_theme = 'sphinx_rtd_theme' | |||
# override wide tables in RTD theme | # override wide tables in RTD theme | |||
# colorize terminal output | # colorize terminal output | |||
html_context = { | html_css_files = [ | |||
'css_files': [ | 'rtd_literal_block.css', | |||
'_static/rtd_theme_overrides.css', | 'rtd_theme_overrides.css', | |||
'_static/rtd_literal_block.css', | 'terminal_output.css', | |||
'_static/terminal_output.css', | ] | |||
], | ||||
} | ||||
else: | else: | |||
html_theme = 'bizstyle' | html_theme = 'bizstyle' | |||
# colorize terminal output | # colorize terminal output | |||
html_context = { | html_css_files = [ | |||
'css_files': [ | 'literal_block.css', | |||
'_static/literal_block.css', | 'terminal_output.css', | |||
'_static/terminal_output.css', | ] | |||
], | ||||
} | ||||
# Theme options are theme-specific and customize the look and feel of a theme | # Theme options are theme-specific and customize the look and feel of a theme | |||
# further. For a list of options available for each theme, see the | # further. For a list of options available for each theme, see the | |||
# documentation. | # documentation. | |||
# | # | |||
# html_theme_options = {} | # html_theme_options = {} | |||
if os_rtd: | if os_rtd: | |||
html_theme_options = { 'logo_only' : True } | html_theme_options = { 'logo_only' : True } | |||
# The name of an image file (relative to this directory) to place at the top | # The name of an image file (relative to this directory) to place at the top | |||
skipping to change at line 345 | skipping to change at line 341 | |||
return opt | return opt | |||
from docutils import nodes | from docutils import nodes | |||
def ghcommit_role(name, rawtext, text, lineno, inliner, options={}, content=[]): | def ghcommit_role(name, rawtext, text, lineno, inliner, options={}, content=[]): | |||
commit_id = str(text) | commit_id = str(text) | |||
commit_url = 'https://github.com/cea-hpc/modules/commit/' + commit_id | commit_url = 'https://github.com/cea-hpc/modules/commit/' + commit_id | |||
title = nodes.reference('', commit_id, refuri=commit_url) | title = nodes.reference('', commit_id, refuri=commit_url) | |||
return [title], [] | return [title], [] | |||
# define new directive/role that can be used as .. subcmd::/:subcmd:, | # define new directive/role that can be used as .. subcmd::/:subcmd:, | |||
# .. mfcmd::/:mfcmd: and .. mfvar::/:mfvar: | # .. mfcmd::/:mfcmd:, .. mfvar::/:mfvar: and .. sitevar::/:sitevar: | |||
def setup(app): | def setup(app): | |||
app.add_object_type('subcmd', 'subcmd', | app.add_object_type('subcmd', 'subcmd', | |||
objname='module sub-command', | objname='module sub-command', | |||
indextemplate='pair: %s; module sub-command', | indextemplate='pair: %s; module sub-command', | |||
parse_node=parse_cmd_args_node) | parse_node=parse_cmd_args_node) | |||
app.add_object_type(directivename='mfcmd', rolename='mfcmd', | app.add_object_type(directivename='mfcmd', rolename='mfcmd', | |||
objname='modulefile command', | objname='modulefile command', | |||
indextemplate='pair: %s; modulefile command', | indextemplate='pair: %s; modulefile command', | |||
parse_node=parse_cmd_args_node) | parse_node=parse_cmd_args_node) | |||
app.add_object_type(directivename='mfvar', rolename='mfvar', | app.add_object_type(directivename='mfvar', rolename='mfvar', | |||
objname='modulefile variable', | objname='modulefile variable', | |||
indextemplate='pair: %s; modulefile variable', | indextemplate='pair: %s; modulefile variable', | |||
parse_node=parse_cmd_args_node) | parse_node=parse_cmd_args_node) | |||
app.add_object_type(directivename='sitevar', rolename='sitevar', | ||||
objname='siteconfig variable', | ||||
indextemplate='pair: %s; siteconfig variable', | ||||
parse_node=parse_cmd_args_node) | ||||
app.add_object_type('instopt', 'instopt', | app.add_object_type('instopt', 'instopt', | |||
objname='installation option', | objname='installation option', | |||
indextemplate='pair: %s; installation option', | indextemplate='pair: %s; installation option', | |||
parse_node=parse_opt_args_node) | parse_node=parse_opt_args_node) | |||
app.add_object_type('mconfig', 'mconfig', | app.add_object_type('mconfig', 'mconfig', | |||
objname='module configuration option', | objname='module configuration option', | |||
indextemplate='pair: %s; module configuration option') | indextemplate='pair: %s; module configuration option') | |||
app.add_role('ghcommit', ghcommit_role) | app.add_role('ghcommit', ghcommit_role) | |||
End of changes. 6 change blocks. | ||||
18 lines changed or deleted | 18 lines changed or added |