Skip to content

Commit 5e98bd2

Browse files
authored
Merge pull request #2 from VHDL/ci/docs
Updated CI Scripting and Documentation Publishing to GH-Pages
2 parents e841ce5 + 0835411 commit 5e98bd2

File tree

6 files changed

+81
-42
lines changed

6 files changed

+81
-42
lines changed

.btd.yml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
input: doc
2+
output: _build
3+
requirements: requirements.txt
4+
target: gh-pages
5+
formats: [ html, pdf, man ]
6+
images:
7+
latex: btdi/latex
8+
theme: https://codeload.github.com/buildthedocs/sphinx.theme/tar.gz/v0

.github/workflows/doc.yml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Doc
2+
3+
on:
4+
push:
5+
6+
jobs:
7+
8+
btd:
9+
runs-on: ubuntu-latest
10+
steps:
11+
12+
- uses: actions/checkout@v2
13+
14+
- uses: buildthedocs/btd@v0
15+
with:
16+
token: ${{ github.token }}
17+
18+
- uses: actions/upload-artifact@master
19+
with:
20+
name: doc
21+
path: doc/_build/html

.readthedocs.yml

-21
This file was deleted.

doc/Makefile

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
CP=cp
2+
3+
# Sphinx options.
4+
SPHINXOPTS =
5+
SPHINXBUILD = sphinx-build
6+
PAPER =
7+
BUILDDIR = _build
8+
9+
PAPEROPT_a4 = -D latex_paper_size=a4
10+
PAPEROPT_letter = -D latex_paper_size=letter
11+
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees -T -D language=en $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
12+
13+
all: html latex
14+
15+
#---
16+
17+
man:
18+
$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
19+
20+
#---
21+
22+
html:
23+
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
24+
25+
#---
26+
27+
latex:
28+
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex

doc/conf.py

+23-17
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,17 @@
1-
# Configuration file for the Sphinx documentation builder.
2-
#
3-
# This file only contains a selection of the most common options. For a full
4-
# list see the documentation:
5-
# https://www.sphinx-doc.org/en/master/usage/configuration.html
6-
7-
# -- Path setup --------------------------------------------------------------
1+
import sys, re
2+
from os.path import abspath
3+
from pathlib import Path
4+
from json import dump, loads
85

96
# If extensions (or modules to document with autodoc) are in another directory,
107
# add these directories to sys.path here. If the directory is relative to the
118
# documentation root, use os.path.abspath to make it absolute, like shown here.
129
import os
1310
import sys
14-
sys.path.insert(0, os.path.abspath('.'))
15-
sys.path.insert(0, os.path.abspath('..'))
16-
sys.path.insert(0, os.path.abspath('../pyVHDLModel'))
17-
#sys.path.insert(0, os.path.abspath('_extensions'))
18-
#sys.path.insert(0, os.path.abspath('_themes/sphinx_rtd_theme'))
11+
sys.path.insert(0, abspath('.'))
12+
sys.path.insert(0, abspath('..'))
13+
sys.path.insert(0, abspath('../pyVHDLModel'))
14+
#sys.path.insert(0, abspath('_extensions'))
1915

2016

2117
# ==============================================================================
@@ -93,14 +89,27 @@ def _LatestTagName():
9389
# ==============================================================================
9490
# Options for HTML output
9591
# ==============================================================================
96-
# html_theme = 'alabaster'
97-
html_theme = 'sphinx_rtd_theme'
92+
html_theme_options = {
93+
'home_breadcrumbs': True,
94+
'vcs_pageview_mode': 'blob',
95+
}
96+
97+
html_context = {}
98+
ctx = Path(__file__).resolve().parent / 'context.json'
99+
if ctx.is_file():
100+
html_context.update(loads(ctx.open('r').read()))
101+
102+
html_theme_path = ["."]
103+
html_theme = "_theme"
98104

99105
# Add any paths that contain custom static files (such as style sheets) here,
100106
# relative to this directory. They are copied after the builtin static files,
101107
# so a file named "default.css" will overwrite the builtin "default.css".
102108
html_static_path = ['_static']
103109

110+
# Output file base name for HTML help builder.
111+
htmlhelp_basename = 'pyVHDLModelDoc'
112+
104113
# If not None, a 'Last updated on:' timestamp is inserted at every page
105114
# bottom, using the given strftime format.
106115
# The empty string is equivalent to '%b %d, %Y'.
@@ -159,9 +168,6 @@ def _LatestTagName():
159168
# Extensions
160169
# ==============================================================================
161170
extensions = [
162-
# Sphinx theme
163-
"sphinx_rtd_theme",
164-
165171
# Standard Sphinx extensions
166172
"sphinx.ext.autodoc",
167173
'sphinx.ext.extlinks',

doc/requirements.txt

+1-4
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,8 @@
22
# Enforce latest version on ReadTheDocs
33
sphinx>=3.4.1
44

5-
# Sphinx Themes
6-
sphinx-rtd-theme>=0.5.0
7-
85
# Sphinx Extenstions
9-
sphinx.ext.coverage
6+
#sphinx.ext.coverage
107
#sphinxcontrib-actdiag>=0.8.5
118
#sphinxcontrib-seqdiag>=0.8.5
129
#sphinxcontrib-textstyle>=0.2.1

0 commit comments

Comments
 (0)