diff --git a/Makefile b/Makefile index c61affea..af924b44 100644 --- a/Makefile +++ b/Makefile @@ -27,6 +27,7 @@ doc: .venv # rm -rf docs/html ; \ # pdoc --html TermTk -o docs/html ; \ . .venv/bin/activate ; \ + tools/prepareBuild.sh doc ; \ rm -rf docs/build ; \ rm -rf docs/source/autogen.* ; \ # sphinx-apidoc -o docs/source/TermTk/ -e TermTk/ ; \ diff --git a/docs/source/conf.py b/docs/source/conf.py index e2a38b16..c3731ccf 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -22,7 +22,11 @@ copyright = '2021, Eugenio Parodi' author = 'Eugenio Parodi' # 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 --------------------------------------------------- @@ -68,7 +72,7 @@ html_theme_options = { 'collapse_navigation': True, 'sticky_navigation': True, #'navigation_depth': 4, - 'includehidden': False, + 'includehidden': True, #'titles_only': False } @@ -83,6 +87,8 @@ html_css_files = [ 'ttk.css' ] +html_favicon = "https://ceccopierangiolieugenio.github.io/pyTermTk/sandbox/www/favicon.ico" + # html_theme = 'bizstyle' #html_theme_options = { @@ -142,7 +148,10 @@ autodoc_default_options = {} # Mock pyodide to avoid autogen failure class pyodideProxy(): pass -moduleInput = type(sys)('pyodideProxy') -moduleInput.pyodideProxy = pyodideProxy +sys.modules['pyodideProxy'] = pyodideProxy + +class pyodide(): __version__ = "NA" +sys.modules['pyodide'] = pyodide -sys.modules['pyodideProxy'] = moduleInput +class windll(): pass +sys.modules['ctypes.windll'] = windll diff --git a/tools/prepareBuild.sh b/tools/prepareBuild.sh index de8c1550..7adaece7 100755 --- a/tools/prepareBuild.sh +++ b/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,' ) _VERSION="${_MAJOR}.${_MINOR}.${_PATCH}-a${_STAGE}" +_DOCVERSION="${_MAJOR}.${_MINOR}.${_PATCH}-a" _tools_usage() { @@ -77,6 +78,12 @@ case $1 in _README='ttkDesigner/README.md' _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 ""