Browse Source

Added auto version in the doc

pull/198/head
Eugenio Parodi 2 years ago
parent
commit
a37702560c
  1. 1
      Makefile
  2. 19
      docs/source/conf.py
  3. 7
      tools/prepareBuild.sh

1
Makefile

@ -27,6 +27,7 @@ doc: .venv
# rm -rf docs/html ; \ # rm -rf docs/html ; \
# pdoc --html TermTk -o docs/html ; \ # pdoc --html TermTk -o docs/html ; \
. .venv/bin/activate ; \ . .venv/bin/activate ; \
tools/prepareBuild.sh doc ; \
rm -rf docs/build ; \ rm -rf docs/build ; \
rm -rf docs/source/autogen.* ; \ rm -rf docs/source/autogen.* ; \
# sphinx-apidoc -o docs/source/TermTk/ -e TermTk/ ; \ # sphinx-apidoc -o docs/source/TermTk/ -e TermTk/ ; \

19
docs/source/conf.py

@ -22,7 +22,11 @@ copyright = '2021, Eugenio Parodi'
author = 'Eugenio Parodi' author = 'Eugenio Parodi'
# The full version, including alpha/beta/rc tags # The full version, including alpha/beta/rc tags
release = '0.2.0a' if os.path.exists(versionFile:=os.path.join(os.path.dirname(os.path.abspath(__file__)),'../../tmp/docversion.txt')):
with open(versionFile) as f:
release = f.read()
else:
release = 'X.XX.X-a'
# -- General configuration --------------------------------------------------- # -- General configuration ---------------------------------------------------
@ -68,7 +72,7 @@ html_theme_options = {
'collapse_navigation': True, 'collapse_navigation': True,
'sticky_navigation': True, 'sticky_navigation': True,
#'navigation_depth': 4, #'navigation_depth': 4,
'includehidden': False, 'includehidden': True,
#'titles_only': False #'titles_only': False
} }
@ -83,6 +87,8 @@ html_css_files = [
'ttk.css' 'ttk.css'
] ]
html_favicon = "https://ceccopierangiolieugenio.github.io/pyTermTk/sandbox/www/favicon.ico"
# html_theme = 'bizstyle' # html_theme = 'bizstyle'
#html_theme_options = { #html_theme_options = {
@ -142,7 +148,10 @@ autodoc_default_options = {}
# Mock pyodide to avoid autogen failure # Mock pyodide to avoid autogen failure
class pyodideProxy(): pass class pyodideProxy(): pass
moduleInput = type(sys)('pyodideProxy') sys.modules['pyodideProxy'] = pyodideProxy
moduleInput.pyodideProxy = pyodideProxy
class pyodide(): __version__ = "NA"
sys.modules['pyodide'] = pyodide
sys.modules['pyodideProxy'] = moduleInput class windll(): pass
sys.modules['ctypes.windll'] = windll

7
tools/prepareBuild.sh

@ -34,6 +34,7 @@ _PATCH=$( git describe --tags | sed 's,[0-9]*\.[0-9]*\.\([0-9]*\)[^0-9].*,\1,' )
_STAGE=$( git describe --tags | sed 's,[^-]*-a-\?\([0-9]*\).*,\1,' ) _STAGE=$( git describe --tags | sed 's,[^-]*-a-\?\([0-9]*\).*,\1,' )
_VERSION="${_MAJOR}.${_MINOR}.${_PATCH}-a${_STAGE}" _VERSION="${_MAJOR}.${_MINOR}.${_PATCH}-a${_STAGE}"
_DOCVERSION="${_MAJOR}.${_MINOR}.${_PATCH}-a"
_tools_usage() _tools_usage()
{ {
@ -77,6 +78,12 @@ case $1 in
_README='ttkDesigner/README.md' _README='ttkDesigner/README.md'
_CFG='ttkDesigner/app/cfg.py' _CFG='ttkDesigner/app/cfg.py'
;; ;;
doc)
rm -rf ${_TMP_PATH}
mkdir -p ${_TMP_PATH}
echo ${_DOCVERSION} > ${_TMP_PATH}/docversion.txt
exit 0
;;
*) *)
echo "Option \"$2\" not recognized" echo "Option \"$2\" not recognized"
echo "" echo ""

Loading…
Cancel
Save