From 73c7af4f247070d3522cfbdc9e8588dfc7fb80db Mon Sep 17 00:00:00 2001 From: Stuart Colville Date: Mon, 27 Apr 2015 16:48:17 +0100 Subject: [PATCH] Basic styleguide setup --- .gitignore | 1 + Gruntfile.js | 54 +++++++++++++++++++++++ package.json | 2 + styleguide/pages/forms.md | 3 ++ styleguide/pages/index.md | 3 ++ styleguide/pages/typography.md | 3 ++ styleguide/templates/base-styleguide.html | 14 ++++++ styleguide/templates/forms.html | 13 ++++++ styleguide/templates/typography.html | 12 +++++ templates/base.html | 0 tests/.gitkeep | 0 11 files changed, 105 insertions(+) create mode 100644 Gruntfile.js create mode 100644 styleguide/pages/forms.md create mode 100644 styleguide/pages/index.md create mode 100644 styleguide/pages/typography.md create mode 100644 styleguide/templates/base-styleguide.html create mode 100644 styleguide/templates/forms.html create mode 100644 styleguide/templates/typography.html create mode 100644 templates/base.html create mode 100644 tests/.gitkeep diff --git a/.gitignore b/.gitignore index a48c762..f0d64e2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ node_modules bower_components .grunt +styleguide/build diff --git a/Gruntfile.js b/Gruntfile.js new file mode 100644 index 0000000..f3bc11b --- /dev/null +++ b/Gruntfile.js @@ -0,0 +1,54 @@ +module.exports = function(grunt) { + + grunt.initConfig({ + + jshint: { + options: { + jshintrc: true, + }, + all: ['public/**/*.js', 'test/**/*.js'], + }, + + devserver: { + options: { + base: 'styleguide/build', + type: 'http', + port: grunt.option('port') || 4000, + }, + server: {} + }, + + 'gh-pages': { + options: { + base: 'styleguide/build', + message: 'Updating docs' + }, + src: ['**'] + }, + + // Styleguide builder task. + cog: { + styleguide: { + src: 'styleguide', + options: { + sourcecodeSelector: 'main', + templateGlobals: { + 'projectName': 'Payments UI Styleguide', + }, + templateConfig: { + templatePaths: ['templates'], + } + } + } + } + + }); + + grunt.loadNpmTasks('cog'); + grunt.loadNpmTasks('grunt-contrib-jshint'); + grunt.loadNpmTasks('grunt-devserver'); + grunt.loadNpmTasks('grunt-gh-pages'); + + grunt.registerTask('default', ['jshint']); + grunt.registerTask('publish-docs', ['cog', 'gh-pages']); +}; diff --git a/package.json b/package.json index 76905a5..c89a78b 100644 --- a/package.json +++ b/package.json @@ -9,8 +9,10 @@ "grunt-sass": "^0.18.1" }, "devDependencies": { + "cog": "muffinresearch/cog", "grunt": "^0.4.5", "grunt-contrib-jshint": "^0.11.2", + "grunt-devserver": "^0.6.0", "grunt-sass": "^0.18.1" }, "scripts": { diff --git a/styleguide/pages/forms.md b/styleguide/pages/forms.md new file mode 100644 index 0000000..d496356 --- /dev/null +++ b/styleguide/pages/forms.md @@ -0,0 +1,3 @@ +# Forms + +Here's some examples of the form fields used in the payments UI. diff --git a/styleguide/pages/index.md b/styleguide/pages/index.md new file mode 100644 index 0000000..64ffd63 --- /dev/null +++ b/styleguide/pages/index.md @@ -0,0 +1,3 @@ +# Payment UI + +This is the styleguide for the payments UI. diff --git a/styleguide/pages/typography.md b/styleguide/pages/typography.md new file mode 100644 index 0000000..e7e338d --- /dev/null +++ b/styleguide/pages/typography.md @@ -0,0 +1,3 @@ +# Typography + +This is an example of what the fonts look like using some basic markup. diff --git a/styleguide/templates/base-styleguide.html b/styleguide/templates/base-styleguide.html new file mode 100644 index 0000000..8401c45 --- /dev/null +++ b/styleguide/templates/base-styleguide.html @@ -0,0 +1,14 @@ + + + + + + + Payments + + +
+ {% block page %}{% endblock %} +
+ + diff --git a/styleguide/templates/forms.html b/styleguide/templates/forms.html new file mode 100644 index 0000000..ab2ffd6 --- /dev/null +++ b/styleguide/templates/forms.html @@ -0,0 +1,13 @@ +{% extends 'base-styleguide.html' %} + +{% block page %} +
+ + + + + + + +
+{% endblock %} diff --git a/styleguide/templates/typography.html b/styleguide/templates/typography.html new file mode 100644 index 0000000..3399d7d --- /dev/null +++ b/styleguide/templates/typography.html @@ -0,0 +1,12 @@ +{% extends 'base-styleguide.html' %} + +{% block page %} +

Heading Level 1

+

Heading Level 2

+

Heading Level 3

+

Heading Level 4

+ +

The quick brown fox jumps over the lazy dog

+

The quick brown fox jumps over the lazy dog (emphasis)

+

The quick brown fox jumps over the lazy dog (strong)

+{% endblock %} diff --git a/templates/base.html b/templates/base.html new file mode 100644 index 0000000..e69de29 diff --git a/tests/.gitkeep b/tests/.gitkeep new file mode 100644 index 0000000..e69de29