Skip to content
This repository was archived by the owner on May 22, 2024. It is now read-only.

Commit 64f9aa9

Browse files
update admonitions and site navigation
1 parent f537831 commit 64f9aa9

File tree

12 files changed

+205
-142
lines changed

12 files changed

+205
-142
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# README
2+
3+
A python-based alternative to the ruby-based [Tech Docs Template](https://github.com/alphagov/tech-docs-template).
4+
5+
Visit the [documentation website](https://ministryofjustice.github.io/mkdocs-tech-docs-template/) for more details.

docs/README.md

Lines changed: 23 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,34 @@
1-
# MkDocs Tech Docs Template
2-
3-
!!! danger ""
4-
5-
This template is under construction and should only be used for prototyping
6-
7-
The MkDocs Tech Docs Template is an [MkDocs theme](https://www.mkdocs.org/) that you can use to build technical documentation with a [GOV.UK style](https://design-system.service.gov.uk/). For a demo visit [mkdocs-tech-docs-template](https://ministryofjustice.github.io/mkdocs-tech-docs-template/).
1+
---
2+
hide:
3+
- navigation
4+
- toc
5+
---
86

9-
The MkDocs Tech Docs Template is a python-based alternative to the ruby-based Middleman [Tech Docs Template](https://github.com/alphagov/tech-docs-template) with the following benefits:
10-
11-
- simple to setup, use and customise
12-
- exploits the [MkDocs Materials theme](https://squidfunk.github.io/mkdocs-material/) and all it's associated features
13-
- compatible with the vast ecosystem of [MkDocs Plugins](https://github.com/mkdocs/mkdocs/wiki/MkDocs-Plugins), see [plugins](plugins/) for some examples
14-
- unified tech stack for python-based teams and projects
15-
- easy to upgrade as new versions of the theme are released
16-
17-
You’re welcome to use the MkDocs Tech Docs Template even if your service isn’t considered part of GOV.UK, but your site or service must not:
7+
# MkDocs Tech Docs Template
188

19-
- identify itself as being part of GOV.UK
20-
- use the crown or GOV.UK logotype in the header
21-
- use the GDS Transport typeface
22-
- suggest that it’s an official UK government website if it’s not
9+
!!! banner "Build technical documentation with a [GOV.UK style](https://design-system.service.gov.uk/)"
2310

24-
## Usage
11+
![Services](homepage-illustration.svg){ align=right width=300px height=300px}
2512

26-
Please refer to [Usage](./Usage.md) for more details.
13+
A python-based alternative to the ruby-based [Tech Docs Template](https://github.com/alphagov/tech-docs-template) with the following benefits:
2714

28-
## Questions
15+
- simple to [setup](./setup/), [customise](./setup/customise.md) and [enhance](./setup/CONTRIBUTE.md)
16+
- exploits the [MkDocs Materials theme](https://squidfunk.github.io/mkdocs-material/) and all it's associated features
17+
- compatible with the vast ecosystem of MkDocs [plugins](plugins/)
18+
- unified tech stack for python-based teams and projects
2919

30-
Please raise on [Discussions](https://github.com/ministryofjustice/mkdocs-tech-docs-template/discussions).
3120

32-
## Contribute
21+
!!! warning inline end "Prototype"
3322

34-
👉 Find out how to [contribute](CONTRIBUTE.md).
23+
This template is under construction and should only be used for prototyping
24+
25+
!!! quote "Restrictions"
3526

36-
## Licence
27+
You’re welcome to use the MkDocs Tech Docs Template even if your service isn’t considered part of GOV.UK, but your site or service must not:
3728

38-
Unless stated otherwise, the codebase is released under [the MIT License](LICENSE).
39-
This covers both the codebase and any sample code in the documentation.
29+
- identify itself as being part of GOV.UK
30+
- use the crown or GOV.UK logotype in the header
31+
- use the GDS Transport typeface
32+
- suggest that it’s an official UK government website if it’s not
4033

41-
The documentation is [© Crown copyright](http://www.nationalarchives.gov.uk/information-management/re-using-public-sector-information/uk-government-licensing-framework/crown-copyright/) and available under the terms of the [Open Government 3.0](http://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/) licence.
34+
<br>

docs/Usage.md

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

docs/homepage-illustration.svg

Lines changed: 1 addition & 0 deletions
Loading
File renamed without changes.

docs/setup/README.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Minimal Setup
2+
3+
This page contains the minimal steps to use the MKDocs Tech Docs Template. Some additional customisation is provided in [customise](customise.md). You are encouraged to read the Material for MkDocs [guidance](https://squidfunk.github.io/mkdocs-material/) for more detailed information on setting up and customisation.
4+
5+
## Installation
6+
7+
MkDocs Tech Docs template is published as a Python package and can be installed with pip, ideally by using a virtual environment. Open up a terminal and install with:
8+
9+
```
10+
pip install mkdocs-tech-docs-template
11+
```
12+
13+
Bootstrap your project documentation:
14+
15+
```
16+
mkdocs new .
17+
```
18+
19+
This creates the following structure:
20+
21+
```
22+
.
23+
├─ docs/
24+
│ └─ index.md
25+
└─ mkdocs.yml
26+
```
27+
28+
## Configuration
29+
30+
Update/add the following variables to `mkdocs.yml`:
31+
32+
```
33+
- site_name: <website-name>
34+
- repo_url: <url>
35+
- theme:
36+
name: tech_docs_template
37+
```
38+
39+
## Preview
40+
41+
MkDocs includes a live preview server, so you can preview your changes as you write your documentation. The server will automatically rebuild the site upon saving. Start it with:
42+
43+
``` sh
44+
mkdocs serve
45+
```
46+
47+
## Publish
48+
49+
You can use [GitHub Actions](https://github.com/features/actions) to automate the deployment of your documentation to [GitHub Pages](https://pages.github.com/) when a commit is pushed to either the master or main branches.
50+
51+
See [publishing your site](https://squidfunk.github.io/mkdocs-material/publishing-your-site/) for more details and alternatives.

docs/setup/customise.md

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# Customise
2+
3+
This page explains the customisation used in the demo. You are encouraged to read the Material for MkDocs [guidance](https://squidfunk.github.io/mkdocs-material/) for more detailed information on customisation.
4+
5+
## Documentation Layout
6+
7+
The `nav` configuration setting in your `mkdocs.yml` file defines which pages are included in the global site navigation menu as well as the structure of that menu.
8+
9+
If not provided, the navigation will be automatically created by discovering all the Markdown files in the documentation directory. See [Configure Pages and Navigation](https://www.mkdocs.org/user-guide/writing-your-docs/#configure-pages-and-navigation) for more details.
10+
11+
## Navigation Formatting
12+
13+
Tabs are disabled by default:
14+
15+
![No tabs](no_tabs.png)
16+
17+
To enable tabs and use the same navigation structure as displayed in the demo update the `mkdocs.yml` as follows:
18+
```
19+
theme:
20+
features:
21+
- navigation.tabs
22+
- navigation.tabs.sticky
23+
- navigation.indexes
24+
```
25+
26+
You can hide the navigation and contents page on individual pages using the front matter:
27+
28+
```
29+
---
30+
hide:
31+
- navigation
32+
- toc
33+
---
34+
35+
# MkDocs Tech Docs Template
36+
37+
```
38+
39+
Please refer to [setting up navigation](https://squidfunk.github.io/mkdocs-material/setup/setting-up-navigation/) for more details.
40+
41+
## Logos and Images
42+
43+
To use your department's images you can use one of the provided [logos](../tech_docs_template/logos/) and [favicons](../tech_docs_template/favicons/) and specify the path in the `mkdocs.yml` for example:
44+
45+
```
46+
theme:
47+
logo: logos/moj.png
48+
favicon: favicons/moj.ico
49+
```
50+
51+
Alternatively you can add the images to the `docs/assets` directory in your own repository and specify the path for example:
52+
53+
```
54+
theme:
55+
logo: assets/ho_logo.png
56+
favicon: assets/ho_icon.ico
57+
```
58+
59+
Do consider adding the images to the template for sharing with colleagues!
60+
61+
## Social links
62+
63+
Social links are rendered above the copyright notice as part of the
64+
footer of your project documentation. Add a list of social links in `mkdocs.yml`
65+
with:
66+
67+
``` yaml
68+
extra:
69+
social:
70+
- icon: fontawesome/brands/mastodon
71+
link: https://fosstodon.org/@squidfunk
72+
```
73+
74+
Please refer to [social links](https://squidfunk.github.io/mkdocs-material/setup/setting-up-the-footer/?h=social#navigation) for more details.
75+
76+
## Admonitions
77+
78+
Admonitions, also known as call-outs, are an excellent choice for including side content without significantly interrupting the document flow. They can also be used to provide structure and coloured headings as in used on the [home](README.md) page. Please refer to [admonitions](https://squidfunk.github.io/mkdocs-material/reference/admonitions/#admonition-icons) for more details.
File renamed without changes.

mkdocs.yml

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,6 @@ theme:
2020
code: Roboto Mono
2121
icon:
2222
admonition:
23-
note: octicons/tag-16
24-
abstract: octicons/checklist-16
25-
info: octicons/info-16
26-
tip: octicons/squirrel-16
27-
success: octicons/check-16
28-
question: octicons/question-16
29-
warning: octicons/alert-16
30-
failure: octicons/x-circle-16
31-
danger: octicons/zap-16
32-
bug: octicons/bug-16
33-
example: octicons/beaker-16
3423
quote: octicons/quote-16
3524

3625
edit_uri: edit/main/docs/
@@ -41,17 +30,30 @@ plugins:
4130
- git-revision-date-localized:
4231
enable_creation_date: true
4332
fallback_to_build_date: true
33+
exclude:
34+
- README.md
4435
markdown_extensions:
4536
- admonition
4637
- pymdownx.details
4738
- pymdownx.superfences
4839
- tables
40+
- attr_list
41+
extra:
42+
social:
43+
- icon: fontawesome/brands/slack
44+
link: https://mojdt.slack.com/archives/CBVUV2613
45+
- icon: fontawesome/solid/paper-plane
46+
link: mailto:soumaya.mauthoor@digital.justice.gov.uk
47+
- icon: fontawesome/brands/github
48+
link: https://github.com/ministryofjustice/mkdocs-tech-docs-template/discussions
4949

5050
nav:
51-
- About:
51+
- Home:
5252
- README.md
53-
- Usage: Usage.md
54-
- Contribute: CONTRIBUTE.md
53+
- Setup:
54+
- setup/README.md
55+
- Customise: setup/customise.md
56+
- Contribute: setup/CONTRIBUTE.md
5557
- Plugins:
5658
- plugins/README.md
5759
- Demo Table: plugins/demo_table.md

tech_docs_template/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.0.18"
1+
__version__ = "0.0.19"

tech_docs_template/assets/stylesheets/extra.css

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@
4545
}
4646

4747
.md-footer{
48+
padding-top: 40px;
49+
padding-bottom: 25px;
4850
border-top: 1px solid;
4951
border-color: #b1b4b6;
5052
}
@@ -118,19 +120,34 @@
118120
border-bottom-color: #1d70b8;
119121
}
120122

121-
/* Configure the warning and info panels */
123+
/* Configure the adminitions */
122124
.md-typeset .admonition,
123125
.md-typeset details {
124-
font-size: 16px;
126+
font-size: 0.85rem;
125127
border: 3px solid;
128+
box-shadow: none;
129+
/* border-width: 0; */
130+
/* border-left-width: 4px; */
126131
}
127132

128133
/* Configure the main panel */
129134
.md-main__inner {
130135
margin-top:10px;
131136
}
132137

133-
/* Configure the jupyter notebook code panels
134-
.highlight {
135-
background-color:#e0f7fa;
136-
} */
138+
/* Create a new banner admonition */
139+
.md-typeset .admonition.banner,
140+
.md-typeset details.banner {
141+
border-color: #1d70b8;
142+
}
143+
.md-typeset .banner > .admonition-title,
144+
.md-typeset .banner > .admonition-title a,
145+
.md-typeset .banner > summary {
146+
font-size: 30px;
147+
background-color: #1d70b8;
148+
color: white;
149+
}
150+
.md-typeset .banner > .admonition-title::before,
151+
.md-typeset .banner > summary::before {
152+
background-color: white;
153+
}

0 commit comments

Comments
 (0)