2b57eb8c9829f033c3a7932a0fa885d1c1dceed1
Python 3.10 was require because I was using the `str | None` style typing syntax instead of Optional. This is 3.10+, but now the max required version is 3.8 for the `Protocol` typing API. Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
markup
A small, easy markup language for doing basic replacements in text.
Usage
If you want to use it inside of Python, you should be able to just drop in markup.py into your
Python program.
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.
./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
${random 90 100} bottles of beer on the wall => 96 bottles of beer on the wall
${choose heads tails} => heads
${round 6.4} => 6
${round ${random}} => 0
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.
Description
Languages
Python
100%