Add some documentation to the README

This is mostly about the language usage and available macros.

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
2022-09-22 10:27:46 -07:00
parent 068cb6d35b
commit 0724e7c856

View File

@@ -10,3 +10,26 @@ Python program.
If you want to use it on the command line, you can either call `./markup.py` and pass your text to If you want to use it on the command line, you can either call `./markup.py` and pass your text to
process through STDIN. Otherwise, you can pass in a (single) file as an argument, e.g. process through STDIN. Otherwise, you can pass in a (single) file as an argument, e.g.
`./markup.py filename.txt` `./markup.py filename.txt`
# Language
This language attempts to be easy to use and extend. There are not many default macros available,
they are added as-needed.
## Examples
`asdf asdf asdf` => `asdf asdf asdf`
`${random 6}` => `4`
`${choose a b c d}` => `d`
`${round 6.4}` => `6`
## Available macros
* `random [X [Y]]` - chooses a random number. If no arguments are supplied, chooses a random number
between 0.0 and 1.0, exclusive. If one argument, chooses a random integer between 1 and the
number, inclusive. If two arguments, chooses a random integer between the two numbers, inclusive.
* `choose [X [Y [Z ...]]]` - chooses a random item from the supplied list of items.
* `round X [Y]` - rounds a number X to an optional Y digits.