Skip to content

Commit ea8f52c

Browse files
Merge pull request #86 from MilagrosMarin/update/docs-content
Comprehensive datajoint-docs updates: content, structure, and configuration
2 parents d805d0c + f3212fb commit ea8f52c

35 files changed

+629
-400
lines changed

.docker/Dockerfile

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

.docker/apk_requirements.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

.github/workflows/development.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
- uses: actions/checkout@v2
1515
- name: Compile docs static artifacts
1616
run: |
17-
GITHUB_TOKEN=$DJBOT_GH_TOKEN MODE=BUILD HOST_UID=$(id -u) docker compose up --exit-code-from docs --build
17+
BOT_PAT=$DJBOT_GH_TOKEN MODE=BUILD HOST_UID=$(id -u) docker compose up --exit-code-from docs --build
1818
- name: Commit documentation changes
1919
run: |
2020
git clone https://github.com/${GITHUB_REPOSITORY}.git \

.markdownlint.yaml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,24 @@
11
# https://github.com/DavidAnson/markdownlint
22
# https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md
3+
MD007: false # Unordered list indentation
34
MD009: false # permit trailing spaces
4-
MD013:
5-
line_length: "88" # Line length limits
5+
MD013:
6+
# previously we defined line_length to 88 which is better for python
7+
# but not for markdown
8+
line_length:
9+
- strict: false
610
tables: false # disable for tables
711
headings: false # disable for headings
12+
MD029: false # Ordered list item prefix
813
MD030: false # Number of spaces after a list
14+
MD032: false # Lists should be surrounded by blank lines
915
MD033: # HTML elements allowed
10-
allowed_elements:
16+
allowed_elements:
1117
- "div"
1218
- "span"
1319
- "a"
1420
- "br"
15-
- "sup"
21+
- "sup"
1622
- "figure"
1723
MD034: false # Bare URLs OK
1824
MD031: false # Spacing w/code blocks. Conflicts with `??? Note` and code tab styling

.vscode/extensions.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"recommendations": [
3+
"streetsidesoftware.code-spell-checker",
4+
"DavidAnson.vscode-markdownlint",
5+
"stkb.rewrap"
6+
]
7+
}

.vscode/settings.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"[markdown]" : {
2+
"[markdown]": {
33
"editor.rulers": [88],
44
"editor.formatOnPaste": true,
55
"editor.formatOnSave": true,
@@ -11,7 +11,7 @@
1111
},
1212
// https://github.com/DavidAnson/markdownlint
1313
"editor.codeActionsOnSave": {
14-
"source.fixAll.markdownlint":true
14+
"source.fixAll.markdownlint": "always"
1515
},
16-
"markdownlint.focusMode": 5, // ignore issues around the cursor
17-
}
16+
"markdownlint.focusMode": 5 // ignore issues around the cursor
17+
}

Dockerfile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
FROM python:3-alpine
2+
3+
WORKDIR /main
4+
COPY mkdocs.yaml mkdocs.yaml
5+
COPY src/ src/
6+
COPY pip_requirements.txt pip_requirements.txt
7+
8+
RUN \
9+
apk add --no-cache git && \
10+
pip install --no-cache-dir -r /main/pip_requirements.txt

README.md

Lines changed: 76 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,91 @@
22

33
This is the home for DataJoint software documentation as hosted at https://datajoint.com/docs
44

5-
## Test Locally
6-
7-
To run locally, ensure you have `Docker` and `Docker Compose` installed.
8-
9-
Then run the following:
10-
11-
`MODE="LIVE" HOST_UID=$(id -u) docker compose up --build`
12-
13-
Navigate to `http://localhost/` to preview the changes.
14-
15-
This setup supports live-reloading so all that is needed is to save the markdown files
16-
and/or `mkdocs.yaml` file to trigger a reload.
17-
18-
## Linters and Settings
5+
## VSCode Linter Extensions and Settings
196

207
The following extensions were used in developing these docs, with the corresponding
218
settings files:
229

23-
- [MarkdownLinter](https://github.com/DavidAnson/markdownlint):
10+
- Recommended extensions are already specified in `.vscode/extensions.json`, it will ask you to install them when you open the project if you haven't installed them.
11+
- settings in `.vscode/settings.json`
12+
- [MarkdownLinter](https://marketplace.visualstudio.com/items?itemName=DavidAnson.vscode-markdownlint):
2413
- `.markdownlint.yaml` establishes settings for various
2514
[linter rules](https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md)
2615
- `.vscode/settings.json` formatting on save to fix linting
2716

28-
- [CSpell](https://github.com/streetsidesoftware/vscode-spell-checker): `cspell.json`
17+
- [CSpell](https://marketplace.visualstudio.com/items?itemName=streetsidesoftware.code-spell-checker): `cspell.json`
2918
has various ignored words.
3019

31-
- [ReWrap](https://github.com/stkb/Rewrap/): `.vscode/settings.json` allows toggling
20+
- [ReWrap](https://marketplace.visualstudio.com/items?itemName=stkb.rewrap): `.vscode/settings.json` allows toggling
3221
automated hard wrapping for files at 88 characters. This can also be keymapped to be
3322
performed on individual paragraphs, see documentation.
23+
24+
## With Virtual Environment
25+
26+
conda
27+
```bash
28+
conda create -n djdocs -y
29+
conda activate djdocs
30+
```
31+
venv
32+
```bash
33+
python -m venv .venv
34+
source .venv/bin/activate
35+
```
36+
37+
Then install the required packages:
38+
```bash
39+
pip install -r pip_requirements.txt
40+
```
41+
42+
Run mkdocs at: http://127.0.0.1:8000/docs/
43+
```bash
44+
# It will automatically reload the docs when changes are made
45+
mkdocs serve --config-file ./mkdocs.yaml
46+
```
47+
48+
## With Docker
49+
50+
> We mostly use Docker to simplify docs deployment
51+
52+
Ensure you have `Docker` and `Docker Compose` installed.
53+
54+
Then run the following:
55+
```bash
56+
# It will automatically reload the docs when changes are made
57+
MODE="LIVE" docker compose up --build
58+
```
59+
60+
Navigate to http://127.0.0.1:8000/docs/ to preview the changes.
61+
62+
This setup supports live-reloading so all that is needed is to save the markdown files
63+
and/or `mkdocs.yaml` file to trigger a reload.
64+
65+
## Mkdocs Warning Explanation
66+
67+
> TL;DR: We need to do it this way for hosting, please keep it as is.
68+
69+
```log
70+
WARNING - A reference to 'core/datajoint-python/' is included in the 'nav' configuration, which is not found
71+
in the documentation files.
72+
INFO - Doc file 'index.md' contains an unrecognized relative link './core/datajoint-python/', it was left
73+
as is.
74+
```
75+
76+
- We use reverse proxy to proxy our docs sites, here is the proxy flow:
77+
- You hit `datajoint.com/*` on your browser
78+
- It'll bring you to the reverse proxy server first, that you wouldn't notice
79+
- when your URL ends with:
80+
- `/` is the company page
81+
- `/docs/` is the landing/navigation page hosted by datajoint/datajoint-docs's github pages
82+
- `/docs/core/datajoint-python/` is the actual docs site hosted by datajoint/datajoint-python's github pages
83+
- `/docs/elements/element-*/` is the actual docs site hosted by each element's github pages
84+
85+
86+
```log
87+
WARNING - Doc file 'partnerships/openephysgui.md' contains a link
88+
'../../images/community-partnerships-openephysgui-logo.png', but the target
89+
'../images/community-partnerships-openephysgui-logo.png' is not found among documentation files.
90+
Did you mean '../images/community-partnerships-openephysgui-logo.png'?
91+
```
92+
- We use Github Pages to host our docs, the image references needs to follow the mkdocs's build directory structure, under `site/` directory once you run mkdocs.

docker-compose.yaml

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,22 @@
1-
# MODE="LIVE|BUILD" HOST_UID=$(id -u) docker compose up --build
2-
#
3-
# Navigate to http://localhost/
4-
version: "2.4"
1+
# MODE="LIVE|BUILD" docker compose up --build
2+
#
3+
# Navigate to http://localhost/docs/
54
services:
65
docs:
7-
build:
8-
dockerfile: .docker/Dockerfile
9-
context: .
10-
args:
11-
- GITHUB_TOKEN
126
image: datajoint/datajoint-docs
137
environment:
148
- MODE
159
volumes:
1610
- .:/main
17-
user: ${HOST_UID}:anaconda
1811
ports:
19-
- 80:80
12+
- 8000:8000
2013
command:
2114
- sh
2215
- -c
2316
- |
2417
set -e
2518
if echo "$${MODE}" | grep -i live &>/dev/null; then
26-
mkdocs serve --config-file ./mkdocs.yaml -a 0.0.0.0:80
19+
mkdocs serve --config-file ./mkdocs.yaml -a 0.0.0.0:8000
2720
elif echo "$${MODE}" | grep -i build &>/dev/null; then
2821
mkdocs build --config-file ./mkdocs.yaml
2922
else

mkdocs.yaml

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ repo_name: datajoint/datajoint-docs
66
repo_url: https://github.com/datajoint/datajoint-docs
77
nav:
88
- Welcome: index.md
9+
# relative site url, not pointing to any docs in the repo
10+
# it's for reverse proxy to proxy datajoint-python docs
911
- DataJoint Python: core/datajoint-python/
1012
- DataJoint Elements:
1113
- elements/index.md
@@ -35,6 +37,7 @@ nav:
3537
- Open Ephys GUI: partnerships/openephysgui.md
3638
- Suite2p: partnerships/suite2p.md
3739
- About:
40+
- About: about/about.md
3841
- History: about/history.md
3942
- Team: about/datajoint-team.md
4043
- Citation Guidelines: about/citation.md
@@ -69,9 +72,10 @@ theme:
6972
plugins:
7073
- search
7174
- section-index
72-
- redirects:
73-
redirect_maps:
74-
"index.md": "welcome.md"
75+
# There is no welcome.md anymore
76+
# - redirects:
77+
# redirect_maps:
78+
# "index.md": "welcome.md"
7579
- exclude:
7680
glob:
7781
- archive/*
@@ -85,8 +89,8 @@ markdown_extensions:
8589
options:
8690
custom_icons:
8791
- .overrides/.icons
88-
emoji_index: !!python/name:materialx.emoji.twemoji
89-
emoji_generator: !!python/name:materialx.emoji.to_svg
92+
emoji_index: !!python/name:material.extensions.emoji.twemoji
93+
emoji_generator: !!python/name:material.extensions.emoji.to_svg
9094
- mdx_truly_sane_lists
9195
- pymdownx.superfences:
9296
custom_fences:
@@ -103,12 +107,16 @@ markdown_extensions:
103107
custom_checkbox: true
104108
extra:
105109
generator: false # Disable watermark
106-
version:
107-
provider: mike
110+
# There is no version for this doc
111+
# version:
112+
# provider: mike
108113
social:
109114
- icon: main/company-logo
110115
link: https://www.datajoint.com
111116
name: DataJoint
117+
- icon: main/company-logo
118+
link: https://datajoint.com/docs/
119+
name: DataJoint Documentation
112120
- icon: fontawesome/brands/slack
113121
link: https://datajoint.slack.com
114122
name: Slack
@@ -131,7 +139,7 @@ extra:
131139
link: https://stackoverflow.com/questions/tagged/datajoint
132140
name: StackOverflow
133141
- icon: fontawesome/brands/youtube
134-
link: https://www.youtube.com/channel/UCdeCuFOTCXlVMRzh6Wk-lGg
142+
link: https://www.youtube.com/@datajoint
135143
name: YouTube
136144
extra_css:
137145
- assets/stylesheets/extra.css

0 commit comments

Comments
 (0)