Skip to content

Commit 976ea40

Browse files
authored
Major website rewrite (#5)
2 parents 29f5a29 + ce23da4 commit 976ea40

File tree

83 files changed

+7387
-1076
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+7387
-1076
lines changed

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ gem "just-the-docs", "0.12.0"
55

66
group :jekyll_plugins do
77
gem 'jekyll-katex'
8+
gem 'jekyll-redirect-from'
89
end

Gemfile.lock

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ GEM
6161
jekyll-katex (1.0.0)
6262
execjs (~> 2.7)
6363
jekyll (>= 3.6, < 5.0)
64+
jekyll-redirect-from (0.16.0)
65+
jekyll (>= 3.3, < 5.0)
6466
jekyll-sass-converter (3.1.0)
6567
sass-embedded (~> 1.75)
6668
jekyll-seo-tag (2.8.0)
@@ -116,6 +118,7 @@ PLATFORMS
116118
DEPENDENCIES
117119
jekyll (~> 4.4)
118120
jekyll-katex
121+
jekyll-redirect-from
119122
just-the-docs (= 0.12.0)
120123

121124
BUNDLED WITH

_config.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@ aux_links:
99

1010
plugins:
1111
- jekyll-katex
12+
- jekyll-redirect-from
13+
14+
sass:
15+
quiet_deps: true
16+
silence_deprecations:
17+
- color-functions
18+
- global-builtin
19+
- import
1220

1321
callouts:
1422
highlight:

_data/linear_sequence.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Ordered reading sequence for the "Getting Started" linear path of the manual.
2+
# Only pages using `layout: linear` will show prev/next navigation, and they
3+
# must appear in this list for the links to resolve. Order here is the order
4+
# in which readers are expected to move through the pages.
5+
- manual/installation.md
6+
- manual/tutorial/index.md
7+
- manual/tutorial/hello-frog.md
8+
- manual/tutorial/otp-ots.md
9+
- manual/worked-examples/index.md
10+
- manual/worked-examples/chained-encryption.md
11+
- manual/worked-examples/kemdem-cpa.md

_includes/head_custom.html

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,45 @@
11
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/katex.min.css" integrity="sha384-zB1R0rpPzHqg7Kpt0Aljp8JPLqbXI3bhnPWROx27a9N0Ll6ZP/+DiW/UqRcLbRjq" crossorigin="anonymous">
2-
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.29.0/prism.min.js"></script>
3-
<script src="{{ '/assets/js/prism-prooffrog.js' | relative_url }}"></script>
2+
3+
<style>
4+
img.lightbox { cursor: zoom-in; }
5+
.lightbox-overlay {
6+
position: fixed; inset: 0;
7+
background: rgba(0, 0, 0, 0.85);
8+
display: flex; align-items: center; justify-content: center;
9+
z-index: 9999; cursor: zoom-out;
10+
opacity: 0; transition: opacity 0.15s ease;
11+
}
12+
.lightbox-overlay.visible { opacity: 1; }
13+
.lightbox-overlay img {
14+
max-width: 95vw; max-height: 95vh;
15+
box-shadow: 0 4px 32px rgba(0, 0, 0, 0.5);
16+
}
17+
</style>
18+
19+
<script>
20+
document.addEventListener('DOMContentLoaded', function () {
21+
var overlay = null;
22+
function close() {
23+
if (!overlay) return;
24+
overlay.classList.remove('visible');
25+
var o = overlay; overlay = null;
26+
setTimeout(function () { if (o.parentNode) o.parentNode.removeChild(o); }, 150);
27+
document.removeEventListener('keydown', onKey);
28+
}
29+
function onKey(e) { if (e.key === 'Escape') close(); }
30+
document.querySelectorAll('img.lightbox').forEach(function (img) {
31+
img.addEventListener('click', function () {
32+
overlay = document.createElement('div');
33+
overlay.className = 'lightbox-overlay';
34+
var big = document.createElement('img');
35+
big.src = img.currentSrc || img.src;
36+
big.alt = img.alt;
37+
overlay.appendChild(big);
38+
overlay.addEventListener('click', close);
39+
document.body.appendChild(overlay);
40+
requestAnimationFrame(function () { overlay.classList.add('visible'); });
41+
document.addEventListener('keydown', onKey);
42+
});
43+
});
44+
});
45+
</script>

_includes/prev_next.html

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
{%- comment -%}
2+
Renders previous/next navigation for the linear reading path of the manual.
3+
Used by _layouts/linear.html. Sequence is defined in _data/linear_sequence.yml.
4+
Finds the current page by matching page.path against entries in the sequence,
5+
then resolves neighbors to real page objects so we get URLs and titles for free.
6+
{%- endcomment -%}
7+
{%- assign seq = site.data.linear_sequence -%}
8+
{%- assign current_index = -1 -%}
9+
{%- for entry in seq -%}
10+
{%- if entry == page.path -%}
11+
{%- assign current_index = forloop.index0 -%}
12+
{%- endif -%}
13+
{%- endfor -%}
14+
{%- if current_index >= 0 -%}
15+
{%- assign prev_index = current_index | minus: 1 -%}
16+
{%- assign next_index = current_index | plus: 1 -%}
17+
{%- assign last_index = seq.size | minus: 1 -%}
18+
{%- assign prev_path = "" -%}
19+
{%- assign next_path = "" -%}
20+
{%- for entry in seq -%}
21+
{%- if forloop.index0 == prev_index -%}{%- assign prev_path = entry -%}{%- endif -%}
22+
{%- if forloop.index0 == next_index -%}{%- assign next_path = entry -%}{%- endif -%}
23+
{%- endfor -%}
24+
{%- assign prev_page = site.pages | where: "path", prev_path | first -%}
25+
{%- assign next_page = site.pages | where: "path", next_path | first -%}
26+
<nav class="prev-next-nav" aria-label="Reading sequence navigation">
27+
<div class="prev-next-nav__prev">
28+
{%- if current_index > 0 and prev_page -%}
29+
<a href="{{ prev_page.url | relative_url }}">
30+
<span class="prev-next-nav__label">&larr; Previous</span>
31+
<span class="prev-next-nav__title">{{ prev_page.title }}</span>
32+
</a>
33+
{%- endif -%}
34+
</div>
35+
<div class="prev-next-nav__next">
36+
{%- if current_index < last_index and next_page -%}
37+
<a href="{{ next_page.url | relative_url }}">
38+
<span class="prev-next-nav__label">Next &rarr;</span>
39+
<span class="prev-next-nav__title">{{ next_page.title }}</span>
40+
</a>
41+
{%- endif -%}
42+
</div>
43+
</nav>
44+
{%- endif -%}

_layouts/linear.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
layout: default
3+
---
4+
{{ content }}
5+
6+
{% include prev_next.html %}

_plugins/rouge_prooffrog.rb

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# Rouge lexer for FrogLang (the ProofFrog language).
2+
#
3+
# Registers the `prooffrog` tag (plus per-file-type aliases) so that fenced
4+
# code blocks like ```prooffrog are syntax-highlighted server-side by Rouge
5+
# at Jekyll build time. This replaces the previous client-side Prism setup.
6+
#
7+
# The token set mirrors the old Prism grammar in assets/js/prism-prooffrog.js.
8+
9+
require 'rouge'
10+
11+
module Rouge
12+
module Lexers
13+
class ProofFrog < Rouge::RegexLexer
14+
title 'ProofFrog'
15+
desc 'FrogLang, the language of the ProofFrog proof assistant'
16+
tag 'prooffrog'
17+
aliases 'froglang', 'primitive', 'scheme', 'game', 'proof'
18+
filenames '*.primitive', '*.scheme', '*.game', '*.proof'
19+
20+
# Top-level construct introducers
21+
declarations = %w[Primitive Scheme Game Reduction Phase]
22+
23+
# Built-in types
24+
builtins = %w[Bool Void Int BitString Set Map Array]
25+
26+
# Reserved words
27+
keywords = %w[
28+
import export as extends compose against requires
29+
if else for return in to
30+
union subsets induction from calls
31+
Adversary oracles proof
32+
let assume theorem games
33+
]
34+
35+
state :root do
36+
rule %r(\s+), Text
37+
rule %r(//.*), Comment::Single
38+
39+
# Single-quoted import path strings
40+
rule %r('[^']*'), Str::Single
41+
42+
# Numbers: binary literals and decimal integers
43+
rule %r(\b0b[01]+\b), Num::Bin
44+
rule %r(\b\d+\b), Num::Integer
45+
46+
# None / true / false
47+
rule %r(\bNone\b), Keyword::Constant
48+
rule %r(\b(?:true|false)\b), Keyword::Constant
49+
50+
rule %r(\b(?:#{builtins.join('|')})\b), Name::Builtin
51+
rule %r(\b(?:#{declarations.join('|')})\b), Keyword::Declaration
52+
rule %r(\b(?:#{keywords.join('|')})\b), Keyword
53+
54+
# Operators (longest match first)
55+
rule %r(<-|[=!<>]=|&&|\|\|), Operator
56+
rule %r([+\-*/\\|!<>=]), Operator
57+
58+
rule %r([{}\[\]();:,.?]), Punctuation
59+
60+
rule %r(\w+), Name
61+
rule %r(.), Text
62+
end
63+
end
64+
end
65+
end

_sass/custom/custom.scss

Lines changed: 83 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,80 @@
99
.token.number { color: #005cc5; }
1010
.token.operator { color: #d73a49; }
1111
.token.punctuation { color: #24292e; }
12-
pre:has(> code[class*="language-"]) { background: #f6f8fa; padding: 1em; }
12+
pre:has(> code[class*="language-"]) { background: $sidebar-color; padding: 1em; }
13+
14+
// Code blocks: remove border, use sidebar background color
15+
div.highlighter-rouge,
16+
figure.highlight,
17+
.highlight,
18+
pre.highlight {
19+
background-color: $sidebar-color;
20+
}
21+
22+
div.highlighter-rouge div.highlight,
23+
figure.highlight pre,
24+
figure.highlight :not(pre) > code {
25+
border: 0;
26+
background-color: $sidebar-color;
27+
}
28+
29+
.highlight .table-wrapper td,
30+
.highlight .table-wrapper pre {
31+
background-color: $sidebar-color;
32+
}
33+
34+
// Inline code: remove border, use sidebar background color
35+
:not(pre, figure) > code {
36+
background-color: $sidebar-color;
37+
border: 0;
38+
padding-left: 3px;
39+
padding-right: 3px;
40+
}
41+
42+
// Prev/next navigation at the bottom of pages on the linear reading path.
43+
.prev-next-nav {
44+
display: flex;
45+
justify-content: space-between;
46+
gap: 1rem;
47+
margin-top: 3rem;
48+
padding-top: 1.5rem;
49+
border-top: 1px solid $border-color;
50+
51+
> div {
52+
flex: 1 1 0;
53+
min-width: 0;
54+
}
55+
56+
&__next {
57+
text-align: right;
58+
}
59+
60+
a {
61+
display: inline-block;
62+
padding: 0.75rem 1rem;
63+
border: 1px solid $border-color;
64+
border-radius: 4px;
65+
text-decoration: none;
66+
max-width: 100%;
67+
68+
&:hover {
69+
background-color: $sidebar-color;
70+
}
71+
}
72+
73+
&__label {
74+
display: block;
75+
font-size: 0.75rem;
76+
text-transform: uppercase;
77+
letter-spacing: 0.05em;
78+
color: $grey-dk-000;
79+
}
80+
81+
&__title {
82+
display: block;
83+
font-weight: 500;
84+
}
85+
}
1386

1487
.site-title::after {
1588
background-image: url("../../prooffrog.png");
@@ -19,3 +92,12 @@ pre:has(> code[class*="language-"]) { background: #f6f8fa; padding: 1em; }
1992
background-size: cover;
2093
margin-left: 10px;
2194
}
95+
96+
/* Label column: no left border, right-aligned */
97+
.table-labels td:last-child,
98+
.table-labels th:last-child {
99+
border-left: none;
100+
text-align: right;
101+
width: 1%;
102+
white-space: nowrap;
103+
}

assets/diagram.png

-581 KB
Binary file not shown.

0 commit comments

Comments
 (0)