Skip to content

Commit fc11c33

Browse files
Add a guide for using markdown (#175)
1 parent 00e9e05 commit fc11c33

File tree

4 files changed

+170
-1
lines changed

4 files changed

+170
-1
lines changed

app/guide/how-to-publish.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ eleventyNavigation:
66
parent: Guide
77
---
88

9-
To publish a design history post, you need to use [GitHub](https://github.com) and [Markdown](https://www.markdownguide.org).
9+
To publish a design history post, you need to use [GitHub](https://github.com) and [Markdown](/guide/using-markdown/).
1010

1111
If you need any help with this, ask on the Slack channel – [#dpsp-design-histories](https://nhsdigitalcorporate.enterprise.slack.com/archives/C08JN2TJH2P).
1212

app/guide/using-markdown.md

Lines changed: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
1+
---
2+
layout: post
3+
title: Using Markdown
4+
description: A guide to using Markdown within design history posts
5+
eleventyNavigation:
6+
parent: Guide
7+
---
8+
9+
Posts within this design history website are written using [Markdown](https://en.wikipedia.org/wiki/Markdown), a simple markup language which saves you from having to use HTML.
10+
11+
## Paragraphs
12+
13+
You don’t have to do anything special for paragraphs, except for making sure that there is an empty line between each one.
14+
15+
```md
16+
This is a paragraph.
17+
18+
This is another paragraph.
19+
This sentence will appear next to the previous sentence as single line breaks are ignored.
20+
```
21+
22+
## Headings and sub-headings
23+
24+
For headings, start the line with hash (`#`) characters, followed by a space.
25+
26+
You should use 2 hash characters for a heading (h2), or 3 hash characters for a sub-heading (h3).
27+
28+
Do not include a post title (h1) as this will be generated automatically from the information at the top of the post.
29+
30+
You do not need to create a heading before the introductory paragraph.
31+
32+
```md
33+
This is an introductory paragraph.
34+
35+
## Heading
36+
37+
This is a paragraph.
38+
39+
### Sub-heading
40+
41+
This is a paragraph.
42+
```
43+
44+
## Links
45+
46+
To create links, you have to use a combination of square brackets and round brackets.
47+
48+
The square brackets come first, and contain the link text. This must be immediately followed by round brackets which contain the URL.
49+
50+
```md
51+
For more information, see [vaccinations on the NHS website](https://www.nhs.uk/vaccinations/).
52+
```
53+
54+
### Internal links
55+
56+
If you are linking to another post on this design history site, you should not include the full URL, and instead just the part after `https://design-history.prevention-services.nhs.uk`.
57+
58+
This should start with a forward slash (`/`) character:
59+
60+
```md
61+
We previously wrote about [the pilot](/screening-invite/2025/06/invite-pilot-overview/).
62+
```
63+
64+
## Lists
65+
66+
You can add bullet lists by starting each item of the list with a dash (`-`) character followed by a space. You can also use asterisks (`*`).
67+
68+
There should be a blank line before and after each list.
69+
70+
```md
71+
We have 3 user types:
72+
73+
- administrators
74+
- clinicians
75+
- managers
76+
```
77+
78+
### Numbered lists
79+
80+
If the order of items in your list is significant, use a numbered list.
81+
82+
Each item in the list should start with a number, a full stop and then a space.
83+
84+
```md
85+
This was our design process:
86+
87+
1. Desk research
88+
2. Explore lots of different designs
89+
3. Refine a couple of options
90+
4. Usability testing
91+
```
92+
93+
## Quotations
94+
95+
You can add quotations by starting each line of the quote using a greater than (`>`) character followed by a space.
96+
97+
If you are quoting a user taking part in research, they should not be identifiable.
98+
99+
```md
100+
As the NHS vaccination strategy says:
101+
102+
> Vaccination services and activities should be holistic.
103+
>
104+
> Multidisciplinary teams could offer wider health advice and interventions.
105+
```
106+
107+
This is shown like this:
108+
109+
> Vaccination services and activities should be holistic.
110+
>
111+
> Multidisciplinary teams could offer wider health advice and interventions.
112+
113+
## Images
114+
115+
To embed an image, use a similar combination of square and round brackets as with links, but starting first with a exclamation mark (`!`).
116+
117+
The content within the square brackets is used for alternative text (alt text) for use by screen reading software or if the the images fail to load.
118+
119+
The alt text should contain the key information within the image that is being discussed in your post. For example, if the image is a screenshot, the alt text could describe the visual layout of the page, or could contain the key content in the screenshot. It should not be generic text like "Screenshot of homepage".
120+
121+
Within the round brackets you must include the exact name of the image file, which is case sensitive.
122+
123+
```md
124+
We redesigned the homepage to clearly list the different services within our portfolio:
125+
126+
![Screenshot of a website with the title 'Digital prevention design history'. Beneath this are 3 headings labelled 'Screening', 'Vaccinations' and 'Personalised prevention', and underneath these headings are linked service names in a two column grid.](homepage-redesign.png)
127+
```
128+
129+
### Images with captions
130+
131+
You can also optionally add a caption to an image, which will then appear underneath it on your post.
132+
133+
The caption is in addition to alt text. Unlike the alt text, the caption cab be a short description of what the image is.
134+
135+
The caption is added inside the round brackets, after the file name, within double quotes (`"`).
136+
137+
```md
138+
This is our brand:
139+
140+
![Blue rectangle containing 'NHS' as white slanted letters](nhs-logo.png "The NHS logo")
141+
```
142+
143+
Here is how images with captions are displayed:
144+
145+
![Blue rectangle containing 'NHS' as white slanted letters](../../nhs-logo.png "The NHS logo")
146+
147+
148+
## Tables
149+
150+
Tables can be used if you have some simple data or statistics to include.
151+
152+
To add tables, use the pipe (`|`) character to separate the columns and at the start and end of each row.
153+
154+
The table should start with a row that contains headings for each column. After this heading row, add a row using dash (`-`) characters in each column to separate the column headings from the table data.
155+
156+
```md
157+
These are the questions we included in the survey:
158+
159+
| Field | Format | Type |
160+
| -------------------------- | ------- | -------- |
161+
| Name | Text | Required |
162+
| Date of birth | Date | Required |
163+
| Phone number | Text | Optional |
164+
| Consent for future contact | Boolean | Required |
165+
```

app/images/nhs-logo.png

8.07 KB
Loading

app/styles/application.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,7 @@ $govuk-font-family: Frutiger W01, arial, sans-serif;
7373
max-width: 100%;
7474
}
7575
}
76+
77+
.x-govuk-code--block {
78+
background-color: white;
79+
}

0 commit comments

Comments
 (0)