Skip to content

Commit

Permalink
[DO NOT MERGE] npm run build
Browse files Browse the repository at this point in the history
Previous PRs have resolved some of the issues around lists and links.

The differences in the build for this PR are:

**Heading IDs are concatenated rather than split**

eg: GOV.UK Design System becomes `id="govuk-design-system` instead of `id="gov-uk-design-system`

I think this is a good change - it avoids weirdness like `you-re` or `that-s` and also cleans up some stray dashes (see line 2149 of `public/components/accordion/index.html`)

**Non-breaking space characters are no longer replaced with whitespace**

See: markedjs/marked#1532

For an example, see line 1143 of `public/components/cookie-banner/index.html`, which gets its wording from https://github.com/alphagov/govuk-design-system/blob/7021e0d192ee3c62bdde382c463396fed1d2959a/src/components/cookie-banner/default/index.njk#L2

I'm uncertain as to whether this is good. I think it's fine, but there's a chance some delicate spacing thing could be thrown out by it

**Fenced code blocks are BROKEN**

Pedantic rules are not meant to support fenced code blocks. I haven't tracked down the exact fix, but this was clearly a bug in `marked`'s implementation - I'm guessing the pedantic rules at least in this case didn't override `gfm` for some reason (since we had both set to `true`).

In later versions of `marked`, this has been fixed, and since we're using `pedantic` all of our code blocks are treated as standard paragraphs. Whelp!

There doesn't appear to be a fix for this while still using `pedantic`, so the next step is to try and use `gfm`. Theoretically it should be fine - the changes we've made so far are very compliant, so should be supported by `gfm`.
  • Loading branch information
domoscargin committed Aug 25, 2022
1 parent 46d8eef commit a01fe31
Show file tree
Hide file tree
Showing 28 changed files with 101 additions and 130 deletions.
4 changes: 2 additions & 2 deletions deploy/public/accessibility/index.html
Expand Up @@ -944,7 +944,7 @@ <h1 id="accessibility">Accessibility</h1>
<p>The GOV.UK Design System website and the codebase it uses, GOV.UK Frontend, is maintained by a team at the Government Digital Service (GDS).</p>
<p>This page explains how the team works to ensure the Design System and Frontend are accessible.</p>
<p><a href="https://github.com/alphagov/govuk-frontend/blob/main/docs/contributing/test-components-using-accessibility-acceptance-criteria.md">Read about how to test components using accessibility acceptance criteria.</a></p>
<h2 id="accessibility-statement-for-the-gov-uk-design-system-website">Accessibility statement for the GOV.UK Design System website</h2>
<h2 id="accessibility-statement-for-the-govuk-design-system-website">Accessibility statement for the GOV.UK Design System website</h2>
<p>This accessibility statement applies to the GOV.UK Design System at <a href="https://design-system.service.gov.uk/">https://design-system.service.gov.uk/</a>, and the components and patterns from the GOV.UK Frontend codebase which appear in the examples throughout the Design System.</p>
<p>The GOV.UK Design System team wants as many people as possible to be able to use this website. For example, that means you should be able to:</p>
<ul>
Expand Down Expand Up @@ -979,7 +979,7 @@ <h3 id="how-this-website-has-been-tested-for-accessibility">How this website has
</ul>
<p>They also tested the global search functionality that appears in the header of every page in the Design System.</p>
<p>The <a href="http://frontend.design-system.service.gov.uk/">GOV.UK Frontend documentation website</a> was last tested for accessibility issues in March 2021.</p>
<h3 id="how-the-gov-uk-design-system-team-makes-this-website-accessible">How the GOV.UK Design System team makes this website accessible</h3>
<h3 id="how-the-govuk-design-system-team-makes-this-website-accessible">How the GOV.UK Design System team makes this website accessible</h3>
<p>The GOV.UK Design System team works hard to ensure that this Design System and Frontend, the codebase it uses, are accessible.</p>
<p>Where possible, the team aims to research components and patterns with a representative range of users, including those with disabilities.</p>
<p>We also test components to ensure they work with a broad range of browsers, devices and assistive technologies - including screen magnifiers, screen readers and speech recognition tools.</p>
Expand Down
4 changes: 2 additions & 2 deletions deploy/public/community/resources-and-tools/index.html
Expand Up @@ -1054,10 +1054,10 @@ <h2 id="create-prototypes-and-wireframes">Create prototypes and wireframes</h2>
<p><a href="https://github.com/dwp/sketch_wireframing_kit">Sketch Wireframing Kit</a> -
Sketch wireframes based on the GOV.UK Design System.</p>
<h2 id="build-front-ends">Build front ends</h2>
<h3 id="asp-net-mvc">ASP.NET MVC</h3>
<h3 id="aspnet-mvc">ASP.NET MVC</h3>
<p>Guidance on <a href="https://github.com/nouriach/compile-gds-runtime-dotnet">bringing the GOV.UK Design System into a .NET MVC Project</a> -
A walkthrough for how to import the GOV.UK Design System into a MVC project and compile the sass at runtime using gulp.</p>
<h3 id="node-js">Node.js</h3>
<h3 id="nodejs">Node.js</h3>
<p>Guidance on <a href="https://github.com/DEFRA/hapi-govuk-examples">building a hapi service using GOV.UK Frontend</a>.</p>
<h3 id="python">Python</h3>
<p><a href="https://github.com/LandRegistry/govuk-frontend-jinja">GOV.UK Frontend Jinja</a> -
Expand Down
2 changes: 1 addition & 1 deletion deploy/public/components/accordion/index.html
Expand Up @@ -2146,7 +2146,7 @@ <h2 id="research-on-this-component">Research on this component</h2>
<p>We updated this component in December 2021 to solve an accessibility issue where the buttons and section labels might be mistaken for links.</p>
<p><a href="https://github.com/alphagov/govuk-design-system-backlog/issues/1#issuecomment-995675898">Read about the research and development that went into improving the accordion component</a>.</p>
<p>The team made sure the component is accessible, for example that users can interact with it using just the keyboard.</p>
<h4 id="users-that-navigate-using-elements-lists-">Users that navigate using ‘elements lists’</h4>
<h4 id="users-that-navigate-using-elements-lists">Users that navigate using ‘elements lists’</h4>
<p>We need to find out more about users that navigate using ‘elements lists’ of headings, buttons, links and other elements — such as users of speech recognition software and partially-sighted users of screen readers.</p>
<p>For these users, it might not be clear enough that the section headings are considered buttons. This could mislead them to navigate (less efficiently) using the show or hide labels.</p>
<p>While this experience is inconvenient at first, it’s likely the user will better understand the button area once they interact with it and see its focus state. <a href="https://github.com/alphagov/govuk-frontend/issues/2295#issuecomment-906449543">See ‘Testing with Dragon’ in the accessibility clinic summary</a>.</p>
Expand Down
2 changes: 1 addition & 1 deletion deploy/public/components/character-count/index.html
Expand Up @@ -1883,7 +1883,7 @@ <h2 id="how-it-works">How it works</h2>



<h3 id="if-you-re-asking-more-than-one-question-on-the-page">If you’re asking more than one question on the page</h3>
<h3 id="if-youre-asking-more-than-one-question-on-the-page">If you’re asking more than one question on the page</h3>
<p>If you’re asking more than one question on the page, do not set the contents of the <code>&lt;label&gt;</code> as the page heading. Read more about <a href="/patterns/question-pages/#asking-multiple-questions-on-a-page">asking multiple questions on question pages</a>.</p>
<div class="app-example-wrapper" id="character-count-without-a-heading-example" data-module="app-tabs">
<div class="app-example app-example--tabs">
Expand Down
6 changes: 3 additions & 3 deletions deploy/public/components/checkboxes/index.html
Expand Up @@ -1611,7 +1611,7 @@ <h2 id="how-it-works">How it works</h2>
<p>Order checkbox options alphabetically by default.</p>
<p>In some cases, it can be helpful to order them from most-to-least common options. For example, you could order options for ‘What is your nationality?’ based on population size.</p>
<p>Group checkboxes together in a <code>&lt;fieldset&gt;</code> with a <code>&lt;legend&gt;</code> that describes them, as shown in the examples on this page. This is usually a question, like ‘How would you like to be contacted?’.</p>
<h3 id="if-you-re-asking-one-question-on-the-page">If you’re asking one question on the page</h3>
<h3 id="if-youre-asking-one-question-on-the-page">If you’re asking one question on the page</h3>
<p>If you’re asking just <a href="/patterns/question-pages/#start-by-asking-one-question-per-page">one question per page</a> as recommended, you can set the contents of the <code>&lt;legend&gt;</code> as the page heading. This is good practice as it means that users of screen readers will only hear the contents once.</p>
<p>Read more about <a href="/get-started/labels-legends-headings/">why and how to set legends as headings</a>.</p>
<p>There are 2 ways to use the checkboxes component. You can use HTML or, if you’re using <a href="https://mozilla.github.io/nunjucks/">Nunjucks</a> or the <a href="https://govuk-prototype-kit.herokuapp.com/docs">GOV.UK Prototype Kit</a>, you can use the Nunjucks macro.</p>
Expand Down Expand Up @@ -2079,7 +2079,7 @@ <h3 id="if-you-re-asking-one-question-on-the-page">If you’re asking one questi



<h3 id="if-you-re-asking-more-than-one-question-on-the-page">If you’re asking more than one question on the page</h3>
<h3 id="if-youre-asking-more-than-one-question-on-the-page">If you’re asking more than one question on the page</h3>
<p>If you’re asking more than one question on the page, do not set the contents of the <code>&lt;legend&gt;</code> as the page heading. Read more about <a href="/patterns/question-pages/#asking-multiple-questions-on-a-page">asking multiple questions on question pages</a>.</p>
<div class="app-example-wrapper" id="checkboxes-without-a-heading-example" data-module="app-tabs">
<div class="app-example app-example--tabs">
Expand Down Expand Up @@ -3013,7 +3013,7 @@ <h3 id="checkbox-items-with-hints">Checkbox items with hints</h3>



<h3 id="add-an-option-for-none-">Add an option for ‘none’</h3>
<h3 id="add-an-option-for-none">Add an option for ‘none’</h3>
<p>When ‘none’ would be a valid answer, give users the option to check a box to say none of the other options apply to them — without this option, users would have to leave all of the boxes unchecked. Giving users this option also makes sure they do not skip the question by accident.</p>
<p>Remember to <a href="/patterns/question-pages/#start-by-asking-one-question-per-page">start by asking one question per page</a>. You might be able to remove the need for a ‘none’ option by asking the user a better question or filtering them out with a ‘filter question’ beforehand. The GOV.UK Service Manual has guidance on <a href="https://www.gov.uk/service-manual/design/designing-good-questions">designing good questions</a>.</p>
<p>Show the ‘none’ option last. Separate it from the other options using a divider. The text is usually the word ‘or’.</p>
Expand Down

0 comments on commit a01fe31

Please sign in to comment.