index.html (7157B)
1 <!DOCTYPE html> 2 <html lang="en"> 3 <head> 4 <title>slweb - Simple static website generator</title> 5 <meta charset="utf-8" /> 6 <link rel="shortcut icon" type="image/x-icon" href="/slweb/favicon.ico" /> 7 <meta name="og:type" content="website" /> 8 <meta name="og:url" content="https://strahinja.srht.site/slweb/index.html" /> 9 <meta name="og:title" content="slweb - Simple static website generator" /> 10 <meta name="og:description" content="Simple static website generator" /> 11 <meta name="og:image" content="https://strahinja.srht.site/slweb/logo-social.webp" /> 12 <meta name="og:image:type" content="image/webp" /> 13 <meta name="og:image:width" content="1127" /> 14 <meta name="og:image:height" content="492" /> 15 <meta name="og:image:alt" content="The text 'slweb' in lowercase italics" /> 16 <meta name="twitter:card" content="summary_large_image" /> 17 <meta name="twitter:url" content="https://strahinja.srht.site/slweb/index.html" /> 18 <meta name="twitter:title" content="slweb - Simple static website generator" /> 19 <meta name="twitter:creator" content="@strahinja_radic" /> 20 <meta name="twitter:description" content="Simple static website generator" /> 21 <meta name="twitter:image" content="https://strahinja.srht.site/slweb/logo-social.webp" /> 22 <link rel="canonical" href="https://strahinja.srht.site/slweb/index.html" /> 23 <meta name="description" content="Simple static website generator" /> 24 <meta name="viewport" content="width=device-width, initial-scale=1" /> 25 <meta name="generator" content="slweb" /> 26 <link rel="stylesheet" href="/slweb/index.css" /> 27 <link rel="stylesheet" href="/slweb/katex.min.css" /> 28 </head> 29 <body> 30 <main> 31 <h1>slweb</h1> 32 33 <p><strong>Slweb</strong> is a static website generator which aims at being simplistic. It 34 transforms custom Markdown-like syntax into HTML.</p> 35 36 <h2>Prerequisites</h2> 37 38 <p>Aside from the obvious (a C compiler, by default <strong>GNU C</strong>), slweb requires 39 <strong>realpath</strong>(1) to determine paths in local links and <strong>groff</strong>(1) and 40 <strong>gzip</strong>(1) to create and compress documentation. <strong>git</strong>(1) is, aside from 41 cloning the repository, required to use the directive <code>{git-log}</code>. <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mtext>KaTeX</mtext></mrow><annotation encoding="application/x-tex">\KaTeX</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.89883em;vertical-align:-0.2155em;"></span><span class="mord text"><span class="mord textrm">K</span><span class="mspace" style="margin-right:-0.17em;"></span><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.68333em;"><span style="top:-2.904999em;"><span class="pstrut" style="height:2.7em;"></span><span class="mord"><span class="mord textrm mtight sizing reset-size6 size3">A</span></span></span></span></span></span><span class="mspace" style="margin-right:-0.15em;"></span><span class="mord text"><span class="mord textrm">T</span><span class="mspace" style="margin-right:-0.1667em;"></span><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.46782999999999997em;"><span style="top:-2.7845em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord textrm">E</span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.2155em;"><span></span></span></span></span><span class="mspace" style="margin-right:-0.125em;"></span><span class="mord textrm">X</span></span></span></span></span></span> 42 (<a href="https://katex.org">https://katex.org</a>) is optionally used for math mode.</p> 43 44 <h2>Install</h2> 45 46 <pre> 47 $ git clone https://git.sr.ht/~strahinja/slweb 48 $ cd slweb 49 $ su 50 </pre> 51 52 <p>Then, if you have <a href="https://github.com/apenwarr/redo">apenwarr/redo</a>:</p> 53 54 <pre> 55 # redo install 56 </pre> 57 58 <p>if you don't:</p> 59 60 <pre> 61 # ./do install 62 </pre> 63 64 <p>You can specify any compiler which uses <code>-Wall</code>, <code>-c</code>, <code>-g</code> and <code>-o</code> like GNU C, 65 most notably <strong>tcc</strong>(1), by setting the <code>SLWEB_CC</code> environment variable. For 66 example:</p> 67 68 <pre> 69 $ SLWEB_CC=tcc redo -j10 70 </pre> 71 72 <p>In the case of <strong>tcc</strong>, the tradeoff is that the debug information is limited 73 compared to <strong>gcc</strong>, but the compilation time is significantly shorter.</p> 74 75 <h2>Examples</h2> 76 77 <p>See the <a href="https://git.sr.ht/~strahinja/slweb/tree/master/item/examples"><code>examples/</code></a> directory in this repository.</p> 78 79 <p>Given the file <code>index.slw</code> in the current directory:</p> 80 81 <pre> 82 --- 83 site-name: Test website 84 site-desc: My first website in slweb 85 --- 86 87 {main} 88 # Hello world 89 90 This is an _example_ of a statically generated HTML. 91 92 {/main} 93 </pre> 94 95 <p>after using the command:</p> 96 97 <pre> 98 $ slweb index.slw > index.html 99 </pre> 100 101 <p>file <code>index.html</code> contains:</p> 102 103 <pre> 104 <!DOCTYPE html> 105 <html lang="en"> 106 <head> 107 <title>Test website</title> 108 <meta charset="utf8" /> 109 <meta name="description" content="My first website in slweb" /> 110 <meta name="viewport" content="width=device-width, initial-scale=1" /> 111 <meta name="generator" content="slweb" /> 112 </head> 113 <body> 114 115 <main> 116 <h1>Hello world</h1> 117 118 <p>This is an <em>example</em> of a statically generated HTML.</p> 119 120 </main> 121 </body> 122 </html> 123 </pre> 124 125 <h2>TODO (checklist)</h2> 126 127 <p>See the file <a href="https://git.sr.ht/~strahinja/slweb/tree/master/item/TODO"><code>TODO</code></a> for more information.</p> 128 129 130 <h2>Bugs and limitations</h2> 131 132 <p>Bugs can be reported using the <a href="https://sr.ht/~strahinja/slweb/trackers">ticket tracker</a>. See the manpage (<code>man 133 slweb</code>) after installing <strong>slweb</strong> for more information.</p> 134 135 136 <h2>License</h2> 137 138 <p>slweb - Simple static website generator.<br /> 139 Copyright (C) 2020, 2021 Страхиња Радић</p> 140 141 <p>This program is free software: you can redistribute it and/or modify it under 142 the terms of the GNU General Public License as published by the Free Software 143 Foundation, either version 3 of the License, or (at your option) any later 144 version. </p> 145 146 <p>This program is distributed in the hope that it will be useful, but WITHOUT ANY 147 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 148 PARTICULAR PURPOSE. See the GNU General Public License for more details. </p> 149 150 <p>You should have received a copy of the GNU General Public License along with 151 this program. If not, see <<a href="https://www.gnu.org/licenses">https://www.gnu.org/licenses/</a>>. </p> 152 153 <div id="git-log"> 154 Previous commit: 155 index.slw db3c782 2021-03-11 17:02:16 +0100 (Страхиња Радић) (HEAD -> master, tag: v0.3.9, origin/master, origin/HEAD) 156 </div><!--git-log--> 157 158 159 <div id="made-by"> 160 Generated by <a href="https://strahinja.srht.site/slweb/index.html" target="_blank">slweb</a> 161 © 2020, 2021 Strahinya Radich. 162 </div><!--made-by--> 163 164 </main> 165 166 167 </body> 168 </html>