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
62options:
63
64- `-v` -- display version information and compilation features.
65- `-i` -- display sad version of nimisewi prompt.
66
67## adding new words
68
69to add new words, edit `nimitoki.txt` file. add one word per line.
70
71then, just clean everything and recompile the program.
72
73```terminal
74$ vim nimitoki.txt
75$ cd build
76$ make clean
77$ make
78 ...
79```
80
81## changelog
82
83- **0.0.1** -- initial release
84- **0.0.2** -- added license and comments to the code
85- **0.0.3** -- added cgi for http and gemini, separated main code from
86 nimisewi core
87- **0.0.3.1** -- fixed errors in http header
88- **0.0.4** -- added title and favicon to http cgi
89- **0.0.4.1** -- fixed errors in http cgi
90- **0.0.4.2** -- added missing error check to main
91- **0.1.0** -- added words from lipu ku, added gnu autotools build system
92- **0.1.1** -- added 'ku' word itself
93- **0.2.0** -- switched to cmake build system, added `-v` and `--version`
94 flags to nimisewi, that are outputting version information
95 and compile features
96- **0.3.0** -- added support for arc4random function if it exists on the system
97- **0.3.1** -- added compiler name and version to `--version` flag of nimisewi
98- **0.3.2** -- fixed link flags on linux
99- **0.3.3** -- fixed compiler warnings and build system
100- **0.4.0** -- added max number of words to nimisewi function, added new prompt
101to the main program
102
103## bugs
104
105i am pretty much beginner in c, so it is possible that the code contains some
106odd things.
107
108if you have found something wrong or weird,
109send me an email to `aaoth_at_aaoth_dot_xyz`.
110
111## license
112
113all code that makes up `nimisewi`, `nimisewi.cgi`, `nimisewi_gemini.cgi` and
114`makenimitoki` programs is licensed under ISC license
115(see [LICENSE](/file?name=LICENSE&ci=tip)).
116
117`nimitoki.txt` is in public domain.
118