1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2025-02-26 18:46:04 +01:00

Trying versions

This commit is contained in:
peteGSX 2025-02-05 07:44:40 +10:00
parent 9fbeb36109
commit 3317890be4
4 changed files with 55 additions and 9 deletions

19
docs/_templates/layout.html vendored Normal file
View File

@ -0,0 +1,19 @@
<!-- _templates/layout.html -->
{% extends "!layout.html" %}
{% block navigation %}
{{ super() }}
<div class="sidebar-versions">
<div class="version-wrapper">
<label for="version-switch">Documentation Version:</label>
<select id="version-switch" onchange="window.location.href=this.value">
<option value="/{{ project|lower }}/master-exraildoc/"{% if version == "main" %} selected{% endif %}>
Production
</option>
<option value="/{{ project|lower }}/master-exraildocdev/"{% if version == "devel" %} selected{% endif %}>
Development
</option>
</select>
</div>
</div>
{% endblock %}

View File

@ -3,13 +3,19 @@
# For the full list of built-in configuration values, see the documentation: # For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html # https://www.sphinx-doc.org/en/master/usage/configuration.html
# from sphinx.builders.html import StandaloneHTMLBuilder import os
import subprocess import subprocess
# import os import sphinx.builders.html
# Doxygen # Doxygen
subprocess.call('doxygen DoxyfileEXRAIL', shell=True) 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 ----------------------------------------------------- # -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information # https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
@ -64,7 +70,7 @@ html_theme_options = {
# 'titles_only': True, # 'titles_only': True,
'collapse_navigation': False, 'collapse_navigation': False,
# 'navigation_depth': 3, # 'navigation_depth': 3,
'navigation_depth': -1, 'navigation_depth': 1,
'analytics_id': 'G-L5X0KNBF0W', 'analytics_id': 'G-L5X0KNBF0W',
} }
@ -80,8 +86,23 @@ html_css_files = [
'css/sphinx_design_overrides.css', '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 # Sphinx sitemap
html_baseurl = 'https://dcc-ex.com/CommandStation-EX/'
html_extra_path = [ html_extra_path = [
'robots.txt', 'robots.txt',
] ]

View File

@ -1,8 +1,5 @@
.. EXRAIL2MacroReset documentation master file, created by EXRAIL Language documentation
sphinx-quickstart on DATE. =============================
Welcome to EXRAIL2MacroReset's documentation!
===============================================
Introduction Introduction
------------ ------------

View File

@ -1,17 +1,25 @@
alabaster==1.0.0 alabaster==1.0.0
attrs==25.1.0
babel==2.17.0 babel==2.17.0
breathe==4.35.0 breathe==4.35.0
cattrs==24.1.2
certifi==2025.1.31 certifi==2025.1.31
charset-normalizer==3.4.1 charset-normalizer==3.4.1
colorama==0.4.6 colorama==0.4.6
docutils==0.21.2 docutils==0.21.2
esbonio==0.16.5
exceptiongroup==1.2.2
idna==3.10 idna==3.10
imagesize==1.4.1 imagesize==1.4.1
Jinja2==3.1.5 Jinja2==3.1.5
lsprotocol==2023.0.1
MarkupSafe==3.0.2 MarkupSafe==3.0.2
packaging==24.2 packaging==24.2
platformdirs==4.3.6
pyenchant==3.2.2 pyenchant==3.2.2
pygls==1.3.1
Pygments==2.19.1 Pygments==2.19.1
pyspellchecker==0.8.2
requests==2.32.3 requests==2.32.3
snowballstemmer==2.2.0 snowballstemmer==2.2.0
Sphinx==8.1.3 Sphinx==8.1.3
@ -27,4 +35,5 @@ sphinxcontrib-qthelp==2.0.0
sphinxcontrib-serializinghtml==2.0.0 sphinxcontrib-serializinghtml==2.0.0
sphinxcontrib-spelling==8.0.1 sphinxcontrib-spelling==8.0.1
tomli==2.2.1 tomli==2.2.1
typing_extensions==4.12.2
urllib3==2.3.0 urllib3==2.3.0