This documentation is for government services that want to integrate with GOV.UK One Login to:
- authenticate their users
- verify their users' identity
To preview any changes and additions you have made to the documentation in a browser, clone this repo and use the Dockerfile in this repo to run a Middleman server on your machine without having to set up Ruby locally.
This setup has live reload enabled, which means your changes will be applied as you edit files in the source directory. The only exception to this is if you make changes to config/tech-docs.yml
, you must stop and restart the server to see your changes in the preview. You can stop the server with Ctrl-C
.
Run the helper script:
./preview-with-docker.sh
It may take a few minutes to build the docker container, particularly if it is your first time running the script. When the server has finished loading you should then see the following output in the terminal:
== View your site at "http://localhost:4567", "http://127.0.0.1:4567"
== Inspect your site configuration at "http://localhost:4567/__middleman", "http://127.0.0.1:4567/__middleman"/usr/local/bundle/gems/tilt-2.0.11/lib/tilt/redcarpet.
To add or change content, edit the markdown in the .html.md.erb
files in the source
folder.
Although a single page of HTML is generated, the markdown is spread across multiple files to make it easier to manage.
A new markdown file is not automatically included in the generated output. If you add a new markdown file at the location source/agile/scrum.md
, the following snippet in source/index.html.md.erb
will include it in the generated output.
<%= partial 'documentation/scrum' %>
Including files manually like this enables you to specify the position they appear on the page.
The sections in the documentation are controlled by the use of markdown headers, not the file structure.
Images to be included in the docs are kept in source/images
In order to configure some aspects of layout, like the header, edit config/tech-docs.yml
.
If you move pages around and URLs change, make sure you set up redirects from the old URLs to the new URLs.
Edit the draw.io files in the source/images/originals
folder by installing and using the draw.io desktop app.
Use one draw.io file per diagram.
Run the following commands to use the draw.io desktop app from the command line.
brew install --cask drawio
alias draw.io='/Applications/draw.io.app/Contents/MacOS/draw.io'
Follow these steps:
- Create and modify a diagram using draw.io.
- Save the draw.io file to the
source/images/originals
folder. - Publish the diagram as a scalable vector graphic (SVG).
- Save the SVG file to the
source/images
folder.
Update a diagram:
draw.io source/images/originals/top-level-technical-diagram.drawio
Generate SVG versions of the diagrams and save them to the source/images/originals
folder:
draw.io -x -o source/images/top-level-technical-diagram.svg source/images/originals/top-level-technical-diagram.drawio
draw.io -x -o source/images/technical-flow-diagram.svg source/images/originals/technical-flow-diagram.drawio
This repository uses Vale and the GDS Tech Docs Linter ruleset.
You need to:
Many code editors provide extensions or plugins for Vale which can raise errors as you update documentation. You will still need Vale installed on your local machine.
By default, Vale must be run from the same directory as this config file, unless the --config
flag is provide with a path.
To run the linter using Vale CLI:
- In a terminal window, navigate to your repo.
- Run
vale sync
to download the latest tech-docs-linter package and unzip this to yourStylesPath
listed in your config file. - Run the command
vale .
to lint the entire repo or provide a path to a directory to lint only that directory for example:vale ./source/go-live
If a new rule is added to the tech docs linter ruleset, you can upversion the package used by this repo when you're ready. A later version of the ruleset can be tested and added by:
- Create a branch.
- Update the package version number in the Vale config file.
- Run
vale sync
to download and unzip the latest package. - Run
vale ./source
to test the linter. - Fix any changes new ruleset throws up (preferably one commit for each rule violation).
- Raise a PR with the latest version number in the vale config file.
Please refer to the alphagov
code of conduct.
Unless stated otherwise, the codebase is released under the MIT License. This covers both the codebase and any sample code in the documentation.
The documentation is © Crown copyright and available under the terms of the Open Government 3.0 licence.