-
Notifications
You must be signed in to change notification settings - Fork 3
Switch sphinx book theme #75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
NickleDave
merged 24 commits into
ResearchCodeReviewCommunity:main
from
NickleDave:switch-sphinx-book-theme
Aug 24, 2022
Merged
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
fad114a
Add pyproject.toml
NickleDave d8c009f
Add .readthedocs.yaml
NickleDave 89e7f08
Add noxfile.py
NickleDave d2ca7a9
Add dummy package src/dev_review
NickleDave 842a11d
Add Python + Mac OS related entries to .gitignore
NickleDave b2aeeda
Add initial output of sphinx-quickstart in doc/
NickleDave 8579e87
Add extensions + theme to doc/conf.py
NickleDave 56f4c28
Add 'sphinxcontrib-mermaid' to 'docs' in pyproject.toml
NickleDave 0f84c4d
Add 'sphinxcontrib.mermaid' to extensions in doc/conf.py
NickleDave 9037d03
Change master_doc to 'index' in docs/conf.py, gets build to work
NickleDave 980a37c
Change project name in docs/conf.py
NickleDave d617cdd
Move all of site/content/ -> docs/
NickleDave 196fa97
Delete docs/index.rst
NickleDave 6eb1319
Use myst 'mermaid' directive in docs/_index.md
NickleDave 93b2a76
Rename docs/_index.md -> docs/index.md
NickleDave 08650ef
Fix mermaid chart and links in docs/flowcharts/high-level.md
NickleDave 96dd4b2
Fix internal links in docs/recipes/find_a_reviewer.md
NickleDave 57169ae
Remove .github/workflows/deploy.yml -- no longer used
NickleDave 0dd8eb0
Rewrite README.md to use nox + sphinx
NickleDave 9805698
Add alternative method for installing pipx to README
NickleDave 9ca3a14
Add tree diagram of project to README
NickleDave 49117e0
Slight rewording in README
NickleDave 4cfc4ea
Show serving docs with nox in README
NickleDave 40badfb
Use relative references in docs/flowcharts/high-level.md
NickleDave File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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/) | ||
NickleDave marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| 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: | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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'] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
File renamed without changes.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.