Skip to content

Commit 8057dcd

Browse files
committed
Cleaning file structure
Adding to conf.py for the API documentation, deleted unneeded files, updated the README, and added to conf.py for notebook to html conversions.
1 parent 76599c3 commit 8057dcd

36 files changed

+82
-15704
lines changed

docs/README.md

Lines changed: 38 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11

2-
# Locally Rendering Sphinx
2+
# Documentation Site Using Sphinx
33

44
Guide to rendering the documentation site using Sphinx.
55

66
This document includes:
7-
- The coderdata/docs directory structure
8-
- Sphinx commands
9-
- Guide to updating the documentation site
10-
- Helpful sphinx features
7+
- [The Sphinx local directory structure](#local-directory-structure)
8+
- [Sphinx commands](#sphinx-commands)
9+
- [Guide to updating the documentation site](#updating-the-documentation-site)
10+
- [Helpful sphinx features](#helpful-sphinx-features)
11+
- [Site Deployment](#deploying-the-documentation-site-using-github-actions)
1112

1213

13-
## Directory Structure
14+
## Local Directory Structure
1415

15-
![Directory Structure](sphinx_dir_struct.png?raw=true)
16+
![Directory Structure](local_struct.jpg?raw=true)
1617

1718
## Sphinx Commands
1819

@@ -28,7 +29,7 @@ Included in `coderdata/docs/requirements.txt`. Extra installations that enable v
2829

2930
### Build
3031

31-
To build the Sphinx documentation locally, navigate to the `docs` directory and run the `sphinx-build` command. This command processes the content files from the `source` directory and generates the rendered HTML output in the `build` directory.
32+
To build the Sphinx documentation locally, navigate to the `docs/` directory and run the `sphinx-build` command. This command processes the content files from the `docs/source/` directory and generates the rendered HTML output in the `docs/build/` directory.
3233

3334
```sh
3435
$ cd ../coderdata/docs
@@ -49,43 +50,43 @@ $ python -m sphinx.cmd.quickstart
4950
```
5051
Questions will follow this command and when it prompts if you'd like to separate the source and build directories select yes.
5152

52-
## Updating Documentation Site
53+
## Updating the Documentation Site
5354

54-
The `conf.py` file is the central configuration file for Sphinx and it determines the behavior and appearance of the generated documentation. Specifically it configures extensions, defines metadata, controls output settings, and customizes sphinx behavior. The `index.rst` file is the starting page for the Sphinx documentation build process. It acts as the root file, linking all other pages and defining the document hierarchy. All other .md and .rst files are added and internally referenced within the index page or within the sidebar.
55+
The `conf.py` file is the central configuration file for Sphinx and it determines the behavior and appearance of the generated documentation. Specifically it configures extensions, defines metadata, controls output settings, and customizes sphinx behavior. The `index.rst` file is the starting page for the Sphinx documentation build process. It acts as the root file, linking all other pages and defining the document hierarchy. All other .md and .rst files are added and internally referenced within the index page and/or within the sidebar.
5556

5657
### Pages
5758

58-
To update pages navigate to `docs/source`, all .rst and .md files live here. Here a reference of the main pages used for the documentation site.
59+
To update pages navigate to `docs/source/`, all .rst and .md files live here. Here a reference of the main pages used for the documentation site.
5960

60-
| Main Pages | File Name | Content |
61+
| Page | File Name | Content |
6162
| -----------------| ----------------------------------------------------------------------- | ------------------------------ |
6263
| Home Page | index.rst | Introduction and Install |
6364
| Usage | usage.md | API and CLI |
6465
| API Reference | APIreference.rst | Sphinx autogenerated docstrings|
65-
| Datasets Included| datasets_included.rst | Datasets overview table |
66-
| Tutorials | tutorials.rst | Deep Learning Tutorial |
67-
| How To Contribute| contribution_guide.rst *includes contribution.md and add_code_guide.md* | Contribution Guide |
66+
| Datasets | datasets_included.rst | Datasets overview table |
67+
| Tutorial | tutorials.rst | Deep Learning Tutorial |
68+
| Contributing | contribution_guide.rst *includes contribution.md and add_code_guide.md* | Contribution Guide |
6869

69-
Note: When adding pages, reStructuredText files are the most sphinx friendly and allow for use of helpful sphinx features. However, Markdown files can be used and will render properly when the myst-parser extension is used.
70+
**Note:** When adding pages, reStructuredText files are the most sphinx friendly and allow for use of helpful directives. However, Markdown files can be used and will render properly when the myst-parser extension is used.
7071

7172
### Images and Graphics
7273

73-
To add any new images they will live in `docs/source/_static`. The coderdata_header.png and home_page_graphic.png were made using [canva](https://www.canva.com/). The designs are shared with team members so that they can easily be edited if needed!
74+
To add any new images they will live in `docs/source/_static/`. The coderdata_header.png was made using [canva](https://www.canva.com/) and coderdata_1 was made using biorender.
7475

7576
### Site Theme and Design
7677

77-
The original sphinx theme used is 'sphinxdoc', however, to change certain aspects an additional file custom.css was included to override the sphinxdoc theme. To update the custom theme navigate to `docs/source/_static/custom.css`. Changes to the sidebar can be made in `docs/source/_templates/my_custom_sidebar.html`. Any other custom templates will be added to `docs/source/_templates`.
78+
The original sphinx theme used is 'sphinxdoc', however, to change certain aspects I created `custom.css` to override the sphinxdoc theme. To update the custom theme navigate to `docs/source/_static/custom.css`. Changes to the sidebar can be made in `docs/source/_templates/my_custom_sidebar.html`. Any other custom templates will be added to `docs/source/_templates/`.
7879

79-
Note: The sphinxdoc theme is automatically generated during the build command into `docs/build/html/_static/sphinxdoc.css`. It is regenerated everytime sphinx build runs so changes to the theme must be made in custom.css.
80+
**Note:** The sphinxdoc theme is auto-generated during the build command into `docs/build/html/_static/sphinxdoc.css`. It is regenerated everytime sphinx build runs so changes must be made in custom.css.
8081

8182

8283
## Helpful Sphinx Features
8384

8485
### Site Links
8586

86-
- [Sphinx Documentation](https://www.sphinx-doc.org/en/master/index.html)
87-
- [Sphinxdoc Sample](https://sphinx-themes.org/sample-sites/default-sphinxdoc/)
88-
- [Full List of Directives in Sphinx](https://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html#rst-directives)
87+
- [sphinx-doc.org](https://www.sphinx-doc.org/en/master/index.html)
88+
- [sphinx.org/sample-sites](https://sphinx-themes.org/sample-sites/default-sphinxdoc/)
89+
- [sphinx.org/directives](https://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html#rst-directives)
8990

9091

9192
### Directives and Examples Used in CoderData Documentation
@@ -115,4 +116,19 @@ To include content from another file. Example shows how to render a markdown fil
115116
:align: center
116117
:scale: 100%
117118
```
119+
## Deploying the Documentation Site Using Github Actions
118120

121+
### Directory Structure for Deployment with Relevant Branches
122+
123+
![Directory Structure](deploy_struct.jpg?raw=true)
124+
125+
### Site Deployment
126+
127+
- We added `sphinx.yml` to the `.github/workflows/` directory in the `documentation-staging` branch.
128+
129+
- Then in `documentation-staging` we included all the source directory files that are needed to build the documentation. (These are all the same files that are needed to build the documentation locally, the only addition is `requirements.txt`).
130+
**Note:** If you have been building the documentation locally and then are moving to commit to the staging branch there is no need to include any files from `docs/build/` directory.
131+
132+
- Once a push is made from `documentation-staging` the workflow is triggered.
133+
134+
- The built html files are then deployed to the root of the `gh-pages` branch. The included files in the branch are shown in the graphic above.

docs/_images/coderDataBuild.jpg

-59 KB
Binary file not shown.

docs/_images/coderdata_1.jpg

-424 KB
Binary file not shown.

docs/_images/coderdata_header3.jpg

-95.5 KB
Binary file not shown.

docs/_images/home_page_graphic3.jpg

-36.9 KB
Binary file not shown.

0 commit comments

Comments
 (0)