Skip to content

Commit 35e98db

Browse files
author
[ Cassondra ]
committed
Create a patch branch to pull changes into the stable 1.3.0 version (1.4.0 contained a breaking change)
1 parent 11c1618 commit 35e98db

5 files changed

Lines changed: 272 additions & 213 deletions

File tree

.pk-config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ categories:
2626
- Layout
2727
- Component
2828
- Atom
29+
body_attr:
2930
assets:
3031
css:
3132
js:

CHANGELOG-1.x.md

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,20 @@
1-
## 1.2 Minor style tweaks and functionality additions (2017-03-09)
1+
## 1.3.1 Additional config features (2020-04-28)
22

3-
Tag: [1.2](https://github.com/PatternBuilder/pattern-kit/releases/tag/V1.2)
3+
Tag: [1.3.1](https://github.com/PatternBuilder/pattern-kit/releases/tag/1.3.1)
4+
5+
- Add support for body attributes in the config
6+
- Update documentation
7+
- Update styles for squishy-window indicators for usability
8+
9+
## 1.3.0 Documentation style updates (2017-03-14)
10+
11+
Tag: [1.3.0](https://github.com/PatternBuilder/pattern-kit/releases/tag/1.3.0)
12+
13+
- Add font family, colors, spacing, etc. to styleguide. Cleaned up some extra scrollbars, set a max width on the content area of the docs area.
14+
15+
## 1.2.0 Minor style tweaks and functionality additions (2017-03-09)
16+
17+
Tag: [1.2.0](https://github.com/PatternBuilder/pattern-kit/releases/tag/1.2.0)
418

519
- Change rendering of the styleguide documentation to lean on bootstrap column grid
620
- Add logic to render only the tabs that work for a particular atom based on what data is present
@@ -12,9 +26,9 @@ Tag: [1.2](https://github.com/PatternBuilder/pattern-kit/releases/tag/V1.2)
1226
- Update jQuery package to reference CDN for consistency
1327

1428

15-
## 1.0 support-at-data-and-yaml (2016-08-01)
29+
## 1.1 support-at-data-and-yaml (2016-08-01)
1630

17-
Tag: [1.0](https://github.com/PatternBuilder/pattern-kit/tree/V1.1)
31+
Tag: [1.1](https://github.com/PatternBuilder/pattern-kit/tree/V1.1)
1832

1933
Now supporting YAML files for docs using the same basename as JSON. Also supporting @data to reference other component's doc data file. So @component would import component.docs.json or component.docs.yaml into your data file.
2034

README.md

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Pattern Kit
22

3-
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.
3+
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.
44

5-
For a demo check out [Pattern Kit Demo](http://patternkit.info/sg/).
5+
For a demo check out [Pattern Kit Demo](https://webrh-patternkit.int.open.paas.redhat.com/).
66

77
# Installation
88

@@ -38,6 +38,7 @@ $app['http_cache']->run();
3838
- Create arrays of paths to your data, schema, template, docs and styleguide files (relative to config)
3939
- Set the file extensions for each file type
4040
- List categories in order you'd like them to appear in navigation
41+
- Add any attributes you want printed on the body tag using `body_attr`
4142
- Create arrays of assets for css, js and footer js (including live reload if necessary)
4243

4344
```
@@ -62,11 +63,17 @@ extensions:
6263
docs: .docs.md
6364
sg: .sg.md
6465
categories:
65-
- Pattern
66-
- Sub Pattern
67-
- Layout
68-
- Component
69-
- Atom
66+
- Pattern
67+
- Sub-pattern
68+
- Layout
69+
- Component
70+
- Atom
71+
body_attr:
72+
- unresolved
73+
- id: main
74+
- class:
75+
- foo
76+
- bar
7077
assets:
7178
css:
7279
- path/to/css

resources/templates/basic.twig

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
{% set body_props %}
2+
{%- if app_config.body_attr -%}
3+
{% for attr in app_config.body_attr -%}
4+
{% if attr is iterable -%}
5+
{% for key in attr|keys %}
6+
{% if attr[key] is iterable -%}
7+
{% set items %}
8+
{% for item in attr[key] %} {{ item }}{% endfor %}
9+
{% endset %}
10+
{% elseif attr[key] is same as(false) or attr[key] is same as(true) %}
11+
{% set items = attr[key] ? "true" : "false" %}
12+
{% else %}{% set items = attr[key]|trim %}{% endif %}
13+
{{ key }}="{{ items|trim }}"
14+
{% endfor %}
15+
{% else %} {{ attr }}{% endif %}
16+
{%- endfor %}
17+
{% endif -%}
18+
{% endset -%}
19+
120
<!DOCTYPE html>
221
<html>
322
<head>
@@ -12,7 +31,7 @@
1231
<script type="text/javascript" src="{{js}}"></script>
1332
{% endfor %}
1433
</head>
15-
<body>
34+
<body{{ body_props }}>
1635
<div id="snippet" data-default-overflow="scroll">
1736
{% if (name) or (template) %}
1837
{% include template ?: name ~ '.twig' %}

0 commit comments

Comments
 (0)