Skip to content

Commit 32f2a3d

Browse files
committed
update snippets
1 parent 5bb100b commit 32f2a3d

File tree

13 files changed

+27
-78
lines changed

13 files changed

+27
-78
lines changed

src/_includes/default.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
1818
<link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,100..800;1,100..800&display=swap" rel="stylesheet">
1919
<link rel="stylesheet" type="text/css" href="/static/css/style.css"/>
20+
<script defer src="https://cdn.jsdelivr.net/npm/[email protected]/dist/cdn.min.js"></script>
2021
</head>
2122
<body class="h-full w-screen min-h-screen grid bg-eh-background text-eh-light-gray font-mono overflow-x-hidden layout">
2223
{% include "header.html" %}

src/_includes/examples.html

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,19 @@ <h2 id="examples" class="text-eh-white text-3xl lg:text-4xl font-bold mb-8">Exam
55
<div class="border border-eh-yellow bg-eh-yellow bg-opacity-20 rounded-md p-4 text-eh-yellow mb-8">
66
<p><span class="font-bold uppercase">Note:</span> The code examples below are using the <a href="https://prismjs.com/" class="font-bold underline">PrismJS</a> syntax highlighter. The actual syntax highlighting in your editor may look different.</p>
77
</div>
8+
<div class="border border-eh-dark-gray rounded-md mb-6" x-data="{ lang: 'css' }">
9+
<header class="border-b border-eh-dark-gray mb-4 p-4 flex items-center gap-4 w-full overflow-auto">
10+
<button class="text-base" :class="lang == 'css' ? 'text-eh-white' : 'text-eh-gray hover:text-eh-light-gray'" @click="lang = 'css'">CSS</button>
11+
<button class="text-base" :class="lang == 'html' ? 'text-eh-white' : 'text-eh-gray hover:text-eh-light-gray'" @click="lang = 'html'">HTML</button>
12+
<button class="text-base" :class="lang == 'js' ? 'text-eh-white' : 'text-eh-gray hover:text-eh-light-gray'"@click="lang = 'js'">JS</button>
13+
<button class="text-base" :class="lang == 'go' ? 'text-eh-white' : 'text-eh-gray hover:text-eh-light-gray'"@click="lang = 'go'">Go</button>
14+
<button class="text-base" :class="lang == 'python' ? 'text-eh-white' : 'text-eh-gray hover:text-eh-light-gray'"@click="lang = 'python'">Python</button>
15+
<button class="text-base" :class="lang == 'ruby' ? 'text-eh-white' : 'text-eh-gray hover:text-eh-light-gray'"@click="lang = 'ruby'">Ruby</button>
16+
<button class="text-base" :class="lang == 'rust' ? 'text-eh-white' : 'text-eh-gray hover:text-eh-light-gray'"@click="lang = 'rust'">Rust</button>
17+
<button class="text-base" :class="lang == 'md' ? 'text-eh-white' : 'text-eh-gray hover:text-eh-light-gray'"@click="lang = 'md'">Markdown</button>
18+
<button class="text-base" :class="lang == 'ts' ? 'text-eh-white' : 'text-eh-gray hover:text-eh-light-gray'"@click="lang = 'ts'">Typescript</button>
19+
<button class="text-base" :class="lang == 'yml' ? 'text-eh-white' : 'text-eh-gray hover:text-eh-light-gray'"@click="lang = 'yml'">YML</button>
20+
</header>
821
{% include "snippets/css.html" %}
922
{% include "snippets/html.html" %}
1023
{% include "snippets/js.html" %}
@@ -15,5 +28,6 @@ <h2 id="examples" class="text-eh-white text-3xl lg:text-4xl font-bold mb-8">Exam
1528
{% include "snippets/markdown.html" %}
1629
{% include "snippets/ts.html" %}
1730
{% include "snippets/yaml.html" %}
31+
</div>
1832
</section>
1933

src/_includes/snippets/css.html

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
<div class="border border-eh-dark-gray rounded-md mb-6">
2-
<header class="border-b border-eh-dark-gray mb-4 p-4 flex items-center">
3-
4-
<h3 class="text-eh-light-gray text-base">CSS</h3>
5-
</header>
6-
<div class="p-4 w-full overflow-auto code-snippet">
1+
<div x-show="lang === 'css'" class="p-4 w-full overflow-auto code-snippet">
72
{% highlight "css" %}
83
:root {
94
--font-base: 16px;
@@ -27,6 +22,5 @@ <h3 class="text-eh-light-gray text-base">CSS</h3>
2722
-webkit-border-radius: 0;
2823
}
2924
{% endhighlight %}
30-
</div>
3125
</div>
3226

src/_includes/snippets/go.html

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
<div class="border border-eh-dark-gray rounded-md mb-6">
2-
<header class="border-b border-eh-dark-gray mb-4 p-4 flex items-center">
3-
4-
<h3 class="text-eh-light-gray text-base">Go</h3>
5-
</header>
6-
<div class="p-4 w-full overflow-auto code-snippet">
1+
<div x-show="lang === 'go'" class="p-4 w-full overflow-auto code-snippet">
72
{% highlight "go" %}
83
import (
94
"fmt"
@@ -27,6 +22,5 @@ <h3 class="text-eh-light-gray text-base">Go</h3>
2722
return cards
2823
}
2924
{% endhighlight %}
30-
</div>
3125
</div>
3226

src/_includes/snippets/html.html

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
<div class="border border-eh-dark-gray rounded-md mb-6">
2-
<header class="border-b border-eh-dark-gray mb-4 p-4 flex items-center">
3-
4-
<h3 class="text-eh-light-gray text-base">HTML</h3>
5-
</header>
6-
<div class="p-4 w-full overflow-auto code-snippet">
1+
<div x-show="lang == 'html'" class="p-4 w-full overflow-auto code-snippet">
72
{% highlight "html" %}
83
<!DOCTYPE html>
94
<html lang="en">
@@ -24,6 +19,5 @@ <h3 class="text-eh-light-gray text-base">HTML</h3>
2419

2520
</html>
2621
{% endhighlight %}
27-
</div>
2822
</div>
2923

src/_includes/snippets/js.html

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
<div class="border border-eh-dark-gray rounded-md mb-6">
2-
<header class="border-b border-eh-dark-gray mb-4 p-4 flex items-center">
3-
4-
<h3 class="text-eh-light-gray text-base">JavaScript</h3>
5-
</header>
6-
<div class="p-4 w-full overflow-auto code-snippet">
1+
<div x-show="lang == 'js'" class="p-4 w-full overflow-auto code-snippet">
72
{% highlight "js" %}
83
'use strict'
94
class Sale {
@@ -37,6 +32,5 @@ <h3 class="text-eh-light-gray text-base">JavaScript</h3>
3732
}
3833
}
3934
{% endhighlight %}
40-
</div>
4135
</div>
4236

src/_includes/snippets/markdown.html

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
<div class="border border-eh-dark-gray rounded-md mb-6">
2-
<header class="border-b border-eh-dark-gray mb-4 p-4 flex items-center">
3-
4-
<h3 class="text-eh-light-gray text-base">Markdown</h3>
5-
</header>
6-
<div class="p-4 w-full overflow-auto code-snippet">
1+
<div x-show="lang == 'md'" class="p-4 w-full overflow-auto code-snippet">
72
{% highlight "md" %}
83
# Electron Highlighter Theme
94

@@ -25,6 +20,5 @@ <h3 class="text-eh-light-gray text-base">Markdown</h3>
2520
- more stuff
2621
- it's a list mkay
2722
{% endhighlight %}
28-
</div>
2923
</div>
3024

src/_includes/snippets/php.html

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
<div class="border border-eh-dark-gray rounded-md mb-6">
2-
<header class="border-b border-eh-dark-gray mb-4 p-4 flex items-center">
3-
4-
<h3 class="text-eh-light-gray text-base">PHP</h3>
5-
</header>
6-
<div class="p-4 w-full overflow-auto code-snippet">
1+
<div x-show="lang == 'php'" class="p-4 w-full overflow-auto code-snippet">
72
{% highlight "php" %}
83
<?php
94
class HelloWorldTest extends PHPUnit_Framework_TestCase
@@ -42,6 +37,5 @@ <h3 class="text-eh-light-gray text-base">PHP</h3>
4237
}
4338
?>
4439
{% endhighlight %}
45-
</div>
4640
</div>
4741

src/_includes/snippets/python.html

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
<div class="border border-eh-dark-gray rounded-md mb-6">
2-
<header class="border-b border-eh-dark-gray mb-4 p-4 flex items-center">
3-
4-
<h3 class="text-eh-light-gray text-base">Python</h3>
5-
</header>
6-
<div class="p-4 w-full overflow-auto code-snippet">
1+
<div x-show="lang == 'python'" class="p-4 w-full overflow-auto code-snippet">
72
{% highlight "py" %}
83
from collections import deque
94
def topo(G, ind=None, Q=[1]):
@@ -26,6 +21,5 @@ <h3 class="text-eh-light-gray text-base">Python</h3>
2621
Q.append(w)
2722
topo(G, ind, Q)
2823
{% endhighlight %}
29-
</div>
3024
</div>
3125

src/_includes/snippets/ruby.html

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
<div class="border border-eh-dark-gray rounded-md mb-6">
2-
<header class="border-b border-eh-dark-gray mb-4 p-4 flex items-center">
3-
4-
<h3 class="text-eh-light-gray text-base">Ruby</h3>
5-
</header>
6-
<div class="p-4 w-full overflow-auto code-snippet">
1+
<div x-show="lang == 'ruby'" class="p-4 w-full overflow-auto code-snippet">
72
{% highlight "rb" %}
83
module ExampleModule
94
class ExampleClass::ScopeResolution < NewScope::Operator
@@ -46,6 +41,5 @@ <h3 class="text-eh-light-gray text-base">Ruby</h3>
4641
puts 'yielding in block!'
4742
end
4843
{% endhighlight %}
49-
</div>
5044
</div>
5145

0 commit comments

Comments
 (0)