slweb

Једноставни генератор статичких веб страна
Дневник | Датотеке | Референце | ПРОЧИТАЈМЕ | ЛИЦЕНЦА

index.slw (3750B)


      1 ---
      2 site-name: slweb - Simple static website generator
      3 site-desc: Simple static website generator
      4 stylesheet: /slweb/index.css
      5 stylesheet: /slweb/katex.min.css
      6 favicon-url: /slweb/favicon.ico
      7 image: https://strahinja.srht.site/slweb/logo-social.webp
      8 canonical: https://strahinja.srht.site/slweb/
      9 meta: index-meta.csv
     10 ---
     11 {main}
     12 # slweb
     13 
     14 **Slweb** is a static website generator which aims at being simplistic. It
     15 transforms custom Markdown-like syntax into HTML.
     16 
     17 ## Prerequisites
     18 
     19 Aside from the obvious (a C compiler, by default **GNU C**), slweb requires
     20 **groff**(1) and **gzip**(1) to create and compress documentation.  **git**(1)
     21 is, aside from cloning the repository, required to use the directive
     22 `{git-log}`. $\KaTeX$ ([https://katex.org][katex]) is optionally used for math
     23 mode. [ImageMagick's][imgmg] program **identify**(1) is optionally used to
     24 determine image sizes and output them as attributes to the `<img>` tag.
     25 
     26 
     27 ## Install
     28 
     29 ```
     30 $ git clone https://git.sr.ht/~strahinja/slweb
     31 $ cd slweb
     32 $ su
     33 ```
     34 
     35 Then, if you have [apenwarr/redo][aredo]:
     36 
     37 ```
     38 # redo install
     39 ```
     40 
     41 if you don't:
     42 
     43 ```
     44 # ./do install
     45 ```
     46 
     47 You can specify any compiler which uses `-Wall`, `-c`, `-g` and `-o` like GNU C,
     48 most notably **tcc**(1), by setting the `SLWEB_CC` environment variable. For
     49 example:
     50 
     51 ```
     52 $ SLWEB_CC=tcc redo -j10
     53 ```
     54 
     55 In the case of **tcc**, the tradeoff is that the debug information is limited
     56 compared to **gcc**, but the compilation time is significantly shorter.
     57 
     58 ## Examples
     59 
     60 See the [`examples/`][examp] directory in this repository.
     61 
     62 Given the file `index.slw` in the current directory:
     63 
     64 ```
     65 ---
     66 site-name: Test website
     67 site-desc: My first website in slweb
     68 ---
     69 
     70 {main}
     71 # Hello world
     72 
     73 This is an \_example_ of a statically generated HTML.
     74 
     75 {/main}
     76 ```
     77 
     78 after using the command:
     79 
     80 ```
     81 $ slweb index.slw > index.html
     82 ```
     83 
     84 file `index.html` contains:
     85 
     86 ```
     87 &lt;!DOCTYPE html&gt;
     88 &lt;html lang="en"&gt;
     89 &lt;head&gt;
     90     &lt;title&gt;Test website&lt;/title&gt;
     91     &lt;meta charset="utf8" /&gt;
     92     &lt;meta name="description" content="My first website in slweb" /&gt;
     93     &lt;meta name="viewport" content="width=device-width, initial-scale=1" /&gt;
     94     &lt;meta name="generator" content="slweb" /&gt;
     95 &lt;/head&gt;
     96 &lt;body&gt;
     97 
     98 &lt;main&gt;
     99 &lt;h1&gt;Hello world&lt;/h1&gt;
    100 
    101 &lt;p&gt;This is an &lt;em&gt;example&lt;/em&gt; of a statically generated HTML.&lt;/p&gt;
    102 
    103 &lt;/main&gt;
    104 &lt;/body&gt;
    105 &lt;/html&gt;
    106 ```
    107 
    108 ## TODO (checklist)
    109 
    110 See the file [`TODO`][mtodo] for more information.
    111 
    112 
    113 ## Bugs and limitations
    114 
    115 Bugs can be reported using the [ticket tracker][issue]. See the manpage (`man
    116 slweb`) after installing **slweb** for more information.
    117 
    118 
    119 ## License
    120 
    121 slweb - Simple static website generator.  
    122 Copyright (C) 2020, 2021 Страхиња Радић
    123 
    124 This program is free software: you can redistribute it and/or modify it under
    125 the terms of the GNU General Public License as published by the Free Software
    126 Foundation, either version 3 of the License, or (at your option) any later
    127 version. 
    128 
    129 This program is distributed in the hope that it will be useful, but WITHOUT ANY
    130 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
    131 PARTICULAR PURPOSE. See the GNU General Public License for more details. 
    132 
    133 You should have received a copy of the GNU General Public License along with
    134 this program. If not, see &lt;[https://www.gnu.org/licenses/][licen]&gt;. 
    135 
    136 {git-log}
    137 
    138 {made-by}
    139 {/main}
    140 
    141 [aredo]: https://github.com/apenwarr/redo
    142 [examp]: https://git.sr.ht/~strahinja/slweb/tree/master/item/examples
    143 [imgmg]: https://imagemagick.org
    144 [issue]: https://todo.sr.ht/~strahinja/slweb
    145 [mtodo]: https://git.sr.ht/~strahinja/slweb/tree/master/item/TODO
    146 [katex]: https://katex.org
    147 [licen]: https://www.gnu.org/licenses
    148