IAP GITLAB

Skip to content
Snippets Groups Projects
Commit b374c233 authored by Antonio Augusto Alves Junior's avatar Antonio Augusto Alves Junior Committed by Ralf Ulrich
Browse files

Update conf.py

parent b4af4d52
No related branches found
No related tags found
No related merge requests found
...@@ -12,19 +12,30 @@ def configureDoxyfile(template_file, output_file, input_dir, output_dir): ...@@ -12,19 +12,30 @@ def configureDoxyfile(template_file, output_file, input_dir, output_dir):
with open(output_file, 'w') as file: with open(output_file, 'w') as file:
file.write(filedata) file.write(filedata)
read_the_docs_build = os.environ.get('READTHEDOCS', None) == 'True' def getDocumentationUrl(base_name, repo_dir):
with open(repo_dir + "/.git/HEAD", 'r') as file :
lines = file.read().splitlines()
branchname=''
name=''
from pygit2 import Repository for line in lines:
if line[0:4] == "ref:":
branchname=line.partition("refs/heads/")[2]
if branch=='master': name='latest'
else: name=branchname
return base_name + '/' + name
repo = Repository('../') read_the_docs_build = os.environ.get('READTHEDOCS', None) == 'True'
# option 1 doc_url = ''
head = repo.head
if read_the_docs_build: if read_the_docs_build:
configureDoxyfile("Doxyfile.in", "Doxyfile", "../", "_build/workdir/doxygen") configureDoxyfile("Doxyfile.in", "Doxyfile", "../", "_build/workdir/doxygen")
s = subprocess.check_output(['git', 'rev-parse' , '--abbrev-ref' , 'HEAD']).decode() doc_url = getDocumentationUrl('https://corsika-8.readthedocs.io/en', '../')
print("@@@@@@@@>>>>>>>>>>>> s = " + s)
subprocess.call('mkdir -p _build/workdir/doxygen; doxygen Doxyfile', shell=True) subprocess.call('mkdir -p _build/workdir/doxygen; doxygen Doxyfile', shell=True)
html_extra_path = ['_build/workdir/'] html_extra_path = ['_build/workdir/']
...@@ -34,7 +45,7 @@ if read_the_docs_build: ...@@ -34,7 +45,7 @@ if read_the_docs_build:
# -- Project information ----------------------------------------------------- # -- Project information -----------------------------------------------------
project = head #u'CORSIKA8' project = head #u'CORSIKA8'
copyright = head #u'2021, CORSIKA 8 Collaboration' copyright = doc_url #u'2021, CORSIKA 8 Collaboration'
author = head #u'CORSIKA 8 Collaboration' author = head #u'CORSIKA 8 Collaboration'
# The short X.Y version # The short X.Y version
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment