Add support for code blocks using markdown syntax. Lines that are
part of the snippet and match the variables regex won't be interpeted as
a variable.
Additionally, add `.cheat.md` as a file extension for cheats so that it
can be rendered on GitHub with proper code formatting and syntax
highlighting.
Fixes#806
With multiple variables in the preview, each with
different «--map» options, there is an application
of the map code for the current variable to the
preview of the other variables as well.
This code fixes that.
Even though the options 'width_percentage' and 'width_min' were allowed
in the config.yaml file for all three columns (tag, comment, snippet),
they were not actually parsed for the snippet column. This patch makes
these settings work.
This CL makes it easier to install navi on multi-tenant Linux systems, by allowing to provide pre-install cheatsheets in shared folders (and potentially pre-installed config in shared folders).
This does not break or change the existing behaviour. The shared directory / config file is only used if
- There is not already a directory / config file in the user XDG location
- Navi is compiled with NAVI_CONFIG_FILE and/or NAVI_CHEATS_DIRECTORY env var set
- The paths defined in above env vars exist
Having a command to install cheatsheets from repositories on github is amazing and makes `navi` very easy to setup and get started. The repo contents provide the "meat" of `navi`. A one-liner can load a bunch of useful cheatsheets for a whole host of open source commands.
However, in locked down environments, where a high level of control of what is executed needs to be imposed, having the capability to download and use "arbitrary code from the internet" can be more harmful than good. Here you would likely want to manage all cheathsheets for `navi` carefully yourself. Possibly reviewing each cheathsheet individually. This CL provides a build feature that disables the whole `repo` sub-command tree to support that use-case.