You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -10,9 +10,39 @@ This site uses [Sphinx](https://www.sphinx-doc.org/en/master/) as a framework an
10
10
- Docs added to this repository should be removed from their original location (e.g. Google Drive, ResFS, OneDrive, etc.) after it is committed.
11
11
- Be kind, considerate, and thoughtful.
12
12
13
+
## Setup and Installation
14
+
15
+
### Install and Configure Sphinx
16
+
17
+
Create or activate a virtual Python environment for the project:
18
+
19
+
```bash
20
+
python3 -m venv venv
21
+
source venv/bin/activate
22
+
```
23
+
24
+
Install the requirements which include Sphinx and myst-parser (for Markdown parsing):
25
+
26
+
```bash
27
+
pip install -r requirements-docs.txt
28
+
```
29
+
30
+
The `requirements-docs.txt` file contains both Sphinx and myst-parser to handle ReStructuredText and Markdown formats.
31
+
32
+
### Initial Sphinx Setup
33
+
34
+
If setting up Sphinx for the first time, create a directory to contain documentation (in our case, `sphinx`), cd to that directory, then run `sphinx-quickstart`. This will create the files `conf.py`, `index.rst`, and `make.bat`. It will also create a destination directory (the default is `_build`) for generated HTML:
35
+
36
+
```bash
37
+
cd sphinx
38
+
sphinx-quickstart
39
+
```
40
+
41
+
Edit the `conf.py` file similar to our existing [conf.py](sphinx/conf.py).
42
+
13
43
## Run Locally
14
44
15
-
To run Sphinx locally, you need to create a Python3 virtual environment, install the requirements, and run `make html`. See below:
45
+
To run Sphinx locally and build the documentation:
16
46
17
47
```bash
18
48
python3 -m venv venv
@@ -22,26 +52,72 @@ cd sphinx
22
52
make html
23
53
```
24
54
25
-
Each time you make a change, you'll need to run `make html` again from the `sphinx` directory. You should see a list of warnings in the terminal each time to indicate potential issues in the repository. See below:
55
+
Each time you make a change, you'll need to run `make html` again from the `sphinx` directory. You should see a list of warnings in the terminal each time to indicate potential issues in the repository. Run this prior to pushing to GitHub:
26
56
27
57
```bash
28
58
checking consistency... /Users/g584f396/GitHub/specify.github.io/sphinx/aws/aws_authentication.rst: WARNING: document isn't included in any toctree [toc.not_included]
29
59
```
30
60
31
-
You can access it by opening the `index.html` file in your browser (e.g.
61
+
You can access the built documentation by opening the `index.html` file in your browser (e.g.
Write all documents in ReStructuredText (.rst) or Markdown (.md) format. The requirements include both Sphinx and myst-parser to handle each format. Organize documents in logical subdirectories within the `sphinx` folder.
69
+
70
+
### Important Guidelines
71
+
72
+
- Each document must contain only one top-level title, which will be displayed in the Table of Contents
73
+
- Any number of sub-level headings may be included in each document
74
+
- Edit the `index.rst` file to include page names under the Table of Contents (toctree)
75
+
- Include paths relative to the documentation directory, and filenames without extension
76
+
- The `:maxdepth:` parameter indicates how many sublevels will be displayed in the Table of Contents
77
+
- Only if there are very few pages should `:maxdepth:` be more than 1
78
+
79
+
### Building and Testing
80
+
81
+
In the documentation directory, run the following to build pages locally and check formatting. The command will build documentation and print errors and warnings in the terminal output:
82
+
83
+
```bash
84
+
make html
85
+
```
86
+
87
+
## GitHub Pages Publishing
88
+
89
+
### Repository Setup
90
+
91
+
This repository uses GitHub Pages for automatic deployment. The site is published to https://specify.github.io/ using GitHub Actions.
92
+
93
+
### GitHub Actions Configuration
94
+
95
+
The repository uses a GitHub Action configured in `.github/workflows/build_sphinx_docs.yml` to automatically build and deploy the documentation when changes are pushed to the main branch.
96
+
97
+
### Deployment Process
98
+
99
+
1. When code is pushed to GitHub, the GitHub Action runs automatically
100
+
2. Sphinx builds the documentation
101
+
3. The built site is deployed to the `gh-pages` branch
102
+
4. GitHub Pages serves the content from this branch
103
+
5. The site is available at https://specify.github.io/ within minutes
104
+
105
+
34
106
## Contribute
35
107
36
108
Contribution for this repository is limited only to SCC staff.
37
109
38
-
1. Clone the repository
110
+
### Step-by-Step Contribution Process
111
+
112
+
1. **Clone the repository**
39
113
40
114
```bash
41
115
gh repo clone specify/specify.github.io
42
116
```
43
117
44
-
2. Create a new `.md` or `.rst` file under the appropriate directory (e.g. `server_management`, `testing`, `security`, etc.) or create a new directory to begin a new category.
118
+
2. **Create a new document**
119
+
120
+
Create a new `.md` or `.rst` file under the appropriate directory (e.g. `server_management`, `testing`, `security`, etc.) or create a new directory to begin a new category.
45
121
46
122
```bash
47
123
├── LICENSE
@@ -66,7 +142,7 @@ Contribution for this repository is limited only to SCC staff.
66
142
└── testing
67
143
```
68
144
69
-
For example, I may want to add `reports.md` to the repository under `server_management`, so I would add this below like so:
145
+
For example, to add `reports.md` to the repository under `server_management`:
70
146
71
147
```bash
72
148
└── sphinx
@@ -75,23 +151,42 @@ Contribution for this repository is limited only to SCC staff.
75
151
└── reports.md
76
152
```
77
153
78
-
3. Preview, proofread, and double-check your document for accuracy. Once saved, the file will be available at this URL (after the base domain)
79
-
80
-
```
81
-
/server_management/reports.html
82
-
```
83
-
84
-
4. You can add this to the sidebar and homepage by adding it to the `index.rst` file in the `./sphinx/` directory under the appropriate category. You just need to add the path to your file within that directory minus the file extension (no `.md` or `.rst`).
154
+
3. **Add to Table of Contents**
155
+
156
+
Add your document to the sidebar and homepage by editing the `index.rst` file in the `./sphinx/` directory under the appropriate category. Add the path to your file within that directory minus the file extension (no `.md` or `.rst`).
85
157
86
158
If the category you want does not yet exist, you can add a new one in the same format and structure as the others.
87
159
88
160
```rst
89
161
.. toctree::
90
-
:maxdepth: 1
91
-
:caption: Server Management:
162
+
:maxdepth: 1
163
+
:caption: Server Management:
164
+
165
+
server_management/check_asset_usage
166
+
server_management/reports
167
+
```
168
+
169
+
4. **Preview and test locally**
170
+
171
+
Before committing, preview, proofread, and double-check your document for accuracy:
172
+
173
+
```bash
174
+
cd sphinx
175
+
make html
176
+
```
177
+
178
+
Once saved, the file will be available at this URL pattern (after the base domain):
92
179
93
-
server_management/check_asset_usage
94
-
server_management/reports
95
180
```
181
+
/server_management/reports.html
182
+
```
183
+
184
+
5. **Commit and deploy**
185
+
186
+
Save and commit to the `main` branch of this repository on GitHub. GitHub will automatically update the pages site (https://specify.github.io/) within minutes and the document will be available publicly.
187
+
188
+
### Content Guidelines
96
189
97
-
5. Save and commit to the `main` branch of this repository on GitHub. GitHub will automatically update the pages site (https://specify.github.io/) within minutes and the document will be available publicly.
190
+
- Ensure your documentation follows the contribution guidelines at the top of this README
191
+
- Remove documents from their original location (Google Drive, ResFS, OneDrive, etc.) after committing to this repository
192
+
- Test your changes locally before pushing to ensure proper formatting and no build errors
0 commit comments