This repo contains only the JavaScript, CSS/SASS and other assets from the Tech Docs Gem.
It's been built so that those assets can be used from frameworks other than Middleman, such as with the (experimental) GOV.UK MkDocs theme.
Note This repo is experimental, and not used by the Tech Docs Gem. We'll attempt to track changes over there in this repo, but no guarantees.
Everybody who uses this project is encouraged to contribute.
Find out how to contribute.
You'll need to use these assets as part of a build pipeline in another project.
If you want to test changes to the JavaScript or CSS, you can add it as a Git submodule:
For example (from another alphagov
repository)
git submodule add ../tech-docs-assets
npm install ./tech-docs-assets
Otherwise, you can install direct from Github:
npm install git@github.com:alphagov/tech-docs-assets.git
Warning This doesn't bring in the same set of dependencies as installing via a submodule. Further investigation required.
Include the tech docs JavaScript in your website's entry point as follows:
import "tech-docs-assets"
You'll need to set up workflow tasks such as:
- an SCSS step (like this)
- a JavaScript bundling or transpilation step (like this)
- a build step that copies images and other assets into place (like this)
How you do this will depend on the web framework you're using.
Warning JavaScript and CSS relating to full-text search is included in this module, but is completely unused/untested right now.
We aren't packaging these assets in any way right now. When you add the package to your project as described above, your package-lock.json
will be pinned to a specific commit. You can update using npm update
.
This module uses GOV.UK Frontend, part of the GOV.UK Design System.
We use npm
to download the govuk-frontend package
. To update to a new version, change the version in the package.json file and run npm update
.
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.