Skip to content

Commit a9ab5ef

Browse files
kovdocs: search, TOC, callouts, copy buttons, syntax highlighting, 2ms builds
1 parent e2d0781 commit a9ab5ef

15 files changed

Lines changed: 1555 additions & 487 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
/target
2+
tools/kovdocs/target/

docs/out/01-getting-started.html

Lines changed: 59 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -3,66 +3,99 @@
33
<head>
44
<meta charset="UTF-8">
55
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6-
<title>Getting Started — Kov</title>
7-
<link rel="stylesheet" href="style.css">
6+
<title>Getting Started — Kov Documentation</title>
7+
<meta name="description" content="Documentation for the Kov programming language">
8+
<meta property="og:title" content="Getting Started — Kov Documentation">
9+
<meta property="og:description" content="Documentation for the Kov programming language">
10+
<link rel="stylesheet" href="assets/style.css">
11+
<link rel="preconnect" href="https://fonts.googleapis.com">
12+
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet">
813
</head>
914
<body>
15+
<div class="top-bar">
16+
<a href="index.html" class="logo">Kov Documentation</a>
17+
<div class="top-actions">
18+
<button class="search-btn" onclick="toggleSearch()">Search <kbd>Ctrl+K</kbd></button>
19+
<a href="https://github.com/visualstudioblyat/kov" class="gh-link">GitHub</a>
20+
</div>
21+
</div>
22+
<div class="search-overlay" id="search-overlay" style="display:none">
23+
<div class="search-modal">
24+
<input type="text" id="search-input" placeholder="Search docs..." oninput="doSearch(this.value)" autofocus>
25+
<div id="search-results"></div>
26+
</div>
27+
</div>
1028
<div class="layout">
11-
<aside><nav>
29+
<aside><nav class="sidebar-nav">
1230
<ul>
13-
<li><a href="index.html">Home</a></li>
1431
<li class="active"><a href="01-getting-started.html">Getting Started</a></li>
1532
<li><a href="02-language.html">Language Reference</a></li>
1633
<li><a href="03-cli.html">CLI Reference</a></li>
1734
</ul>
1835
</nav>
1936
</aside>
20-
<main><h1 id="getting-started">Getting Started</h1>
37+
<main>
38+
<div class="breadcrumb"><a href="index.html">Docs</a> / Getting Started</div>
39+
<article><h1 id="getting-started">Getting Started</h1>
2140
<p>kov is a systems language for RISC-V embedded. no LLVM, no runtime. source goes in, firmware comes out.</p>
2241
<h2 id="try-it-in-your-browser">try it in your browser</h2>
2342
<p>go to <a href="https://kov.dev/playground">kov.dev/playground</a>. type code on the left, see assembly on the right. no install needed.</p>
2443
<h2 id="install">install</h2>
25-
<pre><code class="lang-text">cargo install kov
26-
</code></pre>
44+
<div class="code-block"><div class="code-header"><span class="code-lang">text</span><button class="copy-btn" onclick="copyCode(this)">Copy</button></div><pre><code class="lang-text">cargo install kov
45+
</code></pre></div>
2746
<p>or build from source:</p>
28-
<pre><code class="lang-text">git clone https://github.com/visualstudioblyat/kov
47+
<div class="code-block"><div class="code-header"><span class="code-lang">text</span><button class="copy-btn" onclick="copyCode(this)">Copy</button></div><pre><code class="lang-text">git clone https://github.com/visualstudioblyat/kov
2948
cd kov
3049
cargo build --release
31-
</code></pre>
50+
</code></pre></div>
3251
<h2 id="your-first-program">your first program</h2>
3352
<p>create <code>blink.kov</code>:</p>
34-
<pre><code class="lang-kov"><span class="keyword">board</span> esp32c3 {
35-
gpio: GPIO @ <span class="number">0x6000_4000</span>,
36-
clock: <span class="number">160_000_000</span>,
53+
<div class="code-block"><div class="code-header"><span class="code-lang">kov</span><button class="copy-btn" onclick="copyCode(this)">Copy</button></div><pre><code class="lang-kov"><span class="k">board</span> esp32c3 {
54+
gpio: GPIO @ <span class="n">0x6000_4000</span>,
55+
clock: <span class="n">160_000_000</span>,
3756
}
3857

39-
<span class="attr">#[stack(512)]</span>
40-
<span class="keyword">fn</span> main(b: &amp;<span class="keyword">mut</span> esp32c3) {
41-
<span class="keyword">let</span> led = b.gpio.pin(<span class="number">2</span>, .output);
42-
<span class="keyword">loop</span> {
58+
<span class="a">#[stack(512)]</span>
59+
<span class="k">fn</span> main(b: &amp;<span class="k">mut</span> esp32c3) {
60+
<span class="k">let</span> led = b.gpio.pin(<span class="n">2</span>, .output);
61+
<span class="k">loop</span> {
4362
led.high();
44-
delay_ms(<span class="number">500</span>);
63+
delay_ms(<span class="n">500</span>);
4564
led.low();
46-
delay_ms(<span class="number">500</span>);
65+
delay_ms(<span class="n">500</span>);
4766
}
4867
}
49-
</code></pre>
68+
</code></pre></div>
5069
<h2 id="compile-and-run">compile and run</h2>
51-
<pre><code class="lang-text">kov run blink.kov
52-
</code></pre>
70+
<div class="code-block"><div class="code-header"><span class="code-lang">text</span><button class="copy-btn" onclick="copyCode(this)">Copy</button></div><pre><code class="lang-text">kov run blink.kov
71+
</code></pre></div>
5372
<p>this compiles your program, runs it in the built-in emulator, and shows GPIO register writes. no hardware needed.</p>
5473
<h2 id="compile-to-binary">compile to binary</h2>
55-
<pre><code class="lang-text">kov build blink.kov -o firmware.elf
56-
</code></pre>
74+
<div class="code-block"><div class="code-header"><span class="code-lang">text</span><button class="copy-btn" onclick="copyCode(this)">Copy</button></div><pre><code class="lang-text">kov build blink.kov -o firmware.elf
75+
</code></pre></div>
5776
<h2 id="flash-to-hardware">flash to hardware</h2>
58-
<pre><code class="lang-text">kov flash blink.kov --chip esp32c3
59-
</code></pre>
77+
<div class="code-block"><div class="code-header"><span class="code-lang">text</span><button class="copy-btn" onclick="copyCode(this)">Copy</button></div><pre><code class="lang-text">kov flash blink.kov --chip esp32c3
78+
</code></pre></div>
6079
<p>requires <a href="https://probe.rs/">probe-rs</a> installed.</p>
6180
<h2 id="what-just-happened">what just happened</h2>
6281
<p>the compiler: 1. lexed and parsed your source (0.6ms) 2. type-checked it (peripheral ownership, stack bounds) 3. lowered to SSA IR 4. ran 8 optimizer passes 5. generated RISC-V machine code 6. compressed with RV32C (16% smaller) 7. output a 400-byte binary</p>
6382
<p>all from one command. no makefiles, no linker scripts, no external tools.</p>
83+
</article>
84+
<div class="prev-next"><span></span><a href="02-language.html" class="next">Language Reference →</a></div>
6485
</main>
86+
<div class="toc-col"><div class="toc"><div class="toc-title">On this page</div>
87+
<ul>
88+
<li><a href="#try-it-in-your-browser">try it in your browser</a></li>
89+
<li><a href="#install">install</a></li>
90+
<li><a href="#your-first-program">your first program</a></li>
91+
<li><a href="#compile-and-run">compile and run</a></li>
92+
<li><a href="#compile-to-binary">compile to binary</a></li>
93+
<li><a href="#flash-to-hardware">flash to hardware</a></li>
94+
<li><a href="#what-just-happened">what just happened</a></li>
95+
</ul></div>
96+
</div>
6597
</div>
66-
<footer><p>generated by kovdocs — built with the kov compiler</p></footer>
98+
<footer><p>generated by <a href="https://github.com/visualstudioblyat/kov">kovdocs</a></p></footer>
99+
<script src="assets/app.js"></script>
67100
</body>
68101
</html>

0 commit comments

Comments
 (0)