Skip to content

Commit 075aeef

Browse files
committed
initial commit
0 parents  commit 075aeef

File tree

8 files changed

+236
-0
lines changed

8 files changed

+236
-0
lines changed

LICENSE

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2015 Brad Frost, http://bradfrostweb.com & Dave Olsen, http://dmolsen.com
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy of
6+
this software and associated documentation files (the "Software"), to deal in
7+
the Software without restriction, including without limitation the rights to
8+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9+
the Software, and to permit persons to whom the Software is furnished to do so,
10+
subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

composer.json

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"name": "pattern-lab/styleguidekit-twig-default",
3+
"description": "The default Twig-based styleguide mark-up and styles for Pattern Lab",
4+
"keywords": ["twig", "pattern lab", "styleguide"],
5+
"homepage": "http://patternlab.io",
6+
"license": "MIT",
7+
"type": "patternlab-styleguidekit",
8+
"authors": [
9+
{
10+
"name": "Dave Olsen",
11+
"email": "[email protected]",
12+
"homepage": "http://dmolsen.com",
13+
"role": "Lead Developer"
14+
},
15+
{
16+
"name": "Brad Frost",
17+
"homepage": "http://bradfrostweb.com",
18+
"role": "Creator"
19+
}
20+
],
21+
"support": {
22+
"issues": "https://github.com/pattern-lab/styleguidekit-twig-default/issues",
23+
"wiki": "http://patternlab.io/docs/",
24+
"source": "https://github.com/pattern-lab/styleguidekit-twig-default/releases"
25+
},
26+
"minimum-stability": "dev",
27+
"require": {
28+
"pattern-lab/styleguidekit-assets-default": "dev-dev"
29+
},
30+
"extra": {
31+
"patternlab": {
32+
"config": [
33+
{ "styleguideKit": "pattern-lab/styleguidekit-twig-default" }
34+
]
35+
}
36+
}
37+
}

views/README

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
There should be no reason to touch these files in day-to-day use.

views/partials/general-footer.twig

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
<script>
2+
var patternData = {{{ patternData }}};
3+
</script>
4+
5+
<script>
6+
/*!
7+
* scriptLoader - v0.1
8+
*
9+
* Copyright (c) 2014 Dave Olsen, http://dmolsen.com
10+
* Licensed under the MIT license
11+
*
12+
*/
13+
14+
var scriptLoader = {
15+
16+
run: function(js,cb,target) {
17+
var s = document.getElementById(target+'-'+cb);
18+
for (var i = 0; i < js.length; i++) {
19+
var src = (typeof js[i] != "string") ? js[i].src : js[i];
20+
var c = document.createElement('script');
21+
c.src = '../../'+src+'?'+cb;
22+
if (typeof js[i] != "string") {
23+
if (js[i].dep !== undefined) {
24+
c.onload = function(dep,cb,target) {
25+
return function() {
26+
scriptLoader.run(dep,cb,target);
27+
}
28+
}(js[i].dep,cb,target);
29+
}
30+
}
31+
s.parentNode.insertBefore(c,s);
32+
}
33+
}
34+
35+
}
36+
</script>
37+
38+
<script id="pl-js-polyfill-insert-{{ cacheBuster }}">
39+
(function() {
40+
if (self != top) {
41+
var cb = '{{ cacheBuster}}';
42+
var js = [];
43+
if (typeof document !== "undefined" && !("classList" in document.documentElement)) {
44+
js.push("styleguide/bower_components/classList.min.js");
45+
}
46+
scriptLoader.run(js,cb,'pl-js-polyfill-insert');
47+
}
48+
})();
49+
</script>
50+
51+
<script id="pl-js-insert-{{ cacheBuster }}">
52+
(function() {
53+
if (self != top) {
54+
var cb = '{{ cacheBuster}}';
55+
var js = [ { "src": "styleguide/bower_components/jwerty.min.js", "dep": [ { "src": "annotations/annotations.js", "dep": [ "styleguide/js/patternlab-pattern.min.js" ] } ] } ];
56+
scriptLoader.run(js,cb,'pl-js-insert');
57+
}
58+
})();
59+
</script>

views/partials/general-header.twig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<!-- never cache patterns -->
2+
<meta http-equiv="cache-control" content="max-age=0" />
3+
<meta http-equiv="cache-control" content="no-cache" />
4+
<meta http-equiv="expires" content="0" />
5+
<meta http-equiv="expires" content="Tue, 01 Jan 1980 1:00:00 GMT" />
6+
<meta http-equiv="pragma" content="no-cache" />
7+
8+
<link rel="stylesheet" href="../../styleguide/css/styleguide.css?{{ cacheBuster }}" media="all">
9+
<link rel="stylesheet" href="../../styleguide/css/styleguide-specific.css?{{ cacheBuster }}" media="all" />
10+

views/partials/patternSection.twig

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
<div id="{{ patternPartial }}" class="sg-pattern">
2+
<div class="sg-pattern-head">
3+
<h3><a href="../../patterns/{{ patternLink }}" class="patternLink" data-patternpartial="{{ patternPartial }}">{{ patternName }}</a></h3>
4+
<div class="sg-pattern-head-actions">
5+
Pattern header options
6+
</div>
7+
</div>
8+
{% if patternDescExists %}
9+
<div class="sg-pattern-desc">
10+
<p>{{{ patternDesc }}}</p>
11+
{% for patternDescAddition in patternDescAdditions %}
12+
{{{ patternDescAddition }}}
13+
{% endfor %}
14+
</div>
15+
{% endif %}
16+
<div class="sg-pattern-example">
17+
{{{ patternPartialCode }}}
18+
</div>
19+
{% for patternExampleAddition in patternExampleAdditions %}
20+
{{{ patternExampleAddition }}}
21+
{% endfor %}
22+
<div class="sg-pattern-extra">
23+
<div class="sg-pattern-extra-annotations" style="display: none">
24+
<span class="sg-pattern-extra-name">Annotations</span>
25+
<div id="sg-pattern-extra-annotations-container">
26+
</div>
27+
</div>
28+
<div class="sg-pattern-extra-html" style="display: none">
29+
<span class="sg-pattern-extra-name">HTML</span>
30+
<pre>
31+
<code id="sg-pattern-extra-html-container">
32+
{{{ patternPartialCodeE }}}
33+
</code>
34+
</pre>
35+
</div>
36+
<div class="sg-pattern-extra-engine" style="display: none">
37+
<span class="sg-pattern-extra-name">{{ patternEngineName }}</span>
38+
<pre>
39+
<code id="sg-pattern-extra-engine-container">
40+
</code>
41+
</pre>
42+
</div>
43+
<div class="sg-pattern-extra-lineage" style="display: none">
44+
<span class="sg-pattern-extra-name">Lineages</span>
45+
{% if patternLineageExists %}
46+
<div class="sg-pattern-extra-lineage">
47+
The <span class="sg-pattern-extra-lineage-name">{{ patternPartial }}</span> pattern contains the following pattern(s):
48+
<ul>
49+
{% for patternLineage in patternLineages %}
50+
<li> <a href="{{ patternLineage.lineagePath }}" class="{% if patternLineage.lineageState %}sg-pattern-state {{ patternLineage.lineageState }} {% endif %}" data-patternpartial="{{ patternLineage.lineagePattern }}">{{ patternLineage.lineagePattern }}</a></li>
51+
{% endfor %}
52+
</ul>
53+
</div>
54+
{% endif %}
55+
{% if patternLineageRExists %}
56+
<div class="sg-pattern-extra-lineage">
57+
The <span class="sg-pattern-extra-lineage-name">{{ patternPartial }}</span> pattern is included in the following pattern(s):
58+
<ul>
59+
{% for patternLineageR in patternLineagesR %}
60+
<li> <a href="{{ patternLineageR.lineagePath }}" class="{% if patternLineageR.lineageState %}sg-pattern-state {{ patternLineageR.lineageState }} {% endif %}" data-patternpartial="{{ patternLineageR.lineagePattern }}">{{ patternLineageR.lineagePattern }}</a></li>
61+
{% endfor %}
62+
</ul>
63+
</div>
64+
{% endif %}
65+
{% if not patternLineageEExists %}
66+
The <span class="sg-pattern-extra-lineage-name">{{ patternPartial }}</span> pattern doesn't have any lineage information.
67+
{% endif %}
68+
</div>
69+
{% if patternCSSExists %}
70+
<div class="sg-pattern-extra-css" style="display: none">
71+
<span class="sg-pattern-extra-name">{{ patternEngineName }}</span>
72+
<pre>
73+
<code id="sg-pattern-extra-engine-container">
74+
{{ patternCSS }}
75+
</code>
76+
</pre>
77+
</div>
78+
{% endif %}
79+
</div>
80+
</div>
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<div id="{{ patternPartial }}" class="sg-subtype">
2+
<h2><a href="../../patterns/{{ patternLink }}" class="patternLink" data-patternpartial="{{ patternPartial }}">{{ patternName }}</a></h2>
3+
<div class="sg-pattern-body">
4+
{{{ patternDesc }}}
5+
</div>
6+
</div>

views/viewall.twig

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
2+
<!-- View All Patterns in a Pattern Sub-Type -->
3+
<div class="sg-main" role="main">
4+
5+
<!-- Patterns -->
6+
<div id="sg-patterns">
7+
{% for partial in partials %}
8+
{% if partial.patternSectionSubtype }}
9+
{% include patternSectionSubtype %}
10+
{% else %}
11+
{% include patternSection %}
12+
{% endif %}
13+
{% endfor %}
14+
</div> <!--end #sg-patterns-->
15+
16+
</div><!--end .sg-main-->
17+
18+
<!-- JS to hook everything together and do annotations -->
19+
<script>
20+
// handle injection of items from builder
21+
var patternPartial = "{{ patternPartial }}";
22+
var lineage = "";
23+
</script>

0 commit comments

Comments
 (0)