Skip to content

Commit efedd37

Browse files
authored
Merge pull request #95 from guzman-raphael/docs
Documentation revamp
2 parents 3b98067 + c73c7b5 commit efedd37

File tree

26 files changed

+273
-211
lines changed

26 files changed

+273
-211
lines changed

.github/workflows/development.yaml

Lines changed: 28 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
11
name: Development
22
on:
3-
pull_request:
43
push:
4+
branches:
5+
- '**' # every branch
6+
- '!gh-pages' # exclude gh-pages branch
7+
- '!stage*' # exclude branches beginning with stage
58
tags:
6-
- "*.*.*"
9+
- '\d+\.\d+\.\d+' # only semver tags
10+
pull_request:
11+
branches:
12+
- '**' # every branch
13+
- '!gh-pages' # exclude gh-pages branch
14+
- '!stage*' # exclude branches beginning with stage
715
jobs:
816
test-changelog:
917
runs-on: ubuntu-latest
@@ -73,7 +81,9 @@ jobs:
7381
path: dist
7482
retention-days: 1
7583
publish-release:
76-
if: github.event_name == 'push'
84+
if: |
85+
github.event_name == 'push' &&
86+
startsWith(github.ref, 'refs/tags')
7787
needs: build
7888
runs-on: ubuntu-latest
7989
env:
@@ -146,15 +156,22 @@ jobs:
146156
asset_path: ${{env.PKG_SDIST_PATH}}
147157
asset_name: pip-${{env.SDIST_PKG_NAME}}-${{env.PKG_VERSION}}.tar.gz
148158
asset_content_type: application/gzip
149-
# Open Source documentation deploy workflow
150-
deploy-docs:
151-
if: github.event_name == 'push'
159+
publish-docs:
160+
if: |
161+
github.event_name == 'push' &&
162+
startsWith(github.ref, 'refs/tags')
152163
needs: build
153164
runs-on: ubuntu-latest
165+
env:
166+
DOCKER_CLIENT_TIMEOUT: "120"
167+
COMPOSE_HTTP_TIMEOUT: "120"
154168
steps:
155169
- 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
170+
- name: Deploy docs
171+
run: |
172+
export MODE=BUILD
173+
export PACKAGE=element_array_ephys
174+
export UPSTREAM_REPO=https://github.com/${GITHUB_REPOSITORY}.git
175+
export HOST_UID=$(id -u)
176+
docker compose -f docs/docker-compose.yaml up --exit-code-from docs --build
177+
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: 47 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,30 @@
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:
20+
font:
21+
text: Roboto Slab
22+
code: Source Code Pro
723
name: material
8-
custom_dir: overrides
9-
logo: assets/elements-logo-black.png
10-
favicon: assets/elements-logo.png
24+
custom_dir: src/.overrides
25+
icon:
26+
logo: main/project-logo-black
27+
favicon: assets/images/project-logo-color.png
1128
features:
1229
- toc.integrate
1330
palette:
@@ -21,39 +38,44 @@ theme:
2138
toggle:
2239
icon: material/brightness-4
2340
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-
3541
plugins:
3642
- search
3743
- redirects:
3844
redirect_maps:
39-
"index.md": "getting_started/index.md"
45+
"index.md": "getting_started.md"
4046
- mkdocstrings:
4147
default_handler: python
42-
48+
- gen-files:
49+
scripts:
50+
- ./src/api/make_pages.py
51+
- literate-nav:
52+
nav_file: navigation.md
53+
- exclude-search:
54+
exclude:
55+
- "*/navigation.md"
4356
markdown_extensions:
4457
- attr_list
4558
- toc:
4659
permalink: true
4760
- pymdownx.emoji:
4861
options:
4962
custom_icons:
50-
- overrides/.icons
51-
63+
- .overrides/.icons
64+
- mdx_truly_sane_lists
65+
- pymdownx.superfences:
66+
custom_fences:
67+
- name: mermaid
68+
class: mermaid
69+
format: !!python/name:pymdownx.superfences.fence_code_format
5270
extra:
5371
generator: false # Disable watermark
72+
version:
73+
provider: mike
5474
social:
55-
- icon: datajoint/dj-logo-white
75+
- icon: main/company-logo
5676
link: https://www.datajoint.com/
77+
- icon: fontawesome/solid/ticket
78+
link: https://support.djneuro.io/portal/en/home
5779
- icon: fontawesome/brands/slack
5880
link: https://datajoint.slack.com
5981
- icon: fontawesome/brands/linkedin
@@ -62,10 +84,13 @@ extra:
6284
link: https://twitter.com/DataJointIO
6385
- icon: fontawesome/brands/github
6486
link: https://github.com/datajoint
87+
- icon: fontawesome/brands/docker
88+
link: https://hub.docker.com/u/datajoint
89+
- icon: fontawesome/brands/python
90+
link: https://pypi.org/user/datajointbot
6591
- icon: fontawesome/brands/stack-overflow
6692
link: https://stackoverflow.com/questions/tagged/datajoint
6793
- icon: fontawesome/brands/youtube
6894
link: https://www.youtube.com/channel/UCdeCuFOTCXlVMRzh6Wk-lGg
69-
7095
extra_css:
71-
- stylesheets/extra.css
96+
- assets/stylesheets/extra.css

0 commit comments

Comments
 (0)