Coder Social home page Coder Social logo

alphagov / tech-docs-template Goto Github PK

View Code? Open in Web Editor NEW
73.0 78.0 35.0 1010 KB

A template for building technical documentation with a GOV.UK style

Home Page: https://tdt-documentation.london.cloudapps.digital

License: MIT License

Ruby 27.38% HTML 57.50% JavaScript 0.17% Shell 14.14% SCSS 0.81%
tech-docs-template tech-writers cross-gds

tech-docs-template's Introduction

Tech Docs Template

The Tech Docs Template is a Middleman template that you can use to build technical documentation using a GOV.UK style.

This repo is the template used to generate new sites. The generated site uses HTML, CSS, JS and images from the tech docs gem.

You’re welcome to use the template even if your service isn’t considered part of GOV.UK, but your site or service must not:

  • identify itself as being part of GOV.UK
  • use the crown or GOV.UK logotype in the header
  • use the GDS Transport typeface
  • suggest that it’s an official UK government website if it’s not

👉 To find out more about setting up and managing content for a website using this template, see the Tech Docs Template documentation.

Contribute

👉 Find out how to contribute.

Licence

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.

tech-docs-template's People

Contributors

36degrees avatar alext avatar dan-gilbert avatar dependabot[bot] avatar jonathanglassman avatar jonathanhallam avatar lewisnyman avatar lfdebrux avatar m-green avatar matmoore avatar mcmillan avatar nooshu avatar peteryates avatar pgchamberlin avatar philandstuff avatar pipwilson avatar richardtowers avatar thehenster avatar thomasleese avatar tijmenb avatar timblair avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tech-docs-template's Issues

Options for adding search

I've been thinking how to add search. Have come up with 3 or so options.

1. Javascript

We could use lunrjs to do search. It's a lightweight solr-clone in JS.

It would probably work by generating a JSON lunr database on each build. We'd create a frontend that uses lunr to show the search results.

I think this is what https://github.com/manastech/middleman-search is trying to do.

Downsides:

  • It's a lot of javascript that needs to be executed during build phase. You'd need node installed or something?
  • It's probably not accessible, doesn't work without Javascript

2. External service - push

On each build we create a JSON blob with all the content. This is then POSTed to the external service during deploy. This service indexes it, probably in elasticsearch.

If a user searches they'd be redirected to this search service, which serves results. We can have a sprinkle of JS on top that does auto-suggestion and such.

Downsides:

  • This needs authentication, otherwise anybody can post

3. External service - pull

Same as above, but instead of sending the JSON, the service scrapes the HTML of the site. Or pulls in the JSON.

After each deploy, the deploy script would only ping the search service to tell it to refresh.

This looks like what https://www.algolia.com does (used by https://middlemanapp.com)

Downsides:

  • Site may not be in sync with what's deployed, because there's lag between deploy & the indexer

Thoughts?

Logo image has no alt attribute

The code:
<img class="govuk-logo__printable-crown" src="/images/gov.uk_logotype_crown_invert_trans.png" height="32" width="36" style="">

From Siteimprove:

The image does not have an 'alt' attribute (alt="").

It’s important all images have the attribute for alternative text regardless of whether an alternative text is added.

A screen reader knows how to handle both an empty alt attribute and one with a text. If there is no attribute some screen readers will compensate and read the path to the image instead, which will often give no value to the end user.

Create 'Print' function on each section

A finding from user research is that people are interested in printing the document as a pdf. However, they would only want to print out selected sections.

Navigation - restrict a heading from appearing in the left hand nav

We specify the level of headings that appear in the left hand nav of a site through the tech-doc.yaml config file.

Is it possible to add a feature that allows you to restrict a heading from appearing in the left hand nav?

For example, if you specify that h1, h2, and h3 headings appear in the nav, but only want certain h3's to appear. Having them all appear would make the left hand nav too long and user-unfriendly.

Linking to anchors not displayed on ToC doesn't work

Problem:

Trying to follow a link to the anchor of a section that is below the level which is displayed on the left-hand table of contents doesn't work. You are taken to the beginning of the docs instead.

For example:
https://paas-tech-docs.cloudapps.digital/#ip-restrictions should be a valid link. But it's a level 3 header and these docs are configured to show only down to level 2. So following the link doesn't work.

Fix:
Linking to anchors should always work, even if they are not shown on the ToC.

Question about adding Search function for tech-doc-template

Hi,
I'm a Product Manager working over at Ministry of Justice on our Cloud Platform. As part of our new platform we are creating a guide for users based on the tech-docs-template which helps them interact with our platform.

This first iteration works on the basis that users work through the step by step guidance to build their non-production environment and then build, test and deploy their product (or the Test App). They can then add the resources we have made available e.g. Postgres, secrets, S3 etc.

However, the existing guide doesn't allow the users to search for or skip to specifics. You have to work through the detail or have sufficient context to know where some guidance may exists within the guide.

We were wondering what the scope is for adding some search facility to allow users to interact with the guidance in a different way to get more value from it.

Grateful for any suggestions. Many thanks.

Visible focus area of collapsible navigation items are wider than the clickable area

When tabbing through collapsible navigation items:
focusing on a navigation item
focusing on the collapsible action button

The visible focus area of the navigation item is wide enough to include the collapsible button, for a user that is tabbing through the page, it can be unclear that there are two different actions when selecting the navigation item (visits a new page) and the collapsible button (toggles the sub-items)

Width of code blocks

Make sure horizontal scrollbar is always shown on Macs. Investigate button to expand content across the full screen.

Improve distinction between menu items

Cosmetic suggestion.

As well as indenting, it would be great to help distinguish between h2 and h3s in long menus. Perhaps bold or something else? I've attached a pic of the long registers docs menu.
screen shot 2016-12-20 at 15 58 14

Split pages for long documents

User research on the Verify Tech Guide shows that users get to the end of a procedure and carry on scrolling down whereas it would be more appropriate to stop and go to another place in the document.
The process of onboarding with Verify isn't linear. You have to do the same thing in different environments so there is a degree of flitting backwards and forwards in the doc. Users miss this because it's one long page. It would be good to chunk information.

Last list anchors broken on mobile / tablet viewport

Note: Copied this issue from the GDS Way.

To reproduce:

margin-issue

Issue caused here

h3, h4, h5, h6 {
    @include heading-offset($gutter);
  }

Proposed fix:

  1. Either remove usage of the mixin in this case and add specific styling manually (less padding, no negative margin)
  2. Continue to use the mixin but add an override after it's usage

Option 1 seems like the cleanest to me with minimal impact.

Multi-page format - support multiple pages

In recent user testing, the single page format didn't always test well. With further testing, it could be beneficial to support multiple pages. As an example, see the GOV.UK developers or GDS Way implementation of the template.

Maintain the scroll position of the sidebar navigation across new pages

One feedback I received when testing the new multi page navigation was that the scroll position of the sidebar navigation jumps around when you're clicking into different pages. This can disorient people who are browsing content on several pages, as they have to adjust the scroll position to understand their location in the IA.

Something like turbolinks/turbolinks would work, and it would probably speed up page load time. We could also store the scroll position in the browser.

Package template as a gem

One of the challenges in making use of the tech docs template long term and for considering the addition of new features to tech docs is that the tool is packaged as a starting point for your microsite that you diverge from rather than a dependency that you manage. It would be easier to evolve with tech-docs-template if it was packaged in the form of a gem, rather than a middleman template.
Feedback from @kevindew

HTTP with query parameters not rendering properly

This is some Markdown:

```http
GET /records/KIN/entries/ HTTP/1.1
Host: local-authority-eng.register.gov.uk
Accept: application/json
Authorization: YOUR-API-KEY-HERE

Below the bullet point in the image below (as an example) is how it should render, and it does for most of the content:

image

... except for similar content which has query parameters (I am assuming this is what's causing the issue), e.g.:

image

... which has this Markdown:

```http
GET /records/local-authority-type/CTY/?page-index=1&page-size=3 HTTP/1.1 
Host: local-authority-eng.register.gov.uk
Accept: application/json
Authorization: YOUR-API-KEY-HERE

You can see this live at https://docs.registers.service.gov.uk/

Repo is https://github.com/alphagov/registers-tech-docs

Google analytics isn't available on sections

It's useful to have reliable Google analytics on the different sections in a document so we can see which bits of content are working and which aren't. Google analytics will pick up clicks in the navigation panel but this won't give a reliable picture if we're working on the assumption that users will scroll through the doc and use the Ctrl+F function to find content.

Middleman `ruby` process hangs randomly

Middleman hangs on me when I run bundle exec middleman server at seemingly random times. I can't look at http://localhost:4567/ (I'm using the default port) and I can't exit out of the process on the CLI.

I can identify the PID and kill -9 it then rerun bundle exec middleman server, with the same background processes running, and then it'll work, so there doesn't appear to be any pattern.

It might well be my setup but this wasn't happening before the recent updates.

Took a sample of processes (middleman_hang.txt):
middleman_hang.txt

Tables render incorrectly

Submitted by Marian Foley.

Example added:

"line of text

| This | is | a | table |
| some | words | go | here |

line of text

I also tried with a heading line (tried a line of | --- | and a line of | :--- | but neither worked).

This is a table that renders fine on Whitehall publisher. I was wondering if the dev team could check that it works the same in the tech docs tool.

URL: https://www.gov.uk/guidance/set-up-government-email-services-securely

page in whitehall publisher: https://whitehall-admin.publishing.service.gov.uk/government/admin/detailed-guides/745834"

Links - Anchor links

1 page issue - there are a number of items listed on this sheet that could be resolved if we moved away from a one-page format and introduced search functionality (I mention this because my understanding is that we decided to use the one page format partly in response to not having a 'proper' way to search through content). I think this issue might also be resolved that way as there would be less of a need to use anchors if content didn't only live on one long page.

Headings - index.html.md.rb & H1 heading

If your first file in your index.html.md.rb file does not have an H1 heading, it breaks the tool. If you were, for example, to copy some pre-existing markdown files into the documentation folder and they do not have any H1s, and then remove the pre-existing index file from the index.html.md.erb file, then this would happen.

Initial fragment not stored in the browser history

I clicked this link: https://govukpay-docs.cloudapps.digital/#contribute
Then I scrolled up and down, and the fragment in the URL changed.

I was expecting the back button to take me back to where I entered the docs, but the browser showed no page history.

I'm using Chrome Version 59.0.3071.115 (Official Build) (64-bit)

It seems like there is some code to handle this, but I didn't see anything obviously wrong with it https://github.com/alphagov/tech-docs-template/blob/master/template/source/javascripts/_modules/in-page-navigation.js#L43

Scrolling out of sync

If you scroll the main content, the nav doesn't scroll. The highlight moves up and down, but the actual nav doesn't scroll. Need to find a way to keep nav in sync with main viewport.

Reloading browser ignores any anchors in URL in Chrome

If you navigate to a section so that there's an anchor in the URL e.g. http://localhost:4567/#pushing-an-app-to-cloud-foundry-using-jenkins then refresh the browser, the anchor is ignored and you go to the top of the page, even if the URL is the same.

This does not happen with Safari or Firefox, and it doesn't happen if you go directly to the anchor (e.g. by pasting into browser addressbar or following a link). Low priority but potentially confusing for tech writers or docs readers.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.