Skip to content

Commit 9732fce

Browse files
committed
Improve demo page style
1 parent d9d6772 commit 9732fce

File tree

2 files changed

+46
-296
lines changed

2 files changed

+46
-296
lines changed

demo/index.html

Lines changed: 46 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,37 @@
11
<!doctype html>
2-
2+
<html>
3+
<head>
34
<title>CodeMirror: Lambda Calculus mode</title>
45
<meta charset="utf-8"/>
5-
<link rel=stylesheet href="src/docs.css">
6-
76
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.1/codemirror.min.css">
87
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.1/theme/3024-night.min.css">
98
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro">
9+
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/awsm_theme_black.min.css">
10+
11+
<style>
12+
.CodeMirror { border-top: 1px solid black; border-bottom: 1px solid black; }
13+
.CodeMirror-scrollbar-filler { background: black; }
14+
</style>
15+
<style>
16+
.text-center { text-align: center; }
17+
</style>
18+
</head>
1019

11-
<style>.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
12-
<div id=nav>
13-
<a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png" alt=""></a>
14-
<ul>
15-
<li><a class=active href="#">Lambda Calculus</a>
16-
</ul>
17-
</div>
20+
<body>
1821

19-
<article>
20-
<h2>Lambda Calculus mode</h2>
21-
<form><textarea id="code" name="code">
22+
<header>
23+
<h1>
24+
<a href="https://github.com/codewars/lambda-calculus" title="Lambda Calculus">
25+
<img alt="Lambda Calculus" src="https://raw.githubusercontent.com/codewars/lambda-calculus/main/logo/logo-white.svg" width="64" height="64">
26+
</a>
27+
</h1>
28+
<h3 class="text-center">Lambda Calculus mode for CodeMirror</h3>
29+
</header>
2230

31+
<main>
32+
<p class="text-center"><a href="https://github.com/codewars/codemirror-lambda-calculus">@codewars/codemirror-lambda-calculus</a></p>
33+
<form>
34+
<textarea id="code" name="code">
2335
# Some code (with ignored arguments)
2436
false = \ _a b . b
2537
true = \ a _b . a
@@ -75,26 +87,29 @@ <h2>Lambda Calculus mode</h2>
7587
eq = \ a b . isZ a (isZ b) (isZ b false (eq (pred a) (pred b)))
7688
all = foldr (\ a b . a b false) true
7789
allf = \ f xs . all (map f xs)
78-
</textarea></form>
90+
</textarea>
91+
</form>
92+
<p class="text-center"><strong>MIME type:</strong> <code>text/lambda-calc</code></p>
93+
</main>
7994

8095
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.1/codemirror.min.js"></script>
8196
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.1/addon/edit/matchbrackets.min.js"></script>
8297
<script src="../lambdacalc.js"></script>
83-
<script>
84-
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
85-
lineNumbers: true,
86-
matchBrackets: true,
87-
theme: "3024-night",
88-
specialChars: /\\/,
89-
specialCharPlaceholder: () => {
90-
const elem = document.createElement("span");
91-
elem.setAttribute("cm-text", "\\");
92-
elem.innerHTML = "λ";
93-
return elem;
94-
}
95-
});
96-
editor.setSize(500, 500);
97-
</script>
98+
<script>
99+
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
100+
lineNumbers: true,
101+
matchBrackets: true,
102+
theme: "3024-night",
103+
specialChars: /\\/,
104+
specialCharPlaceholder: () => {
105+
const elem = document.createElement("span");
106+
elem.setAttribute("cm-text", "\\");
107+
elem.innerHTML = "λ";
108+
return elem;
109+
}
110+
});
111+
editor.setSize(500, 500);
112+
</script>
98113

99-
<p><strong>MIME types defined:</strong> <code>text/lambda-calc</code>.</p>
100-
</article>
114+
</body>
115+
</html>

demo/src/docs.css

Lines changed: 0 additions & 265 deletions
This file was deleted.

0 commit comments

Comments
 (0)