Skip to content

Commit 9f97367

Browse files
authored
Reorder book (#31)
* Split book into multiple files. Decouple from readme Add notebook as dependency with binder Add shell structure for new sections * Add files
1 parent a7b6619 commit 9f97367

File tree

9 files changed

+79
-57
lines changed

9 files changed

+79
-57
lines changed

Makefile

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,8 @@
1-
# We want to use the README.md and contributing.md file from this folder
2-
# in the Jupter book. These files should be listed in `docs/_toc.yml`
3-
DOCS = README.md CONTRIBUTING.md
4-
51
# List of Python demos (without file extenion) from the repo `demo` to include in the jupyterbook.
62
# These files should be listed in `docs/_toc.yml`
73
DEMOS = demo
84

95
doc: # Generate Sphinx HTML documentation, including API docs
10-
@for file in ${DOCS}; do \
11-
cp $$file docs/. ;\
12-
done
136
# We use --set-kernel with jupytext to make it possible for binder to pick it up
147
@for demo in ${DEMOS}; do \
158
jupytext --to=ipynb --set-kernel=python3 demo/$$demo.py --output=docs/$$demo.ipynb ;\

README.md

Lines changed: 1 addition & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -2,52 +2,7 @@
22

33
This repository is a template for how to set up a reproducible python environment with GitHub.
44

5-
## Badges
6-
75
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/jorgensd/reproducibility/gh-pages?labpath=_sources)
8-
9-
To get the `Launch Binder` badge, go to: [https://mybinder.org/](https://mybinder.org/) and fill in (specifics for this repo in brackets):
10-
- Your Github repository (https://github.com/jorgensd/reproducibility)
11-
- Git ref (`gh-pages`, see: [How to create github pages](#ghpages))
12-
- Path to notebook file (`_sources`, as generated by `jupyter-book`, see [Jupyter-book](#jupyterbook))
13-
14-
Then press `Launch`, and then `Expand to see the text below, paste it into your README to show a binder badge` and copy the markdown code. If you render the README.md file as plaintext, you can see all the settings explicitly in the image link
15-
166
[![Jupyter Book Badge](https://jupyterbook.org/badge.svg)](https://jorgensd.github.io/reproducibility)
7+
[![MIT License](https://img.shields.io/github/license/jorgensd/reproducibility)](LICENSE)
178

18-
Replace link in image (https://jorgensd.github.io/reproducibility) with your [Github pages url](#ghpages)
19-
20-
![MIT License](https://img.shields.io/github/license/jorgensd/reproducibility)
21-
22-
Replace `username/repo` in image link with appropriate user/respository.
23-
24-
## Python-packaging
25-
26-
To be able to create a python package, we need a folder with the name of the package (in this repository it is called `mypackage`, located under `src/mypackage`), and a `pyproject.toml` file.
27-
28-
29-
## Make a repository citable
30-
The easiest way to make your repository citable is to add a `CITATION.cff` file to the repository, as it is supported by both
31-
[Zenodo's](https://zenodo.org/) and it's [Github integration](https://docs.github.com/en/repositories/archiving-a-github-repository/referencing-and-citing-content) and [Github](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-citation-files) itself.
32-
33-
## Adding an issue template
34-
See [Adding an issue template](https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/configuring-issue-templates-for-your-repository) for more information.
35-
36-
## Contributing
37-
38-
Contributions are always welcome!
39-
40-
See [CONTRIBUTING.md](CONTRIBUTING.md) for ways to get started.
41-
42-
A good idea is to look at the [issue tracker](https://github.com/jorgensd/reproducibility/issues) and see if you can resolve any open issues. A list of good first issues can be found [here](https://github.com/jorgensd/reproducibility/contribute)
43-
44-
If you find a bug in the source code, please [open an issue](https://github.com/jorgensd/reproducibility/issues/new).
45-
46-
47-
## <a id="ghpages"></a> Auto-publish to Github Pages
48-
49-
Add text
50-
51-
## <a id="jupyterbook"></a> Jupyter-book
52-
53-
Add text

docs/_toc.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
format: jb-book
2-
root: README
2+
root: index
33

44
chapters:
5+
- file: "badges"
6+
- file: "packaging"
7+
- file: "github"
8+
- file: "publishing"
9+
# This file does not exist in the Github repository
10+
# It should be copied here by adding it in the `Makefile`
511
- file: "demo"
612
- file: "api"
7-
- file: "CONTRIBUTING"

docs/badges.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Badges
2+
3+
## Binder
4+
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/jorgensd/reproducibility/gh-pages?labpath=_sources)
5+
6+
To get the `Launch Binder` badge, go to: [https://mybinder.org/](https://mybinder.org/) and fill in (specifics for this repo in brackets):
7+
- Your Github repository (https://github.com/jorgensd/reproducibility)
8+
- Git ref (`gh-pages`, see: [How to create github pages](#ghpages))
9+
- Path to notebook file (`_sources`, as generated by `jupyter-book`, see [Jupyter-book](#jupyterbook))
10+
11+
Then press `Launch`, and then `Expand to see the text below, paste it into your README to show a binder badge` and copy the markdown code. If you render the README.md file as plaintext, you can see all the settings explicitly in the image link
12+
13+
## Jupyter book
14+
[![Jupyter Book Badge](https://jupyterbook.org/badge.svg)](https://jorgensd.github.io/reproducibility)
15+
16+
Replace link in image (https://jorgensd.github.io/reproducibility) with your [Github pages url](#ghpages)
17+
18+
## Licence
19+
![MIT License](https://img.shields.io/github/license/jorgensd/reproducibility)
20+
21+
Replace `username/repo` in image link with appropriate user/respository.

docs/github.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Github tools
2+
3+
## Issue template
4+
See [Adding an issue template](https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/configuring-issue-templates-for-your-repository) for more information.
5+
6+
7+
## Workflows
8+
9+
10+
### Uploading artifacts
11+
12+
### Publishing to Pages
13+
14+
15+
## Make a repository citable
16+
The easiest way to make your repository citable is to add a `CITATION.cff` file to the repository, as it is supported by both
17+
[Zenodo's](https://zenodo.org/) and it's [Github integration](https://docs.github.com/en/repositories/archiving-a-github-repository/referencing-and-citing-content) and [Github](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-citation-files) itself.
18+

docs/index.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Reproducible workflow for researchers
2+
3+
This repository is a template for how to set up a reproducible python environment with GitHub.
4+
5+
## Contents
6+
```{tableofcontents}
7+
```

docs/packaging.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Python-packaging
2+
3+
To be able to create a python package, we need a folder with the name of the package (in this repository it is called `mypackage`, located under `src/mypackage`), and a `pyproject.toml` file.
4+
5+
6+
## Pyproject.toml
7+
8+
9+
## Coverage reports
10+
11+
12+
## Python linting (flake8)
13+
14+
15+
## Python typing (mypy)

docs/publishing.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Jupyter-book
2+
3+
## Building a minimal book
4+
5+
## Adding Python package API
6+
7+
## Adding demos

pyproject.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@ docs = [
3030
"jupytext", # Required to convert .py to .ipynb files
3131
]
3232

33-
binder = [
34-
"jupyterlab" # Required to interface with Binder when having a Dockerfile in root
33+
binder = [ # Required to interface with Binder when having a Dockerfile in root
34+
"jupyterlab",
35+
"notebook"
3536
]
3637

3738
[tool.mypy]

0 commit comments

Comments
 (0)