mirror of
https://github.com/DCC-EX/CommandStation-EX.git
synced 2025-02-26 18:46:04 +01:00
Merge pull request #438 from DCC-EX:master-exraildocdev
Update template
This commit is contained in:
commit
eb09985480
24
.github/workflows/docs.yml
vendored
24
.github/workflows/docs.yml
vendored
@ -2,7 +2,9 @@ name: Docs
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ master-exraildoc ]
|
branches:
|
||||||
|
- master-exraildoc
|
||||||
|
- master-exraildocdev
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ master ]
|
branches: [ master ]
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
@ -11,17 +13,31 @@ jobs:
|
|||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repo
|
- name: Checkout
|
||||||
uses: actions/checkout@v4.1.1
|
uses: actions/checkout@v4.1.1
|
||||||
- name: Requirements
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Install Requirements
|
||||||
run: |
|
run: |
|
||||||
|
python -m pip install --upgrade pip
|
||||||
pip3 install -r requirements.txt
|
pip3 install -r requirements.txt
|
||||||
sudo apt-get install doxygen
|
sudo apt-get install doxygen
|
||||||
- name: Build docs
|
|
||||||
|
- name: Build Devel docs
|
||||||
run: |
|
run: |
|
||||||
|
git checkout master-exraildocdev
|
||||||
|
cd docs
|
||||||
|
make html
|
||||||
|
cd ..
|
||||||
|
|
||||||
|
- name: Build Prod docs
|
||||||
|
run: |
|
||||||
|
git checkout master-exraildoc
|
||||||
cd docs
|
cd docs
|
||||||
make html
|
make html
|
||||||
touch _build/html/.nojekyll
|
touch _build/html/.nojekyll
|
||||||
|
|
||||||
- name: Deploy
|
- name: Deploy
|
||||||
uses: JamesIves/github-pages-deploy-action@ba1486788b0490a235422264426c45848eac35c6
|
uses: JamesIves/github-pages-deploy-action@ba1486788b0490a235422264426c45848eac35c6
|
||||||
with:
|
with:
|
||||||
|
@ -6,7 +6,15 @@
|
|||||||
SPHINXOPTS ?=
|
SPHINXOPTS ?=
|
||||||
SPHINXBUILD ?= sphinx-build
|
SPHINXBUILD ?= sphinx-build
|
||||||
SOURCEDIR = .
|
SOURCEDIR = .
|
||||||
BUILDDIR = _build
|
# BUILDDIR = _build
|
||||||
|
|
||||||
|
# Determine build directory based on git branch
|
||||||
|
BRANCH := $(shell git rev-parse --abbrev-ref HEAD)
|
||||||
|
ifeq ($(BRANCH),master-exraildocdev)
|
||||||
|
BUILDDIR = _build/devel
|
||||||
|
else
|
||||||
|
BUILDDIR = _build
|
||||||
|
endif
|
||||||
|
|
||||||
# Put it first so that "make" without argument is like "make help".
|
# Put it first so that "make" without argument is like "make help".
|
||||||
help:
|
help:
|
||||||
|
4
docs/_templates/layout.html
vendored
4
docs/_templates/layout.html
vendored
@ -7,10 +7,10 @@
|
|||||||
<div class="version-wrapper">
|
<div class="version-wrapper">
|
||||||
<label for="version-switch">Documentation Version:</label>
|
<label for="version-switch">Documentation Version:</label>
|
||||||
<select id="version-switch" onchange="window.location.href=this.value">
|
<select id="version-switch" onchange="window.location.href=this.value">
|
||||||
<option value="/{{ project|lower }}/master-exraildoc/"{% if version == "main" %} selected{% endif %}>
|
<option value="/CommandStation-EX/"{% if version == "main" %} selected{% endif %}>
|
||||||
Production
|
Production
|
||||||
</option>
|
</option>
|
||||||
<option value="/{{ project|lower }}/master-exraildocdev/"{% if version == "devel" %} selected{% endif %}>
|
<option value="/CommandStation-EX/devel/"{% if version == "devel" %} selected{% endif %}>
|
||||||
Development
|
Development
|
||||||
</option>
|
</option>
|
||||||
</select>
|
</select>
|
||||||
|
15
docs/conf.py
15
docs/conf.py
@ -53,7 +53,6 @@ numfig_format = {'figure': 'Figure %s'}
|
|||||||
|
|
||||||
# -- Options for HTML output -------------------------------------------------
|
# -- Options for HTML output -------------------------------------------------
|
||||||
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
|
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
|
||||||
|
|
||||||
html_theme = 'sphinx_rtd_theme'
|
html_theme = 'sphinx_rtd_theme'
|
||||||
html_static_path = ['_static']
|
html_static_path = ['_static']
|
||||||
|
|
||||||
@ -88,19 +87,15 @@ html_css_files = [
|
|||||||
|
|
||||||
baseurl_prefix = 'https://dcc-ex.com/CommandStation-EX/'
|
baseurl_prefix = 'https://dcc-ex.com/CommandStation-EX/'
|
||||||
|
|
||||||
# Change output directory depending on branch
|
# Devel documentation needs to be a different directory
|
||||||
if current_branch in ['master-exraildoc', 'master-exraildocdev']:
|
if current_branch == 'master-exraildocdev':
|
||||||
# For versioning
|
# For versioning
|
||||||
html_baseurl = f"{baseurl_prefix}{current_branch}/"
|
html_baseurl = f"{baseurl_prefix}devel/"
|
||||||
html_extra_path = ['_build']
|
html_build_dir = os.path.abspath(os.path.join('_build', 'devel'))
|
||||||
builddir = os.path.join('_build', current_branch)
|
|
||||||
else:
|
else:
|
||||||
# Main landing page
|
# Main landing page
|
||||||
html_baseurl = baseurl_prefix
|
html_baseurl = baseurl_prefix
|
||||||
builddir = '_build'
|
html_build_dir = os.path.abspath('_build')
|
||||||
|
|
||||||
# Override default build directory
|
|
||||||
sphinx.builders.html.get_outfilename = lambda self, pagename: os.path.join(builddir, pagename + '.html')
|
|
||||||
|
|
||||||
# Sphinx sitemap
|
# Sphinx sitemap
|
||||||
html_extra_path = [
|
html_extra_path = [
|
||||||
|
@ -8,7 +8,14 @@ if "%SPHINXBUILD%" == "" (
|
|||||||
set SPHINXBUILD=sphinx-build
|
set SPHINXBUILD=sphinx-build
|
||||||
)
|
)
|
||||||
set SOURCEDIR=.
|
set SOURCEDIR=.
|
||||||
set BUILDDIR=_build
|
@REM set BUILDDIR=_build
|
||||||
|
|
||||||
|
for /f "tokens=*" %%g in ('git rev-parse --abbrev-ref HEAD') do (set BRANCH=%%g)
|
||||||
|
if "%BRANCH%"=="master-exraildocdev" (
|
||||||
|
set BUILDDIR=_build\devel
|
||||||
|
) else (
|
||||||
|
set BUILDDIR=_build
|
||||||
|
)
|
||||||
|
|
||||||
%SPHINXBUILD% >NUL 2>NUL
|
%SPHINXBUILD% >NUL 2>NUL
|
||||||
if errorlevel 9009 (
|
if errorlevel 9009 (
|
||||||
|
Loading…
Reference in New Issue
Block a user