Skip to content

Commit ec1bd1a

Browse files
committed
added pattern_kit README
1 parent dec3a82 commit ec1bd1a

File tree

3 files changed

+109
-1
lines changed

3 files changed

+109
-1
lines changed

Makefile

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
1+
.PHONY: build
2+
build:
3+
@rm docs/pattern_kit.md
4+
@echo "---" > docs/pattern_kit.md
5+
@echo "title: Pattern Kit" >> docs/pattern_kit.md
6+
@echo "---" >> docs/pattern_kit.md
7+
@echo "INFO - Downloading Pattern Kit README.md ..."
8+
@curl --progress-bar -L "https://raw.githubusercontent.com/PatternBuilder/pattern-kit/master/README.md" >> docs/pattern_kit.md
9+
@mkdocs build --clean
10+
111
.PHONY: deploy
212
deploy:
313
@read -p "This will deploy your current code to http://patternbuilder.github.io/. Press ENTER to continue..."
4-
14+
@make build
515
@mkdocs gh-deploy -b master

docs/pattern_kit.md

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
---
2+
title: Pattern Kit
3+
---
4+
# Pattern Kit
5+
6+
Pattern Kit is an application that lets you preview your library of templates and manipulate their content by interacting with a form built from the schemas. It is both a development tool and a public facing pattern library.
7+
8+
For a demo check out [Pattern Kit Demo](http://patternkit.info/sg/).
9+
10+
# Installation
11+
12+
Note, by following these instructions you do _not_ need to clone this git repository.
13+
14+
## Create composer.json at pattern library root and require pattern kit
15+
16+
```
17+
"require": {
18+
"pattern-builder/pattern-kit": "@dev"
19+
},
20+
"repositories": [
21+
{
22+
"type": "vcs",
23+
"url": "https://github.com/PatternBuilder/pattern-kit"
24+
}
25+
]
26+
```
27+
28+
## Add index.php at pattern library root
29+
```
30+
<?php
31+
32+
require_once __DIR__ . '/vendor/autoload.php';
33+
require __DIR__ . '/vendor/pattern-builder/pattern-kit/src/app.php';
34+
35+
$app['http_cache']->run();
36+
37+
```
38+
39+
## Add .pk-config.yml at pattern library root
40+
41+
- Create arrays of paths to your data, schema, template, docs and styleguide files (relative to config)
42+
- Set the file extensions for each file type
43+
- List categories in order you'd like them to appear in navigation
44+
- Create arrays of assets for css, js and footer js (including live reload if necessary)
45+
46+
```
47+
48+
title: Project Title
49+
50+
paths: # relative to your pattern library root
51+
data:
52+
- path/to/sample/data
53+
schemas:
54+
- path/to/schemas
55+
templates:
56+
- path/to/templates
57+
docs:
58+
- path/to/schemas-docs
59+
sg:
60+
- path/to/stylelguide/docs
61+
extensions:
62+
data: .docs.json
63+
schemas: .json
64+
templates: .twig
65+
docs: .docs.md
66+
sg: .sg.md
67+
categories:
68+
- Pattern
69+
- Sub Pattern
70+
- Layout
71+
- Component
72+
- Atom
73+
assets:
74+
css:
75+
- path/to/css
76+
- path/to/othercss
77+
js:
78+
- path/to/js
79+
- path/to/otherjs
80+
footer_js:
81+
- path/to/footer_js
82+
- path/to/otherfooter_js
83+
- //localhost:1336/livereload.js
84+
```
85+
86+
In your terminal,
87+
88+
```
89+
$ cd [pattern library root]
90+
$ composer install
91+
```
92+
93+
# Use Pattern Kit
94+
95+
Point MAMP or local PHP server at your index.php file
96+
97+
php -S 0:9001 -t ./

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ site_name: Pattern Builder
22

33
pages:
44
- Home: index.md
5+
- Pattern Kit: pattern_kit.md
56
- PHP Library: pattern_builder_library.md
67
- Drupal Module: pattern_builder_module.md
78
- Drupal Schema Importer: pattern_builder_importer.md

0 commit comments

Comments
 (0)