Skip to content

Commit db40b9c

Browse files
authored
Merge pull request #107 from thomaspinder/sphinx_md
Refactor docs as markdown documents
2 parents 39e1c64 + b037b5e commit db40b9c

27 files changed

+378
-439
lines changed
File renamed without changes.

docs/_static/custom.css

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
@import "sphinx-book-theme.css";
2+
3+
a {
4+
color: #B5121B
5+
}
6+
7+
.content-container a {
8+
color: #B5121B
9+
}

docs/api.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
```{eval-rst}
2+
.. include:: _api.rst
3+
```
4+
5+
<!-- TODO: Convert Docstrings to MD and process autodoc directly through markdown. https://github.com/executablebooks/MyST-Parser/issues/163 -->

docs/conf.py

Lines changed: 39 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,24 @@ def find_version(*file_paths):
7676
"sphinx_copybutton",
7777
"sphinxcontrib.bibtex",
7878
"sphinxext.opengraph",
79+
"myst_parser",
80+
]
81+
82+
# MyST Config
83+
myst_enable_extensions = [
84+
"amsmath",
85+
"colon_fence",
86+
"deflist",
87+
"dollarmath",
88+
"fieldlist",
89+
"html_admonition",
90+
"html_image",
91+
"linkify",
92+
"replacements",
93+
"smartquotes",
94+
"strikethrough",
95+
"substitution",
96+
"tasklist",
7997
]
8098

8199

@@ -154,23 +172,34 @@ def find_version(*file_paths):
154172
# The theme to use for HTML and HTML Help pages. See the documentation for
155173
# a list of builtin themes.
156174
#
157-
html_theme = "furo"
175+
# html_theme = "furo"
176+
html_theme = "sphinx_book_theme"
158177
html_logo = "_static/gpjax_logo.svg"
159178
html_favicon = "_static/gpjax_logo.svg"
160-
html_title = f"v{version}"
161179
html_theme_options = {
162-
"light_css_variables": {
163-
"color-brand-primary": "#B5121B",
164-
"color-brand-content": "#CC3333",
165-
"color-admonition-background": "orange",
166-
"source_repository": "https://github.com/thomaspinder/GPJax/",
167-
"source_branch": "master",
168-
"source_directory": "docs/",
169-
},
180+
"logo_only": True,
181+
"show_toc_level": 2,
182+
"repository_url": "https://github.com/thomaspinder/GPJax/",
183+
"use_repository_button": True,
184+
"use_sidenotes": True, # Turns footnotes into sidenotes - https://sphinx-book-theme.readthedocs.io/en/stable/content-blocks.html
170185
}
186+
# html_title = f"v{version}"
187+
# html_theme_options = {
188+
# "light_css_variables": {
189+
# "color-brand-primary": "#B5121B",
190+
# "color-brand-content": "#CC3333",
191+
# "color-admonition-background": "orange",
192+
# "source_repository": "https://github.com/thomaspinder/GPJax/",
193+
# "source_branch": "master",
194+
# "source_directory": "docs/",
195+
# },
196+
# }
171197

172198

173199
# Add any paths that contain custom static files (such as style sheets) here,
174200
# relative to this directory. They are copied after the builtin static files,
175201
# so a file named "default.css" will overwrite the builtin "default.css".
176202
# html_static_path = ["_static"]
203+
204+
html_static_path = ["_static"]
205+
html_css_files = ["custom.css"]

docs/contributing.md

Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
---
2+
title: Contributing to GPJax
3+
---
4+
5+
GPJax welcomes contributions from interested individuals or groups.
6+
These guidelines help explain how you can contribute to the library
7+
8+
There are 4 main ways of contributing to the library (in descending
9+
order of difficulty or scope):
10+
11+
- Adding new or improved functionality to the existing codebase
12+
- Fixing outstanding issues (bugs) with the existing codebase. They
13+
range from low-level software bugs to higher-level design problems.
14+
- Contributing or improving the
15+
[docs](https://github.com/thomaspinder/GPJax/tree/master/docs) or
16+
[examples](https://github.com/thomaspinder/GPJax/tree/master/docs/nbs).
17+
- Submitting issues related to bugs or desired enhancements
18+
19+
# Code of conduct
20+
21+
As a contributor to GPJax, you can help us keep the community open and
22+
inclusive. Please read and follow our [Code of
23+
Conduct](https://github.com/thomaspinder/GPJax/blob/master/.github/CODE_OF_CONDUCT.md).
24+
25+
# Opening issues and getting support
26+
27+
Please open issues on [Github Issue
28+
Tracker](https://github.com/thomaspinder/GPJax/issues/new/choose).
29+
30+
You can ask a question or start a discussion in the [Discussion
31+
section](https://github.com/thomaspinder/GPJax/discussions) on Github.
32+
33+
# Contributing code via pull requests
34+
35+
Please submit patches via pull requests.
36+
37+
The preferred workflow for contributing is to fork the [GitHub
38+
repository](https://github.com/thomaspinder/GPJax), clone it to your
39+
local machine, and develop on a feature branch. Once you are ready to
40+
commit your changes, install the pre-commit hooks with
41+
`pre-commit install` and the commit and push your code as usual.
42+
43+
Steps:
44+
45+
1. Fork the [project repository](https://github.com/thomaspinder/GPJax)
46+
by clicking on the 'Fork' button near the top right of the main
47+
repository page. This creates a copy of the code under your GitHub
48+
user account.
49+
50+
2. Clone your fork of the GPJax repo from your GitHub account to your
51+
local disk, and add the base repository as a remote:
52+
53+
```bash
54+
$ git clone [email protected]:<your GitHub handle>/GPJax.git
55+
$ cd GPJax
56+
$ git remote add upstream [email protected]:GPJax.git
57+
```
58+
59+
3. Create a `feature` branch to hold your development changes:
60+
61+
```bash
62+
$ git checkout -b my-feature
63+
```
64+
65+
Always use a `feature` branch. It's good practice to never routinely
66+
work on the `master` branch of any repository.
67+
68+
4. Project requirements are in `requirements.txt`.
69+
70+
We suggest using a [virtual
71+
environment](https://docs.python-guide.org/dev/virtualenvs/) for
72+
development. Once the virtual environment is activated, run:
73+
74+
```bash
75+
$ pip install -e .
76+
$ pip install -r requirements-dev.txt
77+
```
78+
79+
5. Install the pre-commit hooks. Please **ensure you do this before
80+
commiting any files**. This can be done by executing the following:
81+
82+
```bash
83+
$ pre-commit install
84+
```
85+
86+
If successful, this will print the following output
87+
`pre-commit installed at .git/hooks/pre-commit`.
88+
89+
6. Develop the feature on your feature branch. Add changed files using
90+
`git add` and then `git commit` files:
91+
92+
```bash
93+
$ git add modified_files
94+
$ git commit
95+
```
96+
97+
to record your changes locally. After committing, it is a good idea
98+
to sync with the base repository in case there have been any
99+
changes:
100+
101+
```bash
102+
$ git fetch upstream
103+
$ git rebase upstream/main
104+
```
105+
106+
Then push the changes to your GitHub account with:
107+
108+
```bash
109+
$ git push -u origin my-feature
110+
```
111+
112+
7. Go to the GitHub web page of your fork of the GPJax repo. Click the
113+
'Pull request' button to send your changes to the project's
114+
maintainer for review.
115+
116+
# Pull request checklist
117+
118+
We recommended that your contribution complies with the following
119+
guidelines before you submit a pull request:
120+
121+
- If your pull request addresses an issue, please use the pull request
122+
title to describe the issue and mention the issue number in the pull
123+
request description. This will make sure a link back to the original
124+
issue is created.
125+
126+
- All public methods must have informative docstrings
127+
128+
- Please prefix the title of incomplete contributions with `[WIP]` (to
129+
indicate a work in progress). WIPs may be useful to (1) indicate you
130+
are working on something to avoid duplicated work, (2) request broad
131+
review of functionality or API, or (3) seek collaborators.
132+
133+
- All other tests pass when everything is rebuilt from scratch.
134+
135+
- Documentation and high-coverage tests are necessary for enhancements
136+
to be accepted.
137+
138+
- Code with good test, check with:
139+
140+
```bash
141+
$ pip install -r requirements-dev.txt
142+
$ pytest tests --cov=./ --cov-report=html
143+
```
144+
145+
This guide was derived from [PyMC's guide to
146+
contributing](https://github.com/pymc-devs/pymc/blob/main/CONTRIBUTING.md)

docs/contributing.rst

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

0 commit comments

Comments
 (0)