Skip to content

Commit a304d31

Browse files
Upgrade documentation to latest design and automation.
1 parent 3b98067 commit a304d31

File tree

24 files changed

+198
-191
lines changed

24 files changed

+198
-191
lines changed

.github/workflows/development.yaml

Lines changed: 29 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,18 @@
1+
# a lot of work here
12
name: Development
23
on:
3-
pull_request:
44
push:
5+
branches:
6+
- '**' # every branch
7+
- '!gh-pages' # exclude gh-pages branch
8+
- '!stage*' # exclude branches beginning with stage
59
tags:
6-
- "*.*.*"
10+
- '\d+\.\d+\.\d+' # only semver tags
11+
pull_request:
12+
branches:
13+
- '**' # every branch
14+
- '!gh-pages' # exclude gh-pages branch
15+
- '!stage*' # exclude branches beginning with stage
716
jobs:
817
test-changelog:
918
runs-on: ubuntu-latest
@@ -73,7 +82,9 @@ jobs:
7382
path: dist
7483
retention-days: 1
7584
publish-release:
76-
if: github.event_name == 'push'
85+
if: |
86+
github.event_name == 'push' &&
87+
startsWith(github.ref, 'refs/tags')
7788
needs: build
7889
runs-on: ubuntu-latest
7990
env:
@@ -146,15 +157,22 @@ jobs:
146157
asset_path: ${{env.PKG_SDIST_PATH}}
147158
asset_name: pip-${{env.SDIST_PKG_NAME}}-${{env.PKG_VERSION}}.tar.gz
148159
asset_content_type: application/gzip
149-
# Open Source documentation deploy workflow
150-
deploy-docs:
151-
if: github.event_name == 'push'
160+
publish-docs:
161+
if: |
162+
github.event_name == 'push' &&
163+
startsWith(github.ref, 'refs/tags')
152164
needs: build
153165
runs-on: ubuntu-latest
166+
env:
167+
DOCKER_CLIENT_TIMEOUT: "120"
168+
COMPOSE_HTTP_TIMEOUT: "120"
154169
steps:
155170
- uses: actions/checkout@v2
156-
- uses: actions/setup-python@v2
157-
with:
158-
python-version: 3.x
159-
- run: pip install mkdocs-material mkdocs-redirects mkdocstrings mkdocstrings-python
160-
- run: mkdocs gh-deploy --force --config-file ./docs/mkdocs.yml
171+
- name: Deploy docs
172+
run: |
173+
export MODE=BUILD
174+
export PACKAGE=element_array_ephys
175+
export UPSTREAM_REPO=https://github.com/${GITHUB_REPOSITORY}.git
176+
export HOST_UID=$(id -u)
177+
docker compose -f docs/docker-compose.yaml up --exit-code-from docs --build
178+
git push origin gh-pages

.gitignore

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ ENV/
101101
.ropeproject
102102

103103
# mkdocs documentation
104-
/site
104+
docs/site
105105

106106
# mypy
107107
.mypy_cache/
@@ -115,4 +115,7 @@ dj_local_conf_old.json
115115
**/#*#
116116
**/.#*
117117

118-
docker-compose.y*ml
118+
docker-compose.y*ml
119+
120+
# include
121+
!docs/docker-compose.yaml

CHANGELOG.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ Observes [Semantic Versioning](https://semver.org/spec/v2.0.0.html) standard and
3939
+ Add - Readers for: `SpikeGLX`, `Open Ephys`, `Kilosort`
4040
+ Add - Probe table supporting: Neuropixels probes 1.0 - 3A, 1.0 - 3B, 2.0 - SS, 2.0 - MS
4141

42-
[0.1.4]: https://github.com/datajoint/element-array-ephys/releases/tag/0.1.4
43-
[0.1.3]: https://github.com/datajoint/element-array-ephys/releases/tag/0.1.3
44-
[0.1.2]: https://github.com/datajoint/element-array-ephys/releases/tag/0.1.2
45-
[0.1.1]: https://github.com/datajoint/element-array-ephys/releases/tag/0.1.1
42+
[0.1.4]: https://github.com/datajoint/element-array-ephys/compare/0.1.3...0.1.4
43+
[0.1.3]: https://github.com/datajoint/element-array-ephys/compare/0.1.2...0.1.3
44+
[0.1.2]: https://github.com/datajoint/element-array-ephys/compare/0.1.1...0.1.2
45+
[0.1.1]: https://github.com/datajoint/element-array-ephys/compare/0.1.0...0.1.1
4646
[0.1.0]: https://github.com/datajoint/element-array-ephys/compare/0.1.0b0...0.1.0
47-
[0.1.0b0]: https://github.com/datajoint/element-array-ephys/releases/tag/0.1.0b0
47+
[0.1.0b0]: https://github.com/datajoint/element-array-ephys/compare/0.1.0a5...0.1.0b0
4848
[0.1.0a5]: https://github.com/datajoint/element-array-ephys/releases/tag/0.1.0a5

docs/.docker/Dockerfile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
FROM datajoint/miniconda3:4.10.3-py3.9-alpine
2+
ARG PACKAGE
3+
WORKDIR /main
4+
COPY --chown=anaconda:anaconda ./docs/.docker/apk_requirements.txt ${APK_REQUIREMENTS}
5+
COPY --chown=anaconda:anaconda ./docs/.docker/pip_requirements.txt ${PIP_REQUIREMENTS}
6+
RUN \
7+
/entrypoint.sh echo "Dependencies installed" && \
8+
git config --global user.name "GitHub Action" && \
9+
git config --global user.email "action@github.com"&& \
10+
git config --global pull.rebase false && \
11+
git init
12+
COPY --chown=anaconda:anaconda ./${PACKAGE} /main/${PACKAGE}
13+
COPY --chown=anaconda:anaconda ./docs/mkdocs.yaml /main/docs/mkdocs.yaml
14+
COPY --chown=anaconda:anaconda ./docs/src /main/docs/src
15+
COPY --chown=anaconda:anaconda ./CHANGELOG.md /main/docs/src/about/changelog.md

docs/.docker/apk_requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
git

docs/.docker/pip_requirements.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
mkdocs-material
2+
mkdocs-redirects
3+
mkdocstrings
4+
mkdocstrings-python
5+
mike
6+
mdx-truly-sane-lists
7+
mkdocs-gen-files
8+
mkdocs-literate-nav
9+
mkdocs-exclude-search

docs/docker-compose-docs-serve.yaml

Lines changed: 0 additions & 22 deletions
This file was deleted.

docs/docker-compose.yaml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# MODE="LIVE|QA|BUILD" PACKAGE=element_array_ephys UPSTREAM_REPO=https://github.com/datajoint/element-array-ephys.git HOST_UID=$(id -u) docker compose -f docs/docker-compose.yaml up --build
2+
#
3+
# navigate to http://localhost/
4+
version: "2.4"
5+
services:
6+
docs:
7+
build:
8+
dockerfile: docs/.docker/Dockerfile
9+
context: ../
10+
args:
11+
- PACKAGE
12+
image: ${PACKAGE}-docs
13+
environment:
14+
- PACKAGE
15+
- UPSTREAM_REPO
16+
- MODE
17+
volumes:
18+
- ..:/main
19+
user: ${HOST_UID}:anaconda
20+
ports:
21+
- 80:80
22+
command:
23+
- sh
24+
- -c
25+
- |
26+
set -e
27+
if echo "$${MODE}" | grep -i live &>/dev/null; then
28+
mkdocs serve --config-file ./docs/mkdocs.yaml -a 0.0.0.0:80
29+
elif echo "$${MODE}" | grep -iE "qa|build" &>/dev/null; then
30+
git branch -D gh-pages || true
31+
git fetch $${UPSTREAM_REPO} gh-pages:gh-pages || true
32+
mike deploy --config-file ./docs/mkdocs.yaml -u $$(grep -oE '\d+\.\d+' /main/$${PACKAGE}/version.py) latest
33+
mike set-default --config-file ./docs/mkdocs.yaml latest
34+
if echo "$${MODE}" | grep -i qa &>/dev/null; then
35+
mike serve --config-file ./docs/mkdocs.yaml -a 0.0.0.0:80
36+
fi
37+
else
38+
echo "Unexpected mode..."
39+
exit 1
40+
fi

docs/docs.dockerfile

Lines changed: 0 additions & 8 deletions
This file was deleted.
Lines changed: 37 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,26 @@
1+
# ---------------------- PROJECT SPECIFIC ---------------------------
2+
13
site_name: Element Array Ephys
24
repo_url: https://github.com/datajoint/element-array-ephys
35
repo_name: datajoint/element-array-ephys
4-
docs_dir: ./src/
6+
nav:
7+
- Element Array Ephys: getting_started.md
8+
- Getting Started: getting_started.md
9+
- Concepts: concepts.md
10+
- Tutorials: tutorials.md
11+
- About:
12+
- Changelog: about/changelog.md
13+
- API: api/ # defer to gen-files + literate-nav
514

15+
# ---------------------------- STANDARD -----------------------------
16+
17+
edit_uri: ./edit/main/docs/src
18+
docs_dir: ./src
619
theme:
720
name: material
8-
custom_dir: overrides
9-
logo: assets/elements-logo-black.png
10-
favicon: assets/elements-logo.png
21+
custom_dir: src/.overrides
22+
logo: assets/images/project-logo-black.png
23+
favicon: assets/images/project-logo-color.png
1124
features:
1225
- toc.integrate
1326
palette:
@@ -21,38 +34,41 @@ theme:
2134
toggle:
2235
icon: material/brightness-4
2336
name: Switch to light mode
24-
25-
nav:
26-
- Element Array Ephys: getting_started/index.md
27-
- Getting Started:
28-
- Installation: getting_started/index.md
29-
- Set Up: getting_started/setup.md
30-
- Tutorials: tutorials.md
31-
- Concepts: concepts.md
32-
- About: about.md
33-
- API: api.md
34-
3537
plugins:
3638
- search
3739
- redirects:
3840
redirect_maps:
39-
"index.md": "getting_started/index.md"
41+
"index.md": "getting_started.md"
4042
- mkdocstrings:
4143
default_handler: python
42-
44+
- gen-files:
45+
scripts:
46+
- ./src/api/make_pages.py
47+
- literate-nav:
48+
nav_file: navigation.md
49+
- exclude-search:
50+
exclude:
51+
- "*/navigation.md"
4352
markdown_extensions:
4453
- attr_list
4554
- toc:
4655
permalink: true
4756
- pymdownx.emoji:
4857
options:
4958
custom_icons:
50-
- overrides/.icons
51-
59+
- .overrides/.icons
60+
- mdx_truly_sane_lists
61+
- pymdownx.superfences:
62+
custom_fences:
63+
- name: mermaid
64+
class: mermaid
65+
format: !!python/name:pymdownx.superfences.fence_code_format
5266
extra:
5367
generator: false # Disable watermark
68+
version:
69+
provider: mike
5470
social:
55-
- icon: datajoint/dj-logo-white
71+
- icon: datajoint/company-logo
5672
link: https://www.datajoint.com/
5773
- icon: fontawesome/brands/slack
5874
link: https://datajoint.slack.com
@@ -66,6 +82,5 @@ extra:
6682
link: https://stackoverflow.com/questions/tagged/datajoint
6783
- icon: fontawesome/brands/youtube
6884
link: https://www.youtube.com/channel/UCdeCuFOTCXlVMRzh6Wk-lGg
69-
7085
extra_css:
71-
- stylesheets/extra.css
86+
- assets/stylesheets/extra.css

0 commit comments

Comments
 (0)