README.md (view raw)
1# nimisewi
2
3nimisewi is a small program that outputs random toki pona phrase.
4[toki pona](https://tokipona.org) is a small conlang created by sonja lang.
5
6[first implementation](https://fsl.aaoth.xyz/nimisewi.py)
7was created using python, but then i decided to create more portable version.
8
9## dependencies
10
11- cmake (>=3.10)
12
13## installation
14
15installation is very straightforward:
16
17```terminal
18$ fsl clone https://fsl.aaoth.xyz/nimisewi.c
19$ cd nimisewi
20$ mkdir build && cd build
21$ cmake ..
22$ cmake --build .
23$ doas make install
24```
25
26### compilation options
27
28- **BUILD_CGI** -- compile `nimisewi.cgi`, a cgi version
29 of nimisewi (default OFF).
30
31 [see example](https://aaoth.xyz/nimisewi).
32
33- **CGI_INSTALL_DIR** -- installation directory for `nimisewi.cgi`
34 (default "$PREFIX/var/www/htdocs/cgi-bin").
35
36- **BUILD_GEMINI_CGI** -- compile `nimisewi_gemini.cgi`, a cgi script
37 for gemini protocol (default OFF).
38
39 [see example](gemini://aaoth.xyz/cgi-bin/nimisewi).
40
41- **GEMINI_CGI_INSTALL_DIR** -- installation directory for `nimisewi_gemini.cgi`
42 (default "$PREFIX/var/gemini/cgi-bin").
43
44to specify these options, pass them as `-D{OPTION}` to initial cmake
45invocation. for example, these commands result in building both http and gemini
46versions of cgi script.
47
48``` terminal
49$ mkdir build && cd build
50$ cmake -DBUILD_CGI=ON -DBUILD_GEMINI=ON ..
51$ cmake --build .
52```
53
54## usage
55
56```terminal
57$ nimisewi
58
59musi taso jaki pi selo olin lukin
60```
61
62## adding new words
63
64to add new words, edit `nimitoki.txt` file. add one word per line.
65
66then, just clean everything and recompile the program.
67
68```terminal
69$ vim nimitoki.txt
70$ cd build
71$ make clean
72$ make
73 ...
74```
75
76## changelog
77
78- **0.0.1** -- initial release
79- **0.0.2** -- added license and comments to the code
80- **0.0.3** -- added cgi for http and gemini, separated main code from nimisewi core
81- **0.0.3.1** -- fixed errors in http header
82- **0.0.4** -- added title and favicon to http cgi
83- **0.0.4.1** -- fixed errors in http cgi
84- **0.0.4.2** -- added missing error check to main
85- **0.1.0** -- added words from lipu ku, added gnu autotools build system
86- **0.1.1** -- added 'ku' word itself
87- **0.2.0** -- switched to cmake build system, added `-v` and `--version` flags to
88 nimisewi, that are outputting version information and compile features
89
90## bugs
91
92i am pretty much beginner in c, so it is possible that the code contains some
93odd things.
94
95if you have found something wrong or weird,
96send me an email to `aaoth_at_aaoth_dot_xyz`.
97
98## license
99
100all code that makes up `nimisewi`, `nimisewi.cgi`, `nimisewi_gemini.cgi` and
101`makenimitoki` programs is licensed under ISC license
102(see [LICENSE](/file?name=LICENSE&ci=tip)).
103
104`nimitoki.txt` is in public domain.
105