forked from paulrobertlloyd/barebones
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_patterns.php
More file actions
executable file
·76 lines (73 loc) · 2.39 KB
/
_patterns.php
File metadata and controls
executable file
·76 lines (73 loc) · 2.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<!DOCTYPE html><html lang="en-gb"<?php if(isset($_GET['debug'])) echo ' class="debug"';?>>
<head>
<title>Pattern Primer</title>
<meta charset="utf-8"/>
<link rel="stylesheet" href="_css/reset.css" type="text/css"/>
<link rel="stylesheet" href="_css/patterns.css" type="text/css"/>
<style>
.pattern {
margin:2em 0;
border-top:1px dotted #d0d0d0;
padding:2em 0 1.9375em;
}
.pattern:before, .pattern:after {
content:"";
display:table;
margin-bottom:-1px;
}
.pattern:after {
clear:both;
}
.pattern .display {
width:55%;
float:left;
}
.pattern .source {
width:35%;
float:right;
}
.pattern .source textarea {
font:0.75em/1.5 Menlo,Monaco,'Courier New',Courier,monospace; /* 16px/24px */
width:100%;
}
</style>
</head>
<body>
<h1>Pattern Primer</h1>
<p class="lede">A guide to all the common snippets of markup used throughout the site.</p>
<?php
$files = array();
$patterns_dir = "_patterns";
$handle = opendir($patterns_dir);
while (false !== ($file = readdir($handle))):
if(stristr($file,'.html')):
$files[] = $file;
endif;
endwhile;
sort($files);
foreach ($files as $file):
echo '<div class="pattern">';
echo '<div class="display">';
include($patterns_dir.'/'.$file);
echo '</div>';
echo '<div class="source">';
echo '<textarea rows="10" cols="30">';
echo htmlspecialchars(file_get_contents($patterns_dir.'/'.$file));
echo '</textarea>';
echo '<p><a href="'.$patterns_dir.'/'.$file.'">'.$file.'</a></p>';
echo '</div>';
echo '</div>';
endforeach;
?>
<footer role="contentinfo">
<nav role="navigation">
<ul>
<li><a href="_styleguide.php">Style Guide</a></li>
<li><a href="_patterns.php">Pattern Primer</a></li>
<li><a href="readme.md">Read Me</a></li>
</ul>
</nav>
<p><small>Copyright © 2012 Paul Robert Lloyd. Code covered by the <a rel="license" href="http://paulrobertlloyd.mit-license.org/">MIT license</a>.</small></p>
</footer><!--/.contentinfo-->
</body>
</html>