diff --git a/app/views/docs/_docs_topics.html.slim b/app/views/docs/_docs_topics.html.slim index 73c1d80..8b9fd15 100644 --- a/app/views/docs/_docs_topics.html.slim +++ b/app/views/docs/_docs_topics.html.slim @@ -5,5 +5,6 @@ h2 Docs = categories.link_to 'Getting started', docs_path('getting-started'), :'getting-started' = categories.link_to 'Installation', docs_path(:installation), :installation = categories.link_to 'Usage', docs_path(:usage), :usage + = categories.link_to 'Configuration file', docs_path(:config), :config = categories.link_to 'Embedding', docs_path(:embedding), :embedding = categories.link_to 'FAQ', docs_path(:faq), :faq diff --git a/app/views/docs/config.html.md b/app/views/docs/config.html.md new file mode 100644 index 0000000..8cbeeb3 --- /dev/null +++ b/app/views/docs/config.html.md @@ -0,0 +1,49 @@ +<% content_for(:title, 'Configuration file') %> + +# Configuration file + +asciinema uses a config file to keep API token and user settings. In most cases +the location of this file is `$HOME/.config/asciinema/config`. + +When you first run `asciinema`, local API token is generated and saved in the +file (unless the file already exists). It looks like this: + + [api] + token = d5a2dce4-173f-45b2-a405-ac33d7b70c5f + +There are several options you can set in this file. Here's a config with all +available options set: + + [api] + token = d5a2dce4-173f-45b2-a405-ac33d7b70c5f + url = https://asciinema.example.com + + [record] + command = /bin/bash -l + maxwait = 2 + yes = true + + [play] + maxwait = 1 + +The options in `[api]` section are related to API location and authentication. +To tell asciinema recorder to use your own asciinema site instance rather than +the default one (asciinema.org), you can set `url` option. API URL can also be +passed via `ASCIINEMA_API_URL` environment variable. + +The options in `[record]` and `[play]` sections have the same meaning as the +options you pass to `asciinema rec`/`asciinema play` command. If you happen to +often use either `-c`, `-w` or `-y` with these commands then consider saving it +as a default in the config file. + +## Configuration file locations + +In fact, the following locations are checked for the presence of the config +file (in the given order): + +* `$ASCIINEMA_CONFIG_HOME/config` - if you have set `$ASCIINEMA_CONFIG_HOME` +* `$XDG_CONFIG_HOME/asciinema/config` - on Linux, `$XDG_CONFIG_HOME` usually points to `$HOME/.config/` +* `$HOME/.config/asciinema/config` - in most cases it's here +* `$HOME/.asciinema/config` - created by asciinema versions prior to 1.1 + +The first one which is found is used. diff --git a/app/views/docs/usage.html.md b/app/views/docs/usage.html.md index 7c4a1a1..dd0a4da 100644 --- a/app/views/docs/usage.html.md +++ b/app/views/docs/usage.html.md @@ -83,6 +83,6 @@ URL. NOTE: it is __necessary__ to do this if you want to __edit or delete__ your recordings on asciinema.org. -You can synchronize your config file (which keeps the API token) across the -machines but that's not necessary. You can assign new tokens to your account -from as many machines as you want. +You can synchronize your [config file](<%= docs_path(:config) %>) (which keeps +the API token) across the machines but that's not necessary. You can assign new +tokens to your account from as many machines as you want.