Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
fad114a
Add pyproject.toml
NickleDave Apr 4, 2022
d8c009f
Add .readthedocs.yaml
NickleDave Apr 4, 2022
89e7f08
Add noxfile.py
NickleDave Apr 4, 2022
d2ca7a9
Add dummy package src/dev_review
NickleDave Apr 4, 2022
842a11d
Add Python + Mac OS related entries to .gitignore
NickleDave Apr 4, 2022
b2aeeda
Add initial output of sphinx-quickstart in doc/
NickleDave Apr 4, 2022
8579e87
Add extensions + theme to doc/conf.py
NickleDave Apr 4, 2022
56f4c28
Add 'sphinxcontrib-mermaid' to 'docs' in pyproject.toml
NickleDave Apr 4, 2022
0f84c4d
Add 'sphinxcontrib.mermaid' to extensions in doc/conf.py
NickleDave Apr 4, 2022
9037d03
Change master_doc to 'index' in docs/conf.py, gets build to work
NickleDave Apr 4, 2022
980a37c
Change project name in docs/conf.py
NickleDave Apr 4, 2022
d617cdd
Move all of site/content/ -> docs/
NickleDave Jun 5, 2022
196fa97
Delete docs/index.rst
NickleDave Apr 4, 2022
6eb1319
Use myst 'mermaid' directive in docs/_index.md
NickleDave Apr 4, 2022
93b2a76
Rename docs/_index.md -> docs/index.md
NickleDave Apr 4, 2022
08650ef
Fix mermaid chart and links in docs/flowcharts/high-level.md
NickleDave Apr 4, 2022
96dd4b2
Fix internal links in docs/recipes/find_a_reviewer.md
NickleDave Apr 4, 2022
57169ae
Remove .github/workflows/deploy.yml -- no longer used
NickleDave Jun 5, 2022
0dd8eb0
Rewrite README.md to use nox + sphinx
NickleDave Jun 5, 2022
9805698
Add alternative method for installing pipx to README
NickleDave Jul 29, 2022
9ca3a14
Add tree diagram of project to README
NickleDave Jul 29, 2022
49117e0
Slight rewording in README
NickleDave Jul 29, 2022
4cfc4ea
Show serving docs with nox in README
NickleDave Jul 29, 2022
40badfb
Use relative references in docs/flowcharts/high-level.md
NickleDave Jul 29, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 0 additions & 39 deletions .github/workflows/deploy.yml

This file was deleted.

11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,14 @@ site/resources/_gen/*
.idea
## vscode
.vscode

# Python
*__pycache__*
*egg-info/
dist/
build/
.venv
docs/_build

# Mac
.DS_Store
20 changes: 20 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# .readthedocs.yaml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

version: 2

build:
os: ubuntu-20.04
tools:
python: "3.8"

sphinx:
configuration: docs/conf.py

python:
install:
- method: pip
path: .
extra_requirements:
- docs
84 changes: 47 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,64 +1,74 @@
# Code Review During Development

This repository is automatically built from [markdown](https://commonmark.org/) files by [Hugo](https://gohugo.io/) using [GitHub Actions](https://github.com/features/actions).
This site uses the Hugo [LoveIt](https://hugoloveit.com/) theme.
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)
using [ReadTheDocs](https://readthedocs.org/).
This site uses the [Sphinx Book](https://sphinx-book-theme.readthedocs.io) theme.
This site is available here: https://researchcodereviewcommunity.github.io/dev-review/

The following branches in this repository are important:
- `main`: the markdown files corresponding to the current live version of the website
- `gh-pages`: the static html site, automatically built by Hugo on new commits to `main` by [this script](.github/workflows/deploy.yml)
The content of the website is contained in markdown files located in the `docs/` folder and are structured like so

~~~text
docs/
├── flowcharts <-- any mermaid flowcharts used in multiple locations
│   └── high-level.md
├── glossary.md <-- a glossary of important terms for code review
├── guidelines <-- more general guidelines for code review apart from the more prescriptive recipes
│   ├── approach.md
│   └── points-to-check-for-reviewers.md
├── index.md <-- the landing page of the website
├── recipes <-- our suggested steps to follow during the code review process
│   ├── explain_code_structure.md
│   ├── find_a_reviewer.md
│   ├── lonecoder.md
│   ├── meet_and_agree_on_objectives.md
│   ├── perform_code_review.md
│   └── recipe_template.md
└── refs-related.md <-- references for material related to code review
~~~

## Dependencies
Install hugo extended dependency.
The "extended" hugo version is required to enable some features of [the LoveIt theme](https://hugoloveit.com/), such as mermaid diagrams.
See commands to install hugo based on your Operating system.
- macOS
We use [`nox`](https://nox.thea.codes/en/stable/)
as a task-runner to create development environments
and to build the docs.
There are many ways to install but we recommend the following:
1. use a system package manager to install `pipx`
2. use `pipx` to install `nox` so you can use it across projects
3. finally ask `nox` to create a development environment

- macOS/Linux
```
brew install hugo
brew install pipx # or `python3 -m pip install --user pipx`
pipx install nox
nox -s dev
```
- Windows
```
choco install hugo -confirm
```
- GNU/Linux (Debian and Ubuntu)
choco install pipx -confirm
pipx install nox
nox -s dev
```
snap install hugo --channel=extended
```

See [documentation](https://gohugo.io/getting-started/installing/) for other options and furhter instructions.

## Clone this repository
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).
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).
You can then clone the repository by typing (or copying) the following line in a terminal at your preferred path in your machine:
```
git clone --recurse-submodules git@github.com:ResearchCodeReviewCommunity/dev-review.git
git clone git@github.com:ResearchCodeReviewCommunity/dev-review.git
```
If you've cloned this repo without the `--recurse-submodules` options, then you can initialise your local git submodule config with

```
git submodule init
```
and update it with
```
git submodule update
```
## Development
To preview changes, you can build and serve the website locally.

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

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

## Contributing
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).
Once your changes are merged into `main` branch, the site will be automatically built and deployed and will be live roughly 1 minute later.
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).
Once your changes are merged into `main` branch, the site will be automatically built and deployed and will be live roughly 1 minute later.

:warning: **Do not commit directly to `main` or `gh-pages`.** :warning:
:warning: **Do not commit directly to `main`.** :warning:
20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = _build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
72 changes: 72 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Path setup --------------------------------------------------------------

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
# import os
# import sys
# sys.path.insert(0, os.path.abspath('.'))


# -- Project information -----------------------------------------------------

project = 'Code Review During Research'
copyright = '2022, Research Code Review Community'
author = 'Research Code Review Community'

# The full version, including alpha/beta/rc tags
release = '0.1.0'


# -- General configuration ---------------------------------------------------

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'myst_parser',
'sphinxcontrib.mermaid',
'sphinx.ext.autodoc',
'sphinx.ext.coverage',
'sphinx_copybutton',
'sphinx.ext.doctest',
'sphinx.ext.intersphinx',
'sphinx.ext.todo',
'sphinx.ext.mathjax',
'sphinx.ext.napoleon',
'sphinxext.opengraph',
'sphinx.ext.ifconfig',
'sphinx.ext.viewcode',
]

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

source_suffix = ['.rst', '.md']

master_doc = 'index'

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']


# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'sphinx_book_theme'

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Here's a high-level view of a workflow researchers can follow to make code
review part of their development process.

{{< mermaid >}}
```{mermaid}
%% codereview mermaid
graph TD;
Link(Click on orange boxes for more detail)
Expand All @@ -17,15 +17,15 @@ graph TD;
H -- Yes --> D
H -- No --> I([Finish])

click B "./#find-a-reviewer" "Find a reviewer"
click C "./#meet-and-agree-on-objectives" "Meet and agree on objectives"
click D,E,F,G "./#perform-code-review" "Perform Code Review"
click I "./#finish" "Finish"
click B "#find-a-reviewer" "Find a reviewer"
click C "#meet-and-agree-on-objectives" "Meet and agree on objectives"
click D,E,F,G "#perform-code-review" "Perform Code Review"
click I "#finish" "Finish"

classDef default fill:#8EB6DE,stroke:#162D4D,stroke-width:2px,color:#162D4D;
classDef linkedBox fill:#FABB00,stroke:#000,stroke-width:2px,color:#000;
class Link,B,C,D,E,F,G,I linkedBox
{{< /mermaid >}}
```

### Find a reviewer

Expand Down
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions site/content/_index.md → docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ accessible by researchers at all levels, from research students to
senior professors, whether they are new to programming or software
engineering experts.**

{{< mermaid >}}
```{mermaid}
graph TD;
A(Initial reviewer-author meeting) --> B(Reviewer examines code)
B --> C(Reviewer compiles suggestions)
C --> D(Author and reviewer go over code)
D --> E(Author improves code)
E --> B
{{< /mermaid >}}
```

## Getting Started
Please see [this page](flowcharts/high-level)
Expand Down
35 changes: 35 additions & 0 deletions docs/make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=.
set BUILDDIR=_build

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.https://www.sphinx-doc.org/
exit /b 1
)

if "%1" == "" goto help

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%

:end
popd
Loading