Skip to content

Commit 758a60a

Browse files
authored
Merge pull request #192 from telegraphic/copilot/update-documentation-deployment
Update docs: replace recommonmark with myst-parser, add GitHub Pages CI deployment
2 parents e9a87b2 + 0ecbc04 commit 758a60a

3 files changed

Lines changed: 64 additions & 26 deletions

File tree

‎.github/workflows/docs.yml‎

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Deploy Docs
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
permissions:
9+
contents: read
10+
pages: write
11+
id-token: write
12+
13+
concurrency:
14+
group: pages
15+
cancel-in-progress: true
16+
17+
jobs:
18+
build:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v4
22+
23+
- name: Set up Python
24+
uses: actions/setup-python@v5
25+
with:
26+
python-version: '3.11'
27+
28+
- name: Install dependencies
29+
run: |
30+
python -m pip install --upgrade pip
31+
pip install sphinx myst-parser sphinx-rtd-theme
32+
pip install -e .
33+
34+
- name: Copy README as index
35+
run: cp README.md docs/source/index.md
36+
37+
- name: Build HTML docs
38+
run: make html
39+
working-directory: docs
40+
41+
- name: Upload Pages artifact
42+
uses: actions/upload-pages-artifact@v3
43+
with:
44+
path: docs/build/html
45+
46+
deploy:
47+
needs: build
48+
runs-on: ubuntu-latest
49+
environment:
50+
name: github-pages
51+
url: ${{ steps.deploy.outputs.page_url }}
52+
steps:
53+
- name: Deploy to GitHub Pages
54+
id: deploy
55+
uses: actions/deploy-pages@v4

‎.gitignore‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,6 @@
33
build/
44
dist/
55
.DS_Store
6-
.idea
6+
.ideahickle.egg-info/
7+
docs/source/index.md
8+
docs/build/

‎docs/source/conf.py‎

Lines changed: 6 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,11 @@
1616
# import sys
1717
# sys.path.insert(0, os.path.abspath('.'))
1818

19-
import recommonmark
20-
from recommonmark.transform import AutoStructify
21-
2219

2320
# -- Project information -----------------------------------------------------
2421

2522
project = u'hickle'
26-
copyright = u'2018-2020, Danny Price, Ellert van der Velden and contributors'
23+
copyright = u'2018-2025, Danny Price, Ellert van der Velden and contributors'
2724
author = u'Danny Price'
2825

2926
# The short X.Y version
@@ -44,30 +41,25 @@
4441
extensions = [
4542
'sphinx.ext.autodoc',
4643
'sphinx.ext.githubpages',
47-
'sphinx.ext.napoleon'
44+
'sphinx.ext.napoleon',
45+
'myst_parser'
4846
]
4947

5048
# Add any paths that contain templates here, relative to this directory.
5149
templates_path = ['_templates']
5250

5351
# The suffix(es) of source filenames.
54-
# You can specify multiple suffix as a list of string:
55-
#
56-
source_parsers = {
57-
'.md': 'recommonmark.parser.CommonMarkParser',
58-
}
59-
source_suffix = ['.rst', '.md']
60-
#source_suffix = '.rst'
52+
source_suffix = {'.rst': None, '.md': 'myst'}
6153

6254
# The master toctree document.
63-
master_doc = '../../README'
55+
master_doc = 'index'
6456

6557
# The language for content autogenerated by Sphinx. Refer to documentation
6658
# for a list of supported languages.
6759
#
6860
# This is also used if you do content translation via gettext catalogs.
6961
# Usually you set "language" from the command line for these cases.
70-
language = None
62+
language = 'en'
7163

7264
# List of patterns, relative to source directory, that match files and
7365
# directories to ignore when looking for source files.
@@ -84,7 +76,6 @@
8476
# a list of builtin themes.
8577
#
8678
html_theme = "sphinx_rtd_theme"
87-
html_theme_path = ["_themes", ]
8879

8980
# Theme options are theme-specific and customize the look and feel of a theme
9081
# further. For a list of options available for each theme, see the
@@ -181,13 +172,3 @@
181172

182173
# A list of files that should not be packed into the epub file.
183174
epub_exclude_files = ['search.html']
184-
185-
186-
# -- Extension configuration -------------------------------------------------
187-
188-
def setup(app):
189-
app.add_config_value('recommonmark_config', {
190-
'url_resolver': lambda url: github_doc_root + url,
191-
'auto_toc_tree_section': 'Contents',
192-
}, True)
193-
app.add_transform(AutoStructify)

0 commit comments

Comments
 (0)