Skip to content

Commit

Permalink
Update conf.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Raul-mz authored Sep 4, 2020
1 parent 45eee55 commit a27912c
Showing 1 changed file with 1 addition and 74 deletions.
75 changes: 1 addition & 74 deletions src/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
import os
# import os
# import sys
# sys.path.insert(0, os.path.abspath('.'))

Expand All @@ -25,9 +25,6 @@
project = 'ERPYA'
copyright = '2020, ADempiere ERP'
author = 'E.R.P. Consultores y Asociados, C.A.'
scv_greatest_tag = True

scv_whitelist_branches = ('master')
# The short X.Y version
version = '1.0'

Expand Down Expand Up @@ -94,76 +91,6 @@
html_theme = 'sphinx_rtd_theme'
#html_theme_path = ['/usr/local/lib/python2.7/site-packages']

try:
html_context
except NameError:
html_context = dict()
html_context['display_lower_left'] = True

if 'REPO_NAME' in os.environ:
REPO_NAME = os.environ['REPO_NAME']
else:
REPO_NAME = ''

# SET CURRENT_LANGUAGE
if 'current_language' in os.environ:
# get the current_language env var set by buildDocs.sh
current_language = os.environ['current_language']
else:
# the user is probably doing `make html`
# set this build's current language to english
current_language = 'en'

# tell the theme which language to we're currently building
html_context['current_language'] = current_language

# SET CURRENT_VERSION
from git import Repo
repo = Repo( search_parent_directories=True )

if 'current_version' in os.environ:
# get the current_version env var set by buildDocs.sh
current_version = os.environ['current_version']
else:
# the user is probably doing `make html`
# set this build's current version by looking at the branch
current_version = repo.active_branch.name

# tell the theme which version we're currently on ('current_version' affects
# the lower-left rtd menu and 'version' affects the logo-area version)
html_context['current_version'] = current_version
html_context['version'] = current_version

# POPULATE LINKS TO OTHER LANGUAGES
html_context['languages'] = [ ('en', '/' +REPO_NAME+ '/en/' +current_version+ '/') ]


# POPULATE LINKS TO OTHER VERSIONS
html_context['versions'] = list()

versions = [branch.name for branch in repo.branches]
for version in versions:
html_context['versions'].append( (version, '/' +REPO_NAME+ '/' +current_language+ '/' +version+ '/') )

# POPULATE LINKS TO OTHER FORMATS/DOWNLOADS

# settings for creating PDF with rinoh
rinoh_documents = [(
master_doc,
'target',
project+ ' Documentation',
'© ' +copyright,
)]
today_fmt = "%B %d, %Y"

# settings for EPUB
epub_basename = 'target'

html_context['downloads'] = list()
html_context['downloads'].append( ('pdf', '/' +REPO_NAME+ '/' +current_language+ '/' +current_version+ '/' +project+ '-docs_' +current_language+ '_' +current_version+ '.pdf') )

html_context['downloads'].append( ('epub', '/' +REPO_NAME+ '/' +current_language+ '/' +current_version+ '/' +project+ '-docs_' +current_language+ '_' +current_version+ '.epub') )


# Control display of sidebars
html_sidebars = {'**': [
Expand Down

0 comments on commit a27912c

Please sign in to comment.