diff --git a/docs/_templates/layout.html b/docs/_templates/layout.html new file mode 100644 index 0000000..fa97a22 --- /dev/null +++ b/docs/_templates/layout.html @@ -0,0 +1,19 @@ + +{% extends "!layout.html" %} + +{% block navigation %} + {{ super() }} + +{% endblock %} diff --git a/docs/conf.py b/docs/conf.py index ae919e6..89884b1 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -3,13 +3,19 @@ # For the full list of built-in configuration values, see the documentation: # https://www.sphinx-doc.org/en/master/usage/configuration.html -# from sphinx.builders.html import StandaloneHTMLBuilder +import os import subprocess -# import os +import sphinx.builders.html # Doxygen subprocess.call('doxygen DoxyfileEXRAIL', shell=True) +# Get current version/branch +try: + current_branch = subprocess.check_output(['git', 'rev-parse', '--abbrev-ref', 'HEAD']).decode('utf-8').strip() +except Exception as error: + current_branch = 'unknown' + # -- Project information ----------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information @@ -64,7 +70,7 @@ html_theme_options = { # 'titles_only': True, 'collapse_navigation': False, # 'navigation_depth': 3, - 'navigation_depth': -1, + 'navigation_depth': 1, 'analytics_id': 'G-L5X0KNBF0W', } @@ -80,8 +86,23 @@ html_css_files = [ 'css/sphinx_design_overrides.css', ] +baseurl_prefix = 'https://dcc-ex.com/CommandStation-EX/' + +# Change output directory depending on branch +if current_branch in ['master-exraildoc', 'master-exraildocdev']: + # For versioning + html_baseurl = f"{baseurl_prefix}{current_branch}/" + html_extra_path = ['_build'] + builddir = os.path.join('_build', current_branch) +else: + # Main landing page + html_baseurl = baseurl_prefix + builddir = '_build' + +# Override default build directory +sphinx.builders.html.get_outfilename = lambda self, pagename: os.path.join(builddir, pagename + '.html') + # Sphinx sitemap -html_baseurl = 'https://dcc-ex.com/CommandStation-EX/' html_extra_path = [ 'robots.txt', ] diff --git a/docs/index.rst b/docs/index.rst index 3f66b9f..8b80191 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -1,8 +1,5 @@ -.. EXRAIL2MacroReset documentation master file, created by - sphinx-quickstart on DATE. - -Welcome to EXRAIL2MacroReset's documentation! -=============================================== +EXRAIL Language documentation +============================= Introduction ------------ diff --git a/requirements.txt b/requirements.txt index cbfe4c2..256a154 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,17 +1,25 @@ alabaster==1.0.0 +attrs==25.1.0 babel==2.17.0 breathe==4.35.0 +cattrs==24.1.2 certifi==2025.1.31 charset-normalizer==3.4.1 colorama==0.4.6 docutils==0.21.2 +esbonio==0.16.5 +exceptiongroup==1.2.2 idna==3.10 imagesize==1.4.1 Jinja2==3.1.5 +lsprotocol==2023.0.1 MarkupSafe==3.0.2 packaging==24.2 +platformdirs==4.3.6 pyenchant==3.2.2 +pygls==1.3.1 Pygments==2.19.1 +pyspellchecker==0.8.2 requests==2.32.3 snowballstemmer==2.2.0 Sphinx==8.1.3 @@ -27,4 +35,5 @@ sphinxcontrib-qthelp==2.0.0 sphinxcontrib-serializinghtml==2.0.0 sphinxcontrib-spelling==8.0.1 tomli==2.2.1 +typing_extensions==4.12.2 urllib3==2.3.0