forked from codewars/codemirror-riscv
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
50 lines (46 loc) · 1.5 KB
/
index.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>CodeMirror: RISC-V Mode</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/awsm_theme_black.min.css">
<link rel="stylesheet" href="../../lib/codemirror.css">
<link rel="stylesheet" href="./codewars.css">
<script src="../../lib/codemirror.js"></script>
<script src="../../addon/mode/simple.js"></script>
<script src="./riscv.js"></script>
<style>
.CodeMirror { margin: auto; }
.text-center { text-align: center; }
.mb-8 { margin-bottom: 2rem; }
.my-4 { margin-top: 1rem; margin-bottom: 1rem; }
.mx-auto { margin-left: auto; margin-right: auto; }
</style>
</head>
<body class="dark">
<header class="text-center mb-8">
<img class="my-4 mx-auto" src="./riscv.svg" alt="RISC-V" width="64" height="64">
<h1>RISC-V mode for CodeMirror</h1>
<p><code>text/x-riscv</code></p>
<p><a href="https://github.com/codewars/codemirror-riscv">codewars/codemirror-riscv</a></p>
</header>
<main>
<textarea id="editor">
# comment
.globl multiply
multiply:
mulw a0, a0, a1
ret
</textarea>
</main>
<script type="module">
var editor = CodeMirror.fromTextArea(document.getElementById("editor"), {
mode: "riscv",
lineNumbers: true,
theme: "codewars",
});
editor.setSize(650, 500);
</script>
</body>
</html>