Skip to content

Commit

Permalink
docs(#16): adjust readme
Browse files Browse the repository at this point in the history
  • Loading branch information
jannis-baum committed Oct 26, 2023
1 parent 7ba85bb commit 50b2625
Showing 1 changed file with 35 additions and 15 deletions.
50 changes: 35 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ Vivify brings your (Markdown) files to life in the browser!
support](#editor-support))
- Vivify server starts lazily and automatically shuts down when no more viewers
are connected
- customize KaTeX to your needs by providing available [KaTeX
options](#KaTeX-options)
- various [config options](#config)

If you need any additional features, feel free to [open an
issue](https://github.com/jannis-baum/vivify/issues/new/choose) or
Expand All @@ -31,19 +30,40 @@ issue](https://github.com/jannis-baum/vivify/issues/new/choose) or
- syntax highlighting for code
- graphviz/dot graphs

### KaTeX options

Customize KaTeX to your needs by providing an optional
`~/.vivify/katex_config.json` config file with [available KaTeX
options](https://katex.org/docs/options.html). For example:
```
{
"errorColor": "#cc0000",
"macros": {
"\\RR": "\\mathbb{R}"
}
}
```
### Config

Vivify will look for a config file at `~/.vivify/config.json` and
`~/.vivify.json`. This file should contain a JSON object that can have the
following optional keys:

- **`"styles"`**\
a path to a custom style sheet, see [the default
styles](./static/) for examples
- **`"port"`**\
the port Vivify's server should run on; this will be overwritten by
the environment variable `VIV_PORT` (default is 31622)
- **`"timeout"`**\
how long the server should wait in ms before shutting down after
the last client disconnected; this will be overwritten by the environment
variable `VIV_TIMEOUT` (default is 10000)
- **`"openCmd"`**\
the command `viv` uses to open your browser at a given URL; this
will be overwritten by the environment variable `VIV_OPEN` (default will try
`open` and fall back to `xdg-open`)
- **`"pageTitle"`**\
JavaScript code that will be evaluated to determine the
viewer's page title based on the variable `path` for the given file (default
is `join(basename(dirname(path)), basename(path))`, e.g. `my_dir/my_file`)
- **`"katexOptions"`**\
[available KaTeX options](https://katex.org/docs/options.html), such as
```json
{
"errorColor": "#cc0000",
"macros": {
"\\RR": "\\mathbb{R}"
}
}
```

## Usage

Expand Down

0 comments on commit 50b2625

Please sign in to comment.