Skip to content

Commit def9c7e

Browse files
authored
Merge pull request #14 from ONS-Innovation/documentation
Documentation
2 parents d9d1cf4 + a062451 commit def9c7e

15 files changed

Lines changed: 847 additions & 621 deletions

File tree

docs/readme.md renamed to README.md

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -54,20 +54,4 @@ This project uses MkDocs for documentation which gets deployed to GitHub Pages a
5454

5555
For more information about MkDocs, see the below documentation.
5656

57-
[Getting Started with MkDocs](https://www.mkdocs.org/getting-started/)
58-
59-
### To update the GitHub Pages deployment:
60-
61-
1. Delete the old /mkdocs_deployment directory.
62-
63-
2. Build the MkDocs Site.
64-
65-
```bash
66-
mkdocs build
67-
```
68-
69-
3. Rename the /site directory to /mkdocs_deployment.
70-
71-
4. Push changes to GitHub.
72-
73-
Once the changes are pushed, `deploy_mkdocs.yml` will be executed through GitHub Actions. This will deploy the /mkdocs_deployment to GitHub Pages.
57+
[Getting Started with MkDocs](https://www.mkdocs.org/getting-started/)

docs/assets/favicon.ico

2.76 KB
Binary file not shown.

docs/assets/logo.png

62.2 KB
Loading

docs/documentation.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Documentation
2+
3+
This site uses MkDocs to build its documentation and GitHub Pages for hosting.
4+
5+
## Format
6+
7+
Documentation within this project follows the following pattern:
8+
9+
- A `README.md` for each component
10+
- A `/docs` folder for the project
11+
12+
Each `README.md` should contain:
13+
14+
- A description of what the component is/does
15+
- A list of any prerequisites
16+
- Setup instructions
17+
- Execution instructions
18+
- Deployment instructions
19+
20+
The `/docs` folder should contain:
21+
22+
- A description of what the project is
23+
- An overview of how the everything fits together in the project
24+
- An explanation of the tech stack
25+
- Details of the underlying dataset
26+
27+
A majority of the information should reside within the `/docs` directory over the `README`. The `README`s in this project should be kept for concise instructions on how to use each component. Any detailed explanation should be kept within `/docs`.
28+
29+
## Updating MkDocs Deployment
30+
31+
If changes are made within `/docs`, the GitHub Pages deployment will need to be updated. Assuming you have already installed [MkDocs](https://www.mkdocs.org/getting-started/#installation) and [Material for MkDocs](https://squidfunk.github.io/mkdocs-material/getting-started/#installation), do the following:
32+
33+
1. Navigate to the projects root directory.
34+
35+
2. Delete the existing `/mkdocs_deployment` directory.
36+
37+
3. Build the MkDocs deployment.
38+
39+
```bash
40+
mkdocs build
41+
```
42+
43+
4. Rename the `/site` directory to `/mkdocs_deployment`. This allows git to track the build so GitHub Pages can redeploy it.
44+
45+
5. Commit and Push changes.
46+
47+
Once completed, a GitHub Action will redeploy the new build to GitHub Pages.

docs/index.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,18 @@
22

33
## Overview
44

5-
This project is a supporting package for tools which need to access the GitHub RESTful API. It includes a function to authenticate requests as a GitHub App installation, and a class which allows Get, Patch and Post request to be made easily.
5+
This project is a supporting package for tools which need to access the GitHub RESTful API. It includes a function to authenticate requests as a GitHub App installation and a class which allows Get, Patch and Post requests to be made easily.
66

77
This package is primarily used by:
88

9-
- [GitHub Repository Archive Tool](https://github.com/ONS-Innovation/code-repo-archive-tool)
10-
- [GitHub CoPilot Usage Dashboard](https://github.com/ONS-Innovation/code-github-copilot-usage-audit)
11-
- [GitHub Policy/Audit Dashboard](https://github.com/ONS-Innovation/code-github-audit-dashboard)
9+
- [GitHub Repository Archive Tool](https://github.com/ONS-Innovation/github-repository-archive-tool)
10+
- [GitHub CoPilot Usage Dashboard](https://github.com/ONS-Innovation/github-copilot-usage-dashboard)
11+
- [GitHub Policy/Audit Dashboard](https://github.com/ONS-Innovation/github-policy-dashboard)
1212

13-
For more information, please see the [README.md](./readme.md).
13+
## Techstack Overview
14+
15+
This project is written in Python due to its requirement to be used in other Python projects and doesn't use any specific frameworks. The package uses requests to make API calls and JWT to get a GitHub Authentication token.
16+
17+
## Getting Started
18+
19+
To setup and use the project, please refer to the [README](https://github.com/ONS-Innovation/github-api-package/blob/main/README.md).

mkdocs.yml

Lines changed: 42 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,55 @@
11
site_name: GitHub API Package
22

3+
repo_url: https://github.com/ONS-Innovation/github-api-package
4+
repo_name: GitHub API Package
5+
36
nav:
47
- Home: 'index.md'
5-
- Getting Started: 'readme.md'
6-
8+
- Documentation: 'documentation.md'
9+
710
theme:
811
name: material
12+
language: en
13+
914
palette:
10-
scheme: slate
15+
# toggle for light mode
16+
- media: "(prefers-color-scheme: light)"
17+
scheme: default
18+
primary: white
19+
accent: deep purple
20+
toggle:
21+
icon: material/weather-night
22+
name: Switch to dark mode
23+
24+
# toggle for dark mode
25+
- media: "(prefers-color-scheme: dark)"
26+
scheme: slate
27+
primary: white
28+
accent: deep purple
29+
toggle:
30+
icon: material/weather-sunny
31+
name: Switch to system preference
32+
1133
features:
34+
- navigation.tracking
35+
- navigation.sections
36+
- navigation.path
37+
- navigation.top
38+
- navigation.footer
39+
40+
- search.suggest
41+
42+
- header.autohide
1243
- content.code.copy
1344

45+
46+
47+
logo: assets/logo.png
48+
favicon: assets/favicon.ico
49+
50+
icon:
51+
repo: fontawesome/brands/github
52+
1453
markdown_extensions:
1554
- pymdownx.highlight:
1655
anchor_linenums: true

mkdocs_deployment/404.html

Lines changed: 69 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212

1313

14-
<link rel="icon" href="/assets/images/favicon.png">
14+
<link rel="icon" href="/assets/favicon.ico">
1515
<meta name="generator" content="mkdocs-1.6.0, mkdocs-material-9.5.29">
1616

1717

@@ -54,10 +54,12 @@
5454

5555

5656

57+
58+
5759

5860

5961

60-
<body dir="ltr" data-md-color-scheme="slate" data-md-color-primary="indigo" data-md-color-accent="indigo">
62+
<body dir="ltr" data-md-color-scheme="default" data-md-color-primary="white" data-md-color-accent="deep-purple">
6163

6264

6365
<input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
@@ -79,8 +81,7 @@
7981
<nav class="md-header__inner md-grid" aria-label="Header">
8082
<a href="/." title="GitHub API Package" class="md-header__button md-logo" aria-label="GitHub API Package" data-md-component="logo">
8183

82-
83-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 8a3 3 0 0 0 3-3 3 3 0 0 0-3-3 3 3 0 0 0-3 3 3 3 0 0 0 3 3m0 3.54C9.64 9.35 6.5 8 3 8v11c3.5 0 6.64 1.35 9 3.54 2.36-2.19 5.5-3.54 9-3.54V8c-3.5 0-6.64 1.35-9 3.54Z"/></svg>
84+
<img src="/assets/logo.png" alt="logo">
8485

8586
</a>
8687
<label class="md-header__button md-icon" for="__drawer">
@@ -105,8 +106,34 @@
105106
</div>
106107

107108

109+
<form class="md-header__option" data-md-component="palette">
110+
111+
112+
113+
114+
<input class="md-option" data-md-color-media="(prefers-color-scheme: light)" data-md-color-scheme="default" data-md-color-primary="white" data-md-color-accent="deep-purple" aria-label="Switch to dark mode" type="radio" name="__palette" id="__palette_0">
115+
116+
<label class="md-header__button md-icon" title="Switch to dark mode" for="__palette_1" hidden>
117+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="m17.75 4.09-2.53 1.94.91 3.06-2.63-1.81-2.63 1.81.91-3.06-2.53-1.94L12.44 4l1.06-3 1.06 3 3.19.09m3.5 6.91-1.64 1.25.59 1.98-1.7-1.17-1.7 1.17.59-1.98L15.75 11l2.06-.05L18.5 9l.69 1.95 2.06.05m-2.28 4.95c.83-.08 1.72 1.1 1.19 1.85-.32.45-.66.87-1.08 1.27C15.17 23 8.84 23 4.94 19.07c-3.91-3.9-3.91-10.24 0-14.14.4-.4.82-.76 1.27-1.08.75-.53 1.93.36 1.85 1.19-.27 2.86.69 5.83 2.89 8.02a9.96 9.96 0 0 0 8.02 2.89m-1.64 2.02a12.08 12.08 0 0 1-7.8-3.47c-2.17-2.19-3.33-5-3.49-7.82-2.81 3.14-2.7 7.96.31 10.98 3.02 3.01 7.84 3.12 10.98.31Z"/></svg>
118+
</label>
119+
120+
121+
122+
123+
124+
<input class="md-option" data-md-color-media="(prefers-color-scheme: dark)" data-md-color-scheme="slate" data-md-color-primary="white" data-md-color-accent="deep-purple" aria-label="Switch to system preference" type="radio" name="__palette" id="__palette_1">
125+
126+
<label class="md-header__button md-icon" title="Switch to system preference" for="__palette_0" hidden>
127+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 7a5 5 0 0 1 5 5 5 5 0 0 1-5 5 5 5 0 0 1-5-5 5 5 0 0 1 5-5m0 2a3 3 0 0 0-3 3 3 3 0 0 0 3 3 3 3 0 0 0 3-3 3 3 0 0 0-3-3m0-7 2.39 3.42C13.65 5.15 12.84 5 12 5c-.84 0-1.65.15-2.39.42L12 2M3.34 7l4.16-.35A7.2 7.2 0 0 0 5.94 8.5c-.44.74-.69 1.5-.83 2.29L3.34 7m.02 10 1.76-3.77a7.131 7.131 0 0 0 2.38 4.14L3.36 17M20.65 7l-1.77 3.79a7.023 7.023 0 0 0-2.38-4.15l4.15.36m-.01 10-4.14.36c.59-.51 1.12-1.14 1.54-1.86.42-.73.69-1.5.83-2.29L20.64 17M12 22l-2.41-3.44c.74.27 1.55.44 2.41.44.82 0 1.63-.17 2.37-.44L12 22Z"/></svg>
128+
</label>
129+
130+
131+
</form>
132+
108133

109134

135+
<script>var media,input,key,value,palette=__md_get("__palette");if(palette&&palette.color){"(prefers-color-scheme)"===palette.color.media&&(media=matchMedia("(prefers-color-scheme: light)"),input=document.querySelector(media.matches?"[data-md-color-media='(prefers-color-scheme: light)']":"[data-md-color-media='(prefers-color-scheme: dark)']"),palette.color.media=input.getAttribute("data-md-color-media"),palette.color.scheme=input.getAttribute("data-md-color-scheme"),palette.color.primary=input.getAttribute("data-md-color-primary"),palette.color.accent=input.getAttribute("data-md-color-accent"));for([key,value]of Object.entries(palette.color))document.body.setAttribute("data-md-color-"+key,value)}</script>
136+
110137

111138

112139
<label class="md-header__button md-icon" for="__search">
@@ -132,6 +159,8 @@
132159
</button>
133160
</nav>
134161

162+
<div class="md-search__suggest" data-md-component="search-suggest"></div>
163+
135164
</form>
136165
<div class="md-search__output">
137166
<div class="md-search__scrollwrap" tabindex="0" data-md-scrollfix>
@@ -147,6 +176,18 @@
147176
</div>
148177

149178

179+
<div class="md-header__source">
180+
<a href="https://github.com/ONS-Innovation/github-api-package" title="Go to repository" class="md-source" data-md-component="source">
181+
<div class="md-source__icon md-icon">
182+
183+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 496 512"><!--! Font Awesome Free 6.5.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2024 Fonticons, Inc.--><path d="M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"/></svg>
184+
</div>
185+
<div class="md-source__repository">
186+
GitHub API Package
187+
</div>
188+
</a>
189+
</div>
190+
150191
</nav>
151192

152193
</header>
@@ -174,13 +215,24 @@
174215
<label class="md-nav__title" for="__drawer">
175216
<a href="/." title="GitHub API Package" class="md-nav__button md-logo" aria-label="GitHub API Package" data-md-component="logo">
176217

177-
178-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 8a3 3 0 0 0 3-3 3 3 0 0 0-3-3 3 3 0 0 0-3 3 3 3 0 0 0 3 3m0 3.54C9.64 9.35 6.5 8 3 8v11c3.5 0 6.64 1.35 9 3.54 2.36-2.19 5.5-3.54 9-3.54V8c-3.5 0-6.64 1.35-9 3.54Z"/></svg>
218+
<img src="/assets/logo.png" alt="logo">
179219

180220
</a>
181221
GitHub API Package
182222
</label>
183223

224+
<div class="md-nav__source">
225+
<a href="https://github.com/ONS-Innovation/github-api-package" title="Go to repository" class="md-source" data-md-component="source">
226+
<div class="md-source__icon md-icon">
227+
228+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 496 512"><!--! Font Awesome Free 6.5.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2024 Fonticons, Inc.--><path d="M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"/></svg>
229+
</div>
230+
<div class="md-source__repository">
231+
GitHub API Package
232+
</div>
233+
</a>
234+
</div>
235+
184236
<ul class="md-nav__list" data-md-scrollfix>
185237

186238

@@ -210,11 +262,11 @@
210262

211263

212264
<li class="md-nav__item">
213-
<a href="/readme/" class="md-nav__link">
265+
<a href="/documentation/" class="md-nav__link">
214266

215267

216268
<span class="md-ellipsis">
217-
Getting Started
269+
Documentation
218270
</span>
219271

220272

@@ -260,10 +312,18 @@ <h1>404 - Not found</h1>
260312
<script>var target=document.getElementById(location.hash.slice(1));target&&target.name&&(target.checked=target.name.startsWith("__tabbed_"))</script>
261313
</div>
262314

315+
<button type="button" class="md-top md-icon" data-md-component="top" hidden>
316+
317+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M13 20h-2V8l-5.5 5.5-1.42-1.42L12 4.16l7.92 7.92-1.42 1.42L13 8v12Z"/></svg>
318+
Back to top
319+
</button>
320+
263321
</main>
264322

265323
<footer class="md-footer">
266324

325+
326+
267327
<div class="md-footer-meta md-typeset">
268328
<div class="md-footer-meta__inner md-grid">
269329
<div class="md-copyright">
@@ -286,7 +346,7 @@ <h1>404 - Not found</h1>
286346
</div>
287347

288348

289-
<script id="__config" type="application/json">{"base": "/", "features": ["content.code.copy"], "search": "/assets/javascripts/workers/search.b8dbb3d2.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}}</script>
349+
<script id="__config" type="application/json">{"base": "/", "features": ["navigation.tracking", "navigation.sections", "navigation.path", "navigation.top", "navigation.footer", "search.suggest", "header.autohide", "content.code.copy"], "search": "/assets/javascripts/workers/search.b8dbb3d2.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}}</script>
290350

291351

292352
<script src="/assets/javascripts/bundle.fe8b6f2b.min.js"></script>
2.76 KB
Binary file not shown.

mkdocs_deployment/assets/logo.png

62.2 KB
Loading

0 commit comments

Comments
 (0)