-
Notifications
You must be signed in to change notification settings - Fork 236
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create demo app and move documentation to sub-app #244
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
39747e7
First pass at creating separate documentation app
edwardhorsford 5c1ad2f
Add config to enable/disable docs and promo mode
edwardhorsford 95fed51
Add install page and ability to get zip of latest release
edwardhorsford 1e18201
Move examples to /docs, create about and community pages
edwardhorsford e1e98dd
Render markdown files as html, style them
edwardhorsford 34e7017
Set up auto-routing for markdown files
edwardhorsford 4156a7e
Minor text tweaks, rename nav, update tutorials page with links
edwardhorsford 38170c4
Run standard --fix for Standard JS linting
gemmaleigh 68dbbea
Link to individual tutorial pages instead of start
edwardhorsford 2f56c53
Minor style tweaks and fixing other errors after PR review
edwardhorsford e0193d5
Fix link to kit requirements page in docs
cd45614
Make docs more separate from the rest of the app
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,11 @@ | ||
var express = require('express') | ||
var router = express.Router() | ||
|
||
// Route index page | ||
router.get('/', function (req, res) { | ||
res.render('index') | ||
}) | ||
|
||
// Example routes - feel free to delete these | ||
|
||
// Passing data into a page | ||
|
||
router.get('/examples/template-data', function (req, res) { | ||
res.render('examples/template-data', { 'name': 'Foo' }) | ||
}) | ||
|
||
// Branching | ||
|
||
router.get('/examples/over-18', function (req, res) { | ||
// get the answer from the query string (eg. ?over18=false) | ||
var over18 = req.query.over18 | ||
|
||
if (over18 === 'false') { | ||
// redirect to the relevant page | ||
res.redirect('/examples/under-18') | ||
} else { | ||
// if over18 is any other value (or is missing) render the page requested | ||
res.render('examples/over-18') | ||
} | ||
}) | ||
|
||
// add your routes here | ||
|
||
module.exports = router |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes
File renamed without changes
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* global $ */ | ||
/* global GOVUK */ | ||
|
||
// Warn about using the kit in production | ||
if ( | ||
window.sessionStorage && window.sessionStorage.getItem('prototypeWarning') !== 'false' && | ||
window.console && window.console.info | ||
) { | ||
window.console.info('GOV.UK Prototype Kit - do not use for production') | ||
window.sessionStorage.setItem('prototypeWarning', true) | ||
} | ||
|
||
$(document).ready(function () { | ||
// Use GOV.UK selection-buttons.js to set selected | ||
// and focused states for block labels | ||
var $blockLabels = $(".block-label input[type='radio'], .block-label input[type='checkbox']") | ||
new GOVUK.SelectionButtons($blockLabels) // eslint-disable-line | ||
|
||
// Use GOV.UK shim-links-with-button-role.js to trigger a link styled to look like a button, | ||
// with role="button" when the space key is pressed. | ||
GOVUK.shimLinksWithButtonRole.init() | ||
|
||
// Show and hide toggled content | ||
// Where .block-label uses the data-target attribute | ||
// to toggle hidden content | ||
var showHideContent = new GOVUK.ShowHideContent() | ||
showHideContent.init() | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
@import "govuk-elements"; | ||
|
||
.markdown { | ||
h1 { | ||
@extend .heading-xlarge; | ||
} | ||
|
||
h2 { | ||
@extend .heading-large; | ||
} | ||
|
||
h3 { | ||
@extend .heading-medium; | ||
} | ||
|
||
h4 { | ||
@extend .heading-small; | ||
} | ||
|
||
code { | ||
background: $grey-4; | ||
padding: 3px; | ||
font-size: 1em; | ||
} | ||
|
||
pre > code { | ||
@extend .code; | ||
display: block; | ||
@extend .panel; | ||
@extend .panel-border-wide; | ||
margin-bottom: 15px; | ||
} | ||
|
||
img { | ||
max-width: 100%; | ||
} | ||
|
||
ul { | ||
@extend .list; | ||
@extend .list-bullet; | ||
} | ||
|
||
blockquote { | ||
@extend .panel; | ||
@extend .panel-border-wide; | ||
} | ||
|
||
strong { | ||
font-weight: 700; | ||
} | ||
} | ||
|
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can't remember who wrote this originally, but why isnt the code block just
@extend .code
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure, but you need the other things for it to display correctly I think. I'm still not happy with the code styling though.