Skip to content

Commit 91fd6bb

Browse files
authored
Fix various bugs and add docs (#62)
Fix: Issue on page /part2/github.html #50 Fix: [Feature Request]: Add documentation regarding Github/Docker integration #43 Fix: Add notes about how to ignore `flake8` and `mypy` #53
1 parent 27b4af1 commit 91fd6bb

4 files changed

Lines changed: 31 additions & 2 deletions

File tree

‎docs/_toc.yml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ parts:
2020
chapters:
2121
- file: "part3/documentation"
2222
- file: "api"
23+
- file: "part3/publishing_book"
2324

2425
- caption: Demos
2526
chapters:

‎docs/part1/linting.md‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ exclude = docs,venv
2626
max-line-length = 100
2727
```
2828

29+
To ignore `flake8` formatting on certain lines, or ignore certain rules, see: [Ignoring Errors with Flake8](https://flake8.pycqa.org/en/3.1.1/user/ignoring-errors.html).
30+
2931
## Code consistency
3032
Flake8 only checks the consistency of your code to a certain extent.
3133
Modern Python allows for [type hints](https://peps.python.org/pep-0484/) which means that you can specify the input and output type for functions.
@@ -55,4 +57,6 @@ files = [
5557
"tests" # Does not show errors when importing untyped libraries
5658
]
5759
```
58-
where `ignore_missing_imports` is set to `True` to supress all errors coming from third-party libraries that are untyped.
60+
where `ignore_missing_imports` is set to `True` to supress all errors coming from third-party libraries that are untyped.
61+
62+
To let `mypy` ignore single lines or whole files, see: [Locally silencing the checker](https://mypy.readthedocs.io/en/stable/common_issues.html#spurious-errors-and-locally-silencing-the-checker).

‎docs/part2/github.md‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,13 @@ More information about workflows can be found in the [Github Documentation](http
1010

1111
## Actions
1212
[Github Actions](https://github.com/features/actions) is a prebuilt set of instructions to make it easier to interact with Github.
13-
The actions officially maintained by Github can be found at: phttps://github.com/actions](https://github.com/actions)
13+
The actions officially maintained by Github can be found at: [GitHub/actions](https://github.com/actions)
1414

1515
## Uploading artifacts
1616
As covered in the [Coverage report](../part1/coverage)-section, we use the [Upload artifact action](https://github.com/actions/upload-artifact#readme)
1717

18+
(publishing-to-pages)=
19+
1820
## Publishing to Pages
1921
There are several ways to publish a set of html files to Github Pages.
2022
One can either:

‎docs/part3/publishing_book.md‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Publishing a Jupyter-book as a webpage
2+
3+
To make it simple to integrate the Jupyter-book with Github, we using Github Pages, as described in
4+
[Publishing to Github Pages](publishing-to-pages).
5+
6+
## Official Github Actions
7+
Follow the steps in [Publishing with a Github Custom Actions workflow](https://docs.github.com/en/pages/getting-started-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site#publishing-with-a-custom-github-actions-workflow)
8+
9+
Follow the steps in [Creating a custom Github Actions](https://docs.github.com/en/pages/getting-started-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site#creating-a-custom-github-actions-workflow-to-publish-your-site),
10+
11+
For step 3, we would call `make doc` to generate the documentation at `docs/_build/html`, which in turn is the folder we upload as a Github page.
12+
13+
A Github action showing some of the steps can be found at [Actions/deploy-pages](https://github.com/actions/deploy-pages#usage).
14+
15+
16+
## Using a Github branch for publishing
17+
If one is using the `legacy` workflow from [peaceiris/actions-gh-pages](https://github.com/peaceiris/actions-gh-pages#github-pages-action) one would publish the html files to a branch, usually `gh-pages`.
18+
19+
1. On Github navigate to your repository
20+
2. Under your repository name, choose `Settings`
21+
3. Press `Pages`.
22+
4. Under `Build and deployment` choose `Source: Deploy from a branch` and set the `branch` to `gh-pages`.

0 commit comments

Comments
 (0)