all repos — nimisewi_c @ 9751403aeb161a49287582fab5965d33801bd76c

simple random toki pona phrase generator

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