diff --git a/Cargo.toml b/Cargo.toml index 1301cbb..6de2bea 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,6 +3,9 @@ name = "rpn_rs" version = "0.1.0" authors = ["Austen Adler "] edition = "2018" +readme = "README.adoc" +keywords = ["tui", "cli", "rpn"] +categories = ["command-line-utilities"] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/README.adoc b/README.adoc new file mode 100644 index 0000000..6636f3c --- /dev/null +++ b/README.adoc @@ -0,0 +1,70 @@ += rpn_rs +:!webfonts: +:source-highlighter: rouge +:rouge-style: molokai + +== Intro + +=== What is this? + +A TUI link:https://en.wikipedia.org/wiki/Reverse_Polish_notation[RPN] calculator, with inspiration taken from link:https://en.wikipedia.org/wiki/HP_calculators[HP RPN Calculators] and link:https://github.com/mawww/kakoune[Kakoune] that works like link:https://github.com/pelzlpj/orpie[Orpie]. + +It uses link:https://github.com/fdehau/tui-rs[tui-rs] for the UI and link:https://serde.rs/[serde]+link:https://github.com/rust-cli/confy[confy] for configuration loading and saving. + +=== Comparison with existing tools + +* Orpie: has more features at the moment. Matrices, units, more default constants + +== Setup + +[source,sh,title='bash'] +---- +cargo install --git [this url] + +# Run it! +~/.cargo/bin/rpn_rs + +# Or if "${HOME}/.cargo/bin" is in your PATH +rpn_rs +---- + +== Usage + +* `h`: Help menu - shows all keys +* `@`: Show calculator settings like degree/radian, scientific/engineering/separated mode +* ` / `: Push number or Dup +* ``: Save the configuration. On Linux this will be `~/.config/rpn_rs/rpn_rs.toml` +* ``: Load the configuration. This runs by default when you start the calculator. Yes *I know* this should be redraw but not sure what else to use. +* `m`: Show macro menu. Define custom macros in your config +* ``: Show constants menu. Define constants in your config +* `R`: Store bottom of stack in next char's register +* `r`: Recall next char's register +* `e`: When entering a number, applies `* 10^` + +== Lore + +=== Why? + +. I am aware of no good terminal RPN calculators on linux. `dc` is neat but not fun to work with, `orpie` is written in ocaml (but really because Void Linux currently does not have a package in default repos for orpie). +. I wanted to learn Rust. This seemed like a good first project that was actually useful, and the link:https://github.com/fdehau/tui-rs/blob/master/assets/demo.gif[GIF on tui-rs's homepage] make it look really cool. +. I wanted to write or port an HP calculator emulator for terminal/linux, but they seem to all be written for Wandows and porting is hard. Also I would have to figure out how to convert a 131x80 pixel display to terminal. +. I play Minecraft (FTB; PO3) and lots of recipes require exorbitant quantities of items. I wanted an RPN calculator that was programmable (most used recipe being x\64 x%64 to see how many stacks+remainder are required). I wrote this calculator with programability in mind. + +=== Inspiration? + +* link:https://github.com/mawww/kakoune[Kakoune] is my current editor. I like that the programming language *is* the user language. There is no command `line-down`. It's `j`. So when you script in it, you write commands as they are typed. +* Similarly, link:https://en.wikipedia.org/wiki/HP_calculators[HP Calculators] work the same way. The language RPL is the language you use to calculate. Also RPN is really nice to use and you should use it if you don't. +* link:https://github.com/pelzlpj/orpie[Orpie] was the calculator I used + +=== Missing features + +Will I implement these features? I don't know. Lots of these could be done by setting the base type to something complex and not `f64`. But no plans for that. + +* [ ] Pick (generally the up key): I will implement this +* [ ] More accurate digits: I want to do this. `f64`s imprecision is ugly +* Complex numbers: Not sure if I'll implement this +* Matrices: Maybe +* Units: This could be cool +* Bases: Not yet +* Different math operators like `!` or `sum`: If someone asks me to, I guess +* Conditionals: If someone asks me to, I guess