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
81 nimisewi core
82- **0.0.3.1** -- fixed errors in http header
83- **0.0.4** -- added title and favicon to http cgi
84- **0.0.4.1** -- fixed errors in http cgi
85- **0.0.4.2** -- added missing error check to main
86- **0.1.0** -- added words from lipu ku, added gnu autotools build system
87- **0.1.1** -- added 'ku' word itself
88- **0.2.0** -- switched to cmake build system, added `-v` and `--version`
89 flags to nimisewi, that are outputting version information
90 and compile features
91- **0.3.0** -- added support for arc4random function if it exists on the system
92- **0.3.1** -- added compiler name and version to `--version` flag of nimisewi
93
94## bugs
95
96i am pretty much beginner in c, so it is possible that the code contains some
97odd things.
98
99if you have found something wrong or weird,
100send me an email to `aaoth_at_aaoth_dot_xyz`.
101
102## license
103
104all code that makes up `nimisewi`, `nimisewi.cgi`, `nimisewi_gemini.cgi` and
105`makenimitoki` programs is licensed under ISC license
106(see [LICENSE](/file?name=LICENSE&ci=tip)).
107
108`nimitoki.txt` is in public domain.
109