Skip to content

Commit 7c91272

Browse files
authored
Merge pull request #313 from camchenry/main
Refactor site into layouts
2 parents c38df29 + dc222a1 commit 7c91272

14 files changed

+1510
-4142
lines changed

docs/.eleventy.js

+11
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,17 @@ module.exports = function (eleventyConfig) {
66
eleventyConfig.addPassthroughCopy("vendor");
77
eleventyConfig.addPassthroughCopy("favicon.ico");
88

9+
eleventyConfig.setServerOptions({
10+
// Opt-out of the live reload snippet
11+
enabled: true,
12+
// Opt-out of DOM diffing updates and use page reloads
13+
domdiff: true,
14+
// The starting port number to attempt to use
15+
port: 8080,
16+
// Show the server version number on the command line
17+
showVersion: true,
18+
});
19+
920
return {
1021
// Control which files Eleventy will process
1122
// e.g.: *.md, *.njk, *.html, *.liquid

docs/_includes/base-layout.html

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8" />
5+
<meta name="copyright" content="Copyright &copy; 2022 The Peggy Authors" />
6+
<meta name="keywords" content="parser generator, PEG, JavaScript, PEG.js" />
7+
<meta
8+
name="description"
9+
content="Peggy is a parser generator for JavaScript based on the parsing expression grammar formalism."
10+
/>
11+
<title>{% if title %}{{ title }} &raquo; {% endif %}Peggy &ndash; Parser Generator for JavaScript</title>
12+
<link rel="stylesheet" href="{{ "/css/common.css" | url }}" />
13+
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
14+
{% if stylesheets %}
15+
{% for stylesheet in stylesheets %}
16+
<link rel="stylesheet" href="{{ stylesheet | url }}" />
17+
{% endfor %}
18+
{% endif %}
19+
{% if scripts %}
20+
{% for script in scripts %}
21+
<script src="{{ script | url }}"></script>
22+
{% endfor %}
23+
{% endif %}
24+
</head>
25+
<body>
26+
{{content}}
27+
</body>
28+
</html>

docs/_includes/components/footer.html

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<footer id="footer">
2+
Copyright &copy; 2022
3+
<a href="https://github.com/peggyjs/peggy/blob/main/AUTHORS"
4+
>The Peggy Authors</a
5+
>
6+
&bull;
7+
<a href="https://github.com/peggyjs/peggy">Source code</a>
8+
</footer>

docs/_includes/components/header.html

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<header id="header">
2+
<h1><a href="#main">Peggy</a></h1>
3+
<h2>Parser Generator for JavaScript</h2>
4+
</header>
5+
6+
<nav id="menu">
7+
<a {% if page.url == "/" %} aria-current="page" class="current" {% endif %} href="{{ "/index.html" | url }}">Home</a>
8+
<a {% if page.url == "/online.html" %} aria-current="page" class="current" {% endif %} href="{{ "/online.html" | url }}">Online Version</a>
9+
<a {% if page.url == "/documentation.html" %} aria-current="page" class="current" {% endif %} href="{{ "/documentation.html" | url }}">Documentation</a>
10+
<a {% if page.url contains "/development" %} aria-current="page" class="current" {% endif %} href="{{ "/development/index.html" | url }}">Development</a>
11+
</nav>

docs/_includes/main-layout.html

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
layout: base-layout
3+
stylesheets: ["/css/layout-default.css", "/css/content.css"]
4+
---
5+
<div id="main">
6+
{% include 'components/header.html' %}
7+
8+
<div id="content">{{content}}</div>
9+
10+
{% include 'components/footer.html' %}
11+
</div>

docs/css/documentation.css

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
.example {
2+
background-color: #f0f0f0;
3+
display: flex;
4+
flex-direction: row;
5+
padding: 0.25em 0.5em;
6+
margin: 0.5em;
7+
border-radius: 0.5em;
8+
}
9+
.example .result {
10+
font-family: monospace;
11+
white-space: pre-wrap;
12+
margin-left: 5px;
13+
}
14+
.example .try {
15+
margin-left: 30px;
16+
}
17+
.error {
18+
color: red;
19+
}

docs/development/benchmark.html

+30-79
Original file line numberDiff line numberDiff line change
@@ -1,82 +1,33 @@
11
---
2-
permalink: '/development/benchmark.html'
2+
title: 'Benchmark'
3+
permalink: "/development/benchmark.html"
4+
layout: main-layout
5+
stylesheets: ["/css/benchmark.css"]
6+
scripts:
7+
[
8+
"https://unpkg.com/[email protected]/dist/jquery.min.js",
9+
"https://unpkg.com/[email protected]/jquery.scrollTo.min.js",
10+
]
311
---
412

5-
<!DOCTYPE html>
6-
<html>
7-
8-
<head>
9-
<meta charset="utf-8">
10-
<meta name="copyright" content="Copyright &copy; 2022 The Peggy Authors">
11-
<meta name="keywords" content="parser generator, PEG, JavaScript, PEG.js">
12-
<meta name="description" content="Peggy is a parser generator for JavaScript based on the parsing expression grammar formalism.">
13-
<title>Benchmark &raquo; Peggy &ndash; Parser Generator for JavaScript</title>
14-
<link rel="stylesheet" href="../css/common.css">
15-
<link rel="stylesheet" href="../css/layout-default.css">
16-
<link rel="stylesheet" href="../css/content.css">
17-
<link rel="shortcut icon" href="../favicon.ico" type="image/x-icon">
18-
<!--[if IE]>
19-
<script>
20-
var html5elements = ["aside", "footer", "header", "nav"];
21-
for (var i = 0; i < html5elements.length; i++) {
22-
document.createElement(html5elements[i]);
23-
}
24-
</script>
25-
<![endif]-->
26-
27-
</head>
28-
29-
<body>
30-
<div id='main'>
31-
<header id="header">
32-
<h1><a href="../index.html">Peggy</a></h1>
33-
<h2>Parser Generator for JavaScript</h2>
34-
</header>
35-
36-
<nav id="menu">
37-
<a href="../index.html">Home</a>
38-
<a href="../online.html">Online Version</a>
39-
<a href="../documentation.html">Documentation</a>
40-
<a href="index.html">Development</a>
41-
</nav>
42-
43-
<div id="content">
44-
45-
46-
47-
<link rel="stylesheet" href="../css/benchmark.css">
48-
49-
<div id="options">
50-
<label for="run-count">Run each test</label>
51-
<input type="text" id="run-count" value="10"> times
52-
<input type="checkbox" id="cache">
53-
<label for="cache">Use results cache</label>
54-
<input type="button" id="run" value="Run">
55-
</div>
56-
57-
<table id="results-table">
58-
<tr class="columns">
59-
<th>Test</th>
60-
<th>Input Size</th>
61-
<th>Average Parse Time</th>
62-
<th>Average Parse Speed</th>
63-
</tr>
64-
<tr>
65-
<td class="no-results" colspan="4">No results available yet.</td>
66-
</tr>
67-
</table>
68-
69-
<script src="https://unpkg.com/[email protected]/dist/jquery.min.js"></script>
70-
<script src="https://unpkg.com/[email protected]/jquery.scrollTo.min.js"></script>
71-
<script src="../js/benchmark-bundle.min.js"></script>
72-
</div>
73-
74-
<footer id="footer">
75-
Copyright &copy; 2022 <a href="https://github.com/peggyjs/peggy/blob/main/AUTHORS">The Peggy Authors</a>
76-
&bull;
77-
<a href="https://github.com/peggyjs/peggy">Source code</a>
78-
</footer>
79-
</div>
80-
</body>
81-
82-
</html>
13+
<script defer src="/js/benchmark-bundle.min.js"></script>
14+
15+
<div id="options">
16+
<label for="run-count">Run each test</label>
17+
<input type="text" id="run-count" value="10" /> times
18+
<input type="checkbox" id="cache" />
19+
<label for="cache">Use results cache</label>
20+
<input type="button" id="run" value="Run" />
21+
</div>
22+
23+
<table id="results-table">
24+
<tr class="columns">
25+
<th>Test</th>
26+
<th>Input Size</th>
27+
<th>Average Parse Time</th>
28+
<th>Average Parse Speed</th>
29+
</tr>
30+
<tr>
31+
<td class="no-results" colspan="4">No results available yet.</td>
32+
</tr>
33+
</table>

docs/development/index.html

+30-82
Original file line numberDiff line numberDiff line change
@@ -1,86 +1,34 @@
11
---
2+
title: 'Development'
23
permalink: '/development/index.html'
4+
layout: main-layout
35
---
46

5-
<!DOCTYPE html>
6-
<html>
7-
8-
<head>
9-
<meta charset="utf-8">
10-
<meta name="copyright" content="Copyright &copy; 2022 The Peggy Authors">
11-
<meta name="keywords" content="parser generator, PEG, JavaScript, PEG.js">
12-
<meta name="description" content="Peggy is a parser generator for JavaScript based on the parsing expression grammar formalism.">
13-
<title>Development &raquo; Peggy &ndash; Parser Generator for JavaScript</title>
14-
<link rel="stylesheet" href="../css/common.css">
15-
<link rel="stylesheet" href="../css/layout-default.css">
16-
<link rel="stylesheet" href="../css/content.css">
17-
<link rel="shortcut icon" href="../favicon.ico" type="image/x-icon">
18-
<!--[if IE]>
19-
<script>
20-
var html5elements = ["aside", "footer", "header", "nav"];
21-
for (var i = 0; i < html5elements.length; i++) {
22-
document.createElement(html5elements[i]);
23-
}
24-
</script>
25-
<![endif]-->
26-
27-
</head>
28-
29-
<body>
30-
<div id='main'>
31-
<header id="header">
32-
<h1><a href="../index.html">Peggy</a></h1>
33-
<h2>Parser Generator for JavaScript</h2>
34-
</header>
35-
36-
<nav id="menu">
37-
<a href="../index.html">Home</a>
38-
<a href="../online.html">Online Version</a>
39-
<a href="../documentation.html">Documentation</a>
40-
<a class="current" href="index.html">Development</a>
41-
</nav>
42-
43-
<div id="content">
44-
45-
46-
47-
<h1>Development</h1>
48-
49-
<ul>
50-
<li><a href="https://github.com/peggyjs/peggy/wiki">Wiki</a></li>
51-
<li><a href="https://github.com/peggyjs/peggy">Source code</a></li>
52-
<li><a href="benchmark.html">Benchmark Suite</a></li>
53-
<li><a href="test.html">Test Suite</a></li>
54-
<li><a href="../online.html">Try Development Version online</a></li>
55-
<li><a href="https://github.com/peggyjs/peggy/issues">Issue tracker</a></li>
56-
<li><a href="https://groups.google.com/group/pegjs">Google Group</a></li>
57-
</ul>
58-
59-
<p>Starting in April 2021, Peggy has been maintained by
60-
<a href="https://github.com/hildjj">Joe Hildebrand</a>
61-
(<a href="https://twitter.com/hildjj/">@hildjj</a>). It was previously
62-
known as <a href="https://github.com/pegjs/pegjs">PEG.js</a>, but had
63-
fallen into <a href="https://github.com/pegjs/pegjs/issues/639">limbo</a>
64-
before a community-desired fork.</p>
65-
66-
<p>Since its <a href="https://www.google.com/search?q=inception&plus;meaning">inception</a>
67-
in 2010, PEG.js was maintained by <a href="https://majda.cz/">David Majda</a>
68-
(<a href="https://twitter.com/dmajda">@dmajda</a>),
69-
until <a href="https://github.com/pegjs/pegjs/issues/503">May 2017</a>
70-
when <a href="https://github.com/futagoza">Futago-za Ryuu</a> took over.</p>
71-
72-
<p>You are welcome to contribute code. Unless your contribution is really
73-
trivial you should <a href="https://github.com/peggyjs/peggy/discussions">get in touch with us</a>
74-
first &mdash; this can prevent wasted effort on both sides.</p>
75-
76-
</div>
77-
78-
<footer id="footer">
79-
Copyright &copy; 2022 <a href="https://github.com/peggyjs/peggy/blob/main/AUTHORS">The Peggy Authors</a>
80-
&bull;
81-
<a href="https://github.com/peggyjs/peggy">Source code</a>
82-
</footer>
83-
</div>
84-
</body>
85-
86-
</html>
7+
<h1>Development</h1>
8+
9+
<ul>
10+
<li><a href="https://github.com/peggyjs/peggy/wiki">Wiki</a></li>
11+
<li><a href="https://github.com/peggyjs/peggy">Source code</a></li>
12+
<li><a href="benchmark.html">Benchmark Suite</a></li>
13+
<li><a href="test.html">Test Suite</a></li>
14+
<li><a href="../online.html">Try Development Version online</a></li>
15+
<li><a href="https://github.com/peggyjs/peggy/issues">Issue tracker</a></li>
16+
<li><a href="https://groups.google.com/group/pegjs">Google Group</a></li>
17+
</ul>
18+
19+
<p>Starting in April 2021, Peggy has been maintained by
20+
<a href="https://github.com/hildjj">Joe Hildebrand</a>
21+
(<a href="https://twitter.com/hildjj/">@hildjj</a>). It was previously
22+
known as <a href="https://github.com/pegjs/pegjs">PEG.js</a>, but had
23+
fallen into <a href="https://github.com/pegjs/pegjs/issues/639">limbo</a>
24+
before a community-desired fork.</p>
25+
26+
<p>Since its <a href="https://www.google.com/search?q=inception&plus;meaning">inception</a>
27+
in 2010, PEG.js was maintained by <a href="https://majda.cz/">David Majda</a>
28+
(<a href="https://twitter.com/dmajda">@dmajda</a>),
29+
until <a href="https://github.com/pegjs/pegjs/issues/503">May 2017</a>
30+
when <a href="https://github.com/futagoza">Futago-za Ryuu</a> took over.</p>
31+
32+
<p>You are welcome to contribute code. Unless your contribution is really
33+
trivial you should <a href="https://github.com/peggyjs/peggy/discussions">get in touch with us</a>
34+
first &mdash; this can prevent wasted effort on both sides.</p>

0 commit comments

Comments
 (0)