mirror of
https://github.com/tiffany352/rink-rs
synced 2024-11-10 13:44:15 +00:00
a0ddd52bdb
Kind of silly that I'm already on the third iteration of the website. But the previous one was a bit over-engineered and hard to maintain. I actually can't even get it to compile anymore, it errors out while trying to build the wasm binary. So it was either migrate from sapper (which is deprecated and broken) to svelte-kit (the successor to sapper), or to simplify. I simplified. The new tech jenga tower is: - Soupault for building the website - AsciiDoctor for the pages - cmark-gfm for processing the markdown in the github releases - Several plugins and scripts copied from my personal website - Vite for compiling the javascript - wasm-pack for building the wasm binary Rink's website will now be completely static, so operating it is easier. The javascript and wasm is quarantined to the index page where a rink repl is active, the other pages are plain html. The currency fetching is now a totally separate piece of code from the website. It makes it simpler and requires less code to be loaded during the regular cron job. The javascript is way simpler now. It only manipulates the part of the page that need to be dynamic. It also uses the token format machinery instead of directly converting rink's output AST to html. Pros: - Way lighter, faster page load times. - Easier to maintain. - Site contains more information now. An about page, the manual, and a releases tab with DL links. - No more URL spam that makes search engines think the site is a content farm. - Actually acts as a REPL now so you can run multiple queries, use `ans`, up/down arrows to re-run previous queries. - Proper sandboxing - queries that timeout cause the worker to be killed and restarted. - Now has a progress indicator on downloading the wasm blob, which is good on slow connections. Cons: - Even more of a custom setup than before. - It doesn't work offline anymore. At least not until I add a new service worker, which will be a real pain to debug. - The interactive parts (the rink REPL) require javascript to work now. - A lot of the old URLs like `/query/abc` and `/units/meter` are broken. I think this is fine though. I can add redirects in nginx that point them to `/?q=abc` and `/?q=meter`. ## Screenshots ### REPL ![image](https://github.com/tiffany352/rink-rs/assets/1254344/7e43fe58-134f-425c-b975-997797fc1af4) ### About page ![image](https://github.com/tiffany352/rink-rs/assets/1254344/d6a34ce5-a357-434c-b7e9-9ddee3884223)
157 lines
3.9 KiB
Text
157 lines
3.9 KiB
Text
ifndef::website[]
|
|
= rink(5)
|
|
:manmanual: Rink Manual
|
|
:mansource: Rink Manual
|
|
|
|
Name
|
|
----
|
|
rink - TOML configuration file format.
|
|
endif::[]
|
|
|
|
Description
|
|
-----------
|
|
Rink's configuration file uses the TOML format.
|
|
|
|
Duration types accept common suffixes like `ms`, `s`, `h`, `d`, `y`.
|
|
Size types accept suffixes like `MB`.
|
|
|
|
Color strings are a set of keywords separated by spaces. The following
|
|
keywords are understood:
|
|
|
|
*black*, *red*, *green*, *yellow*, *blue*, *purple*, *cyan*, *white*::
|
|
Sets the color to that ANSI color.
|
|
*dim*/*dimmed*::
|
|
Uses a dimmed variant of the color instead of the bright variant.
|
|
*bold*, *italic*, *underline*/*under*, *strikethrough*::
|
|
Formatting.
|
|
*hidden*/*none*::
|
|
Makes the text invisible.
|
|
*on*::
|
|
The color keyword after this will apply to the background instead of
|
|
the foreground. Example: `black on red`.
|
|
*default*/*plain*::
|
|
Results in unstyled text.
|
|
integers 0 to 255::
|
|
Extended terminal color palette codes.
|
|
*#* <__6 hex letters__>::
|
|
Hex codes can be used to specify truecolor.
|
|
Example: `#000000`
|
|
*rgb(* <__red__> *,* <__green__> *,* <__blue__> *)*::
|
|
RGB values can be used to specify truecolor. No spaces are allowed.
|
|
Example: `rgb(10,10,10)`
|
|
|
|
Rink
|
|
~~~~
|
|
The `[rink]` section.
|
|
|
|
*prompt* = <__string__>::
|
|
The text that will be displayed before the cursor, to hint
|
|
interactivity. Should include the space character.
|
|
Default: `"> "`
|
|
|
|
*long_output* = <__bool__>::
|
|
Breaks lists, such as search results, over multiple lines. Requires
|
|
a Unicode-capable terminal.
|
|
Default: `false`
|
|
|
|
Currency
|
|
~~~~~~~~
|
|
The `[currency]` section.
|
|
|
|
*enabled* = <__bool__>::
|
|
Currency fetching can be disabled for those that don't want it.
|
|
Default: `true`
|
|
|
|
*endpoint* = <__url__>::
|
|
Allows pointing to alternate Rink-Web instances, or to any other API
|
|
that offers a compatible format.
|
|
Default: `"https://rinkcalc.app/data/currency.json"`
|
|
|
|
*timeout* = <__duration__>::
|
|
How long to wait for currency fetching before giving up.
|
|
Default: `"2s"`
|
|
|
|
*cache_duration* = <__duration__>::
|
|
How long to wait before considering the cached currency data stale.
|
|
Default: `"1h"`
|
|
|
|
Colors
|
|
~~~~~~
|
|
The `[colors]` section.
|
|
|
|
*enabled* = <__bool__>::
|
|
Set to true to turn on colored output.
|
|
Default: `true`, or `false` if the `NO_COLOR` environment variable is set.
|
|
|
|
*theme* = <__string__>::
|
|
Sets the active theme. See the THEMES section.
|
|
Default: `"default"`
|
|
|
|
Themes
|
|
~~~~~~
|
|
The `[themes]` section. This section is a dictionary, each theme should be
|
|
created as `[themes.my_theme]`. These options are specific to each.
|
|
|
|
*plain* = <__color__>::
|
|
Generic text. This will be used often.
|
|
Default: `"default"`
|
|
|
|
*error* = <__color__>::
|
|
Error messages.
|
|
Default: `"red"`
|
|
|
|
*unit* = <__color__>::
|
|
The names of units, like `kilogram`.
|
|
Default: `"cyan"`
|
|
|
|
*quantity* = <__color__>::
|
|
The names of physical quantities, like `length` and `time`. These
|
|
are shown in parentheses on every query.
|
|
Default: `"dimmed cyan"`
|
|
|
|
*number* = <__color__>::
|
|
Numbers that appear in outputs.
|
|
Default: `"default"`
|
|
|
|
*user_input* = <__color__>::
|
|
Used when rink is quoting user input back, such as in unit not found
|
|
errors.
|
|
Default: `"bold"`
|
|
|
|
*doc_string* = <__color__>::
|
|
Used when rink is showing informational text that's part of the
|
|
definition of a unit, like `meter`.
|
|
Default: `"italic"`
|
|
|
|
*pow* = <__color__>::
|
|
The `^2` in `m/s^2`.
|
|
Default: `"default"`
|
|
|
|
*prop_name* = <__color__>::
|
|
Names of properties in substances, like the `speed` in `speed of
|
|
light`.
|
|
Default: `"cyan"`
|
|
|
|
*date_time* = <__color__>::
|
|
Date time objects, that can be obtained with the hash notation or
|
|
`now`.
|
|
Default: `"default"`
|
|
|
|
Files
|
|
-----
|
|
Linux::
|
|
++__$XDG_CONFIG_DIR__/rink/config.toml++
|
|
|
|
Windows::
|
|
++__{FOLDERID_RoamingAppData}__\rink\config.toml++
|
|
|
|
macOS::
|
|
++__$HOME__/Library/Application Support/rink/config.toml++
|
|
|
|
ifndef::website[]
|
|
See also
|
|
--------
|
|
xref:rink.1.adoc[rink(1)], xref:rink.7.adoc[rink(7)],
|
|
xref:rink-defs.5.adoc[rink-defs(5)],
|
|
xref:rink-dates.5.adoc[rink-dates(5)]
|
|
endif::[]
|