Skip to content

Commit 2a89671

Browse files
authored
MRG: #75 from NickleDave/switch-sphinx-book-theme
Switch sphinx book theme
2 parents 3f8b3f7 + 40badfb commit 2a89671

23 files changed

+351
-91
lines changed

.github/workflows/deploy.yml

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

.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,14 @@ site/resources/_gen/*
3030
.idea
3131
## vscode
3232
.vscode
33+
34+
# Python
35+
*__pycache__*
36+
*egg-info/
37+
dist/
38+
build/
39+
.venv
40+
docs/_build
41+
42+
# Mac
43+
.DS_Store

.readthedocs.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# .readthedocs.yaml
2+
# Read the Docs configuration file
3+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
4+
5+
version: 2
6+
7+
build:
8+
os: ubuntu-20.04
9+
tools:
10+
python: "3.8"
11+
12+
sphinx:
13+
configuration: docs/conf.py
14+
15+
python:
16+
install:
17+
- method: pip
18+
path: .
19+
extra_requirements:
20+
- docs

README.md

Lines changed: 47 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,74 @@
11
# Code Review During Development
22

3-
This repository is automatically built from [markdown](https://commonmark.org/) files by [Hugo](https://gohugo.io/) using [GitHub Actions](https://github.com/features/actions).
4-
This site uses the Hugo [LoveIt](https://hugoloveit.com/) theme.
3+
This repository is automatically built from [markdown](https://commonmark.org/) files by [Sphinx](https://www.sphinx-doc.org/) and the [MyST parser](https://myst-parser.readthedocs.io)
4+
using [ReadTheDocs](https://readthedocs.org/).
5+
This site uses the [Sphinx Book](https://sphinx-book-theme.readthedocs.io) theme.
56
This site is available here: https://researchcodereviewcommunity.github.io/dev-review/
67

7-
The following branches in this repository are important:
8-
- `main`: the markdown files corresponding to the current live version of the website
9-
- `gh-pages`: the static html site, automatically built by Hugo on new commits to `main` by [this script](.github/workflows/deploy.yml)
8+
The content of the website is contained in markdown files located in the `docs/` folder and are structured like so
9+
10+
~~~text
11+
docs/
12+
├── flowcharts <-- any mermaid flowcharts used in multiple locations
13+
│   └── high-level.md
14+
├── glossary.md <-- a glossary of important terms for code review
15+
├── guidelines <-- more general guidelines for code review apart from the more prescriptive recipes
16+
│   ├── approach.md
17+
│   └── points-to-check-for-reviewers.md
18+
├── index.md <-- the landing page of the website
19+
├── recipes <-- our suggested steps to follow during the code review process
20+
│   ├── explain_code_structure.md
21+
│   ├── find_a_reviewer.md
22+
│   ├── lonecoder.md
23+
│   ├── meet_and_agree_on_objectives.md
24+
│   ├── perform_code_review.md
25+
│   └── recipe_template.md
26+
└── refs-related.md <-- references for material related to code review
27+
~~~
1028

1129
## Dependencies
12-
Install hugo extended dependency.
13-
The "extended" hugo version is required to enable some features of [the LoveIt theme](https://hugoloveit.com/), such as mermaid diagrams.
14-
See commands to install hugo based on your Operating system.
15-
- macOS
30+
We use [`nox`](https://nox.thea.codes/en/stable/)
31+
as a task-runner to create development environments
32+
and to build the docs.
33+
There are many ways to install but we recommend the following:
34+
1. use a system package manager to install `pipx`
35+
2. use `pipx` to install `nox` so you can use it across projects
36+
3. finally ask `nox` to create a development environment
37+
38+
- macOS/Linux
1639
```
17-
brew install hugo
40+
brew install pipx # or `python3 -m pip install --user pipx`
41+
pipx install nox
42+
nox -s dev
1843
```
1944
- Windows
2045
```
21-
choco install hugo -confirm
22-
```
23-
- GNU/Linux (Debian and Ubuntu)
46+
choco install pipx -confirm
47+
pipx install nox
48+
nox -s dev
2449
```
25-
snap install hugo --channel=extended
26-
```
27-
28-
See [documentation](https://gohugo.io/getting-started/installing/) for other options and furhter instructions.
2950

3051
## Clone this repository
31-
After generating your SSH keys as suggested [here](https://docs.github.com/en/github/authenticating-to-github/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent).
52+
After generating your SSH keys as suggested [here](https://docs.github.com/en/github/authenticating-to-github/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent).
3253
You can then clone the repository by typing (or copying) the following line in a terminal at your preferred path in your machine:
3354
```
34-
git clone --recurse-submodules [email protected]:ResearchCodeReviewCommunity/dev-review.git
55+
git clone [email protected]:ResearchCodeReviewCommunity/dev-review.git
3556
```
36-
If you've cloned this repo without the `--recurse-submodules` options, then you can initialise your local git submodule config with
3757

38-
```
39-
git submodule init
40-
```
41-
and update it with
42-
```
43-
git submodule update
44-
```
58+
## Development
59+
To preview changes, you can build and serve the website locally.
4560

46-
## Development
47-
To preview changes locally, you can build and serve the website locally.
48-
The `disableFastRender` option is required to render some features brought by the LoveIt theme, such as mermaid diagrams.
4961
```
50-
cd site/ && hugo serve --disableFastRender
62+
nox -s docs -- serve
5163
```
5264

5365
Open your favorite web-browser using the following url:
5466
```
55-
Web Server is available at http://localhost:1313/dev-review/ (bind address 127.0.0.1)
56-
Press Ctrl+C to stop
67+
Serving HTTP on 0.0.0.0 port 8000 (http://0.0.0.0:8000/) ...
5768
```
58-
See [Launching the website locally (hugoloveit.com)](https://hugoloveit.com/theme-documentation-basics/#25-launching-the-website-locally) for further information.
5969

6070
## Contributing
61-
Commit changes to any other branch than `main` or `gh-pages`, open a pull request and request for reviews as common practice following the [pull request workflow with git](https://medium.com/@urna.hybesis/pull-request-workflow-with-git-6-steps-guide-3858e30b5fa4).
62-
Once your changes are merged into `main` branch, the site will be automatically built and deployed and will be live roughly 1 minute later.
71+
Commit changes to any other branch than `main`, open a pull request and request for reviews as common practice following the [pull request workflow with git](https://medium.com/@urna.hybesis/pull-request-workflow-with-git-6-steps-guide-3858e30b5fa4).
72+
Once your changes are merged into `main` branch, the site will be automatically built and deployed and will be live roughly 1 minute later.
6373

64-
:warning: **Do not commit directly to `main` or `gh-pages`.** :warning:
74+
:warning: **Do not commit directly to `main`.** :warning:

docs/Makefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line, and also
5+
# from the environment for the first two.
6+
SPHINXOPTS ?=
7+
SPHINXBUILD ?= sphinx-build
8+
SOURCEDIR = .
9+
BUILDDIR = _build
10+
11+
# Put it first so that "make" without argument is like "make help".
12+
help:
13+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14+
15+
.PHONY: help Makefile
16+
17+
# Catch-all target: route all unknown targets to Sphinx using the new
18+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19+
%: Makefile
20+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

docs/conf.py

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# Configuration file for the Sphinx documentation builder.
2+
#
3+
# This file only contains a selection of the most common options. For a full
4+
# list see the documentation:
5+
# https://www.sphinx-doc.org/en/master/usage/configuration.html
6+
7+
# -- Path setup --------------------------------------------------------------
8+
9+
# If extensions (or modules to document with autodoc) are in another directory,
10+
# add these directories to sys.path here. If the directory is relative to the
11+
# documentation root, use os.path.abspath to make it absolute, like shown here.
12+
#
13+
# import os
14+
# import sys
15+
# sys.path.insert(0, os.path.abspath('.'))
16+
17+
18+
# -- Project information -----------------------------------------------------
19+
20+
project = 'Code Review During Research'
21+
copyright = '2022, Research Code Review Community'
22+
author = 'Research Code Review Community'
23+
24+
# The full version, including alpha/beta/rc tags
25+
release = '0.1.0'
26+
27+
28+
# -- General configuration ---------------------------------------------------
29+
30+
# Add any Sphinx extension module names here, as strings. They can be
31+
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
32+
# ones.
33+
extensions = [
34+
'myst_parser',
35+
'sphinxcontrib.mermaid',
36+
'sphinx.ext.autodoc',
37+
'sphinx.ext.coverage',
38+
'sphinx_copybutton',
39+
'sphinx.ext.doctest',
40+
'sphinx.ext.intersphinx',
41+
'sphinx.ext.todo',
42+
'sphinx.ext.mathjax',
43+
'sphinx.ext.napoleon',
44+
'sphinxext.opengraph',
45+
'sphinx.ext.ifconfig',
46+
'sphinx.ext.viewcode',
47+
]
48+
49+
# Add any paths that contain templates here, relative to this directory.
50+
templates_path = ['_templates']
51+
52+
source_suffix = ['.rst', '.md']
53+
54+
master_doc = 'index'
55+
56+
# List of patterns, relative to source directory, that match files and
57+
# directories to ignore when looking for source files.
58+
# This pattern also affects html_static_path and html_extra_path.
59+
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
60+
61+
62+
# -- Options for HTML output -------------------------------------------------
63+
64+
# The theme to use for HTML and HTML Help pages. See the documentation for
65+
# a list of builtin themes.
66+
#
67+
html_theme = 'sphinx_book_theme'
68+
69+
# Add any paths that contain custom static files (such as style sheets) here,
70+
# relative to this directory. They are copied after the builtin static files,
71+
# so a file named "default.css" will overwrite the builtin "default.css".
72+
html_static_path = ['_static']

site/content/flowcharts/high-level.md renamed to docs/flowcharts/high-level.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Here's a high-level view of a workflow researchers can follow to make code
44
review part of their development process.
55

6-
{{< mermaid >}}
6+
```{mermaid}
77
%% codereview mermaid
88
graph TD;
99
Link(Click on orange boxes for more detail)
@@ -17,15 +17,15 @@ graph TD;
1717
H -- Yes --> D
1818
H -- No --> I([Finish])
1919
20-
click B "./#find-a-reviewer" "Find a reviewer"
21-
click C "./#meet-and-agree-on-objectives" "Meet and agree on objectives"
22-
click D,E,F,G "./#perform-code-review" "Perform Code Review"
23-
click I "./#finish" "Finish"
20+
click B "#find-a-reviewer" "Find a reviewer"
21+
click C "#meet-and-agree-on-objectives" "Meet and agree on objectives"
22+
click D,E,F,G "#perform-code-review" "Perform Code Review"
23+
click I "#finish" "Finish"
2424
2525
classDef default fill:#8EB6DE,stroke:#162D4D,stroke-width:2px,color:#162D4D;
2626
classDef linkedBox fill:#FABB00,stroke:#000,stroke-width:2px,color:#000;
2727
class Link,B,C,D,E,F,G,I linkedBox
28-
{{< /mermaid >}}
28+
```
2929

3030
### Find a reviewer
3131

File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)