diff --git a/assets/css/_recording_show.scss b/assets/css/_recording_show.scss index 366c57e48..6b300bf8a 100644 --- a/assets/css/_recording_show.scss +++ b/assets/css/_recording_show.scss @@ -25,8 +25,12 @@ } .actions { - .btn { + .btn-group > div { margin-left: 1rem; + + &:first-child { + margin-left: 0; + } } } } diff --git a/lib/asciinema_web/controllers/doc_controller.ex b/lib/asciinema_web/controllers/doc_controller.ex deleted file mode 100644 index b34a2cc5a..000000000 --- a/lib/asciinema_web/controllers/doc_controller.ex +++ /dev/null @@ -1,28 +0,0 @@ -defmodule AsciinemaWeb.DocController do - use AsciinemaWeb, :controller - alias AsciinemaWeb.{DocView, ErrorView} - - plug :clear_main_class - - @topics ["how-it-works", "getting-started", "installation", "usage", "config", "embedding"] - - def index(conn, _params) do - redirect(conn, to: Routes.doc_path(conn, :show, :"getting-started")) - end - - def show(conn, %{"topic" => topic}) when topic in @topics do - topic = String.to_atom(topic) - - conn - |> assign(:topic, topic) - |> assign(:page_title, DocView.title_for(topic)) - |> put_layout(:docs) - |> render("#{topic}.html") - end - - def show(conn, _params) do - conn - |> put_status(404) - |> render(ErrorView, "404.html") - end -end diff --git a/lib/asciinema_web/router.ex b/lib/asciinema_web/router.ex index 7cd1fd962..85fbbe4f8 100644 --- a/lib/asciinema_web/router.ex +++ b/lib/asciinema_web/router.ex @@ -78,9 +78,6 @@ defmodule AsciinemaWeb.Router do resources "/s", LiveStreamController, only: [:show, :edit, :update] - get "/docs", DocController, :index - get "/docs/:topic", DocController, :show - resources "/login", LoginController, only: [:new, :create], singleton: true get "/login/sent", LoginController, :sent, as: :login diff --git a/lib/asciinema_web/templates/doc/config.html.md b/lib/asciinema_web/templates/doc/config.html.md deleted file mode 100644 index 8d3ffae87..000000000 --- a/lib/asciinema_web/templates/doc/config.html.md +++ /dev/null @@ -1,60 +0,0 @@ -# Configuration file - -You can configure asciinema by creating config file at -`$HOME/.config/asciinema/config`. - -Configuration is split into sections (`[api]`, `[record]`, `[play]`). Here's a -list of all available options for each section: - -```ini -[api] - -; API server URL, default: https://asciinema.org -; If you run your own instance of asciinema-server then set its address here -; It can also be overriden by setting ASCIINEMA_API_URL environment variable -url = https://asciinema.example.com - -[record] - -; Command to record, default: $SHELL -command = /bin/bash -l - -; Enable stdin (keyboard) recording, default: no -stdin = yes - -; List of environment variables to capture, default: SHELL,TERM -env = SHELL,TERM,USER - -; Limit recorded terminal inactivity to max n seconds, default: off -idle_time_limit = 2 - -; Answer "yes" to all interactive prompts, default: no -yes = true - -; Be quiet, suppress all notices/warnings, default: no -quiet = true - -[play] - -; Playback speed (can be fractional), default: 1 -speed = 2 - -; Limit replayed terminal inactivity to max n seconds, default: off -idle_time_limit = 1 -``` - -A very minimal config file could look like that: - -```ini -[record] -idle_time_limit = 2 -``` - -Config directory location can be changed by setting `$ASCIINEMA_CONFIG_HOME` -environment variable. - -If `$XDG_CONFIG_HOME` is set on Linux then asciinema uses -`$XDG_CONFIG_HOME/asciinema` instead of `$HOME/.config/asciinema`. - -> asciinema versions prior to 1.1 used `$HOME/.asciinema`. If you have it -> there you should `mv $HOME/.asciinema $HOME/.config/asciinema`. diff --git a/lib/asciinema_web/templates/doc/embedding.html.md b/lib/asciinema_web/templates/doc/embedding.html.md deleted file mode 100644 index 272c3e74f..000000000 --- a/lib/asciinema_web/templates/doc/embedding.html.md +++ /dev/null @@ -1,175 +0,0 @@ -# Sharing & embedding - -You can share any recording by copying its URL and sending it to a friend or -posting it on a social network. asciinema.org supports oEmbed/Open Graph/Twitter -Card protocols, displaying a nice thumbnail where possible. - -You can also easily embed an asciicast on any HTML page. If you want to put a -recording in a blog post, a project's documentation or in a conference talk's -slides, you can do it by copy-pasting one of the embed scripts. - -## Sharing a link - -You can get the share link for a specific asciicast by clicking on "Share" link -on asciicast page. - -Any of the options listed in "Customizing the playback" section below can be -appended to the asciicast URL as the query params, e.g.: - - https://asciinema.org/a/14?t=25&speed=2&theme=solarized-dark - -Visiting this link will start the playback at 25s and play at double speed, -using Solarized Dark terminal theme. - -## Embedding image link - -Embedding as an image link is useful in places where scripts are not allowed, -e.g. in a project's README file. - -You can get the embed snippets for a specific asciicast by clicking on "Share" -link on asciicast page. - -This is how they look for asciicast 14: - -HTML: - - - -Markdown: - - [![asciicast](https://asciinema.org/a/14.png)](https://asciinema.org/a/14) - -You can pass extra options (listed in "Customizing the playback" below) to the -linked URL as query params. For example, to start the playback automatically -when opening linked asciicast page append `?autoplay=1` to the asciicast URL in -`href` attribute: - - - -## Embedding the player - -If you're embedding on your own page or on a site which permits script tags, you -can use the full player widget. - -You can get the widget script for a specific asciicast by clicking on "Embed" -link on asciicast page. - -It looks like this: - - - -The player shows up right at the place where the script is pasted. Let's look -at the following markup: - -

This is some text.

- -

This is some other text.

- -The player is displayed between the two paragraphs, as a `div` element with -"asciicast" class. - -The embed script supports all customization options (see the section below). An -option can be specified by adding it as a -data-option-name="value" attribute to the script -tag. - -For example, to make the embedded player autostart playback when loaded and use -big font, use the following script: - - - -## Customizing the playback - -The player supports several options that control the behavior and look of it. -Append them to the URL (`?speed=2&theme=tango`) or set them as data attributes -on embed script (`data-speed="2" data-theme="tango"`). - -### **startAt** / **t** - -The `startAt` (or `t`) option specifies the time at which the playback should -start. The default is `startAt=0` (play from the beginning). - -Accepted formats: `ss`, `mm:ss`, `hh:mm:ss`. - -NOTE: when `startAt` is specified then `autoplay=1` is implied. To prevent the -player from starting automatically when `startAt` option is set you have to -explicitly set `autoplay=0`. - -### **autoplay** - -The `autoplay` option controls whether the playback should automatically start -when the player loads. Accepted values: - -* 0 / false - do not start playback automatically (default) -* 1 / true - start playback automatically - -### **preload** - -The `preload` option controls whether the player should immediately start -fetching the recording. - -* 0 / false - do not preload the recording, wait for user action -* 1 / true - preload the recording - -Defaults to 1 for asciinema.org URLs, to 0 for embed script. - -### **loop** - -The `loop` option allows for looping the playback. This option is usually -combined with `autoplay` option. Accepted values: - -* 0 / false - disable looping (default) -* 1 / true - enable looping - -### **speed** - -The `speed` option alters the playback speed. The default speed is 1 which -means it plays at the unaltered, original speed. - -### **idleTimeLimit** / **i** - -The `idleTimeLimit` (or `i`) option allows reducing terminal inactivity periods -to a given number of seconds. - -For example, when set to 2 any inactivity longer than 2 seconds will be -"compressed" to 2 seconds. - -When not specified it defaults to (first non-blank): - -- the "Idle time limit" value set on asciicast's settings page, -- `idle_time_limit` value from asciicast header (saved when passing `-i ` - to `asciinema rec`), -- no limit, when it was not specified at the time of recording. - -### **theme** - -The `theme` option allows overriding a theme used for the terminal. It defaults -to a theme set by the asciicast author (or to "asciinema" if not set by the -author). The available themes are: - -* asciinema -* dracula -* monokai -* nord -* solarized-dark -* solarized-light -* tango - -### **cols** - -The `cols` option allows overriding width (in characters) of the emulated -terminal. By default the recorded terminal's width is used. - -### **rows** - -The `rows` option allows overriding height (in lines) of the emulated terminal. -By default the recorded terminal's height is used. - -## oEmbed / Open Graph / Twitter Card - -asciinema supports [oEmbed](https://oembed.com/), [Open Graph](http://ogp.me/) -and [Twitter Card](https://developer.twitter.com/en/docs/tweets/optimize-with-cards/guides/getting-started) APIs. When you share -an asciicast on Twitter, Slack, Facebook, Google+ or any other site which -supports one of these APIs, the asciicast is presented in a rich form (usually -with a title, author, description and a thumbnail image), linking to your -recording on asciinema.org. diff --git a/lib/asciinema_web/templates/doc/faq.html.md b/lib/asciinema_web/templates/doc/faq.html.md deleted file mode 100644 index 3e7ee3cc4..000000000 --- a/lib/asciinema_web/templates/doc/faq.html.md +++ /dev/null @@ -1,86 +0,0 @@ -# Frequently Asked Questions - -## How is it pronounced? - -_[as-kee-nuh-muh]_. - -The word “asciinema” is a combination of English “ASCII” and Ancient Greek -“κίνημα” (kínēma, “movement”). - -## Why am I getting `command not found` at the begining of the recording session? - -When recording asciinema starts new shell instance (as indicated by `$SHELL` -environment variable) by default. It invokes `exec $SHELL`, which in most -cases translates to `exec /bin/bash` or `exec /bin/zsh`. This means the shell -runs as an "interactive shell", but **not as a "login shell"**. - -If you have functions and/or other shell configuration defined in either -`.bash_profile`, `.zprofile` or `.profile` file they are not loaded unless the -shell is started as a login shell. - -Some terminal emulators do that (passing "-l" option to the shell command-line), -some don't. asciinema doesn't. - -Worry not, you have several options. You can: - -* move this part of configuration to `.bashrc/.zshrc`, -* record with `asciinema rec -c "/bin/bash -l"` or, -* add the following setting to your `$HOME/.config/asciinema/config` file: - -``` -[record] -command = /bin/bash -l -``` - -## Why my shell prompt/theme isn't working during recording? - -See above. - -## Why some of my custom shell functions are not available during recording? - -See above. - -## Does it record the passwords I type during recording? - -asciinema records only terminal output - everything that you can actually see -in a terminal window. It doesn't record input (keys pressed). Some -applications turn off "echo mode" when asking for a password, and because -the passwords are not visible they are not recorded. Some applications -display star characters instead of real characters and asciinema records -only "******". However, some applications don't have any precautions and -the actual password is visible to the user, and thus recorded by asciinema. - -## Can I embed the asciicast player on my blog? - -Yes, see [embedding docs](/docs/embedding). - -## How can I delete my asciicast? - -In order to delete your asciicast you need to associate your local API token -(which was assigned to the recorded asciicast) with the asciinema.org -account. Just run `asciinema auth` in your terminal and open the printed URL -in your browser. Once you sign in you'll see a "Delete" link on your -asciicast's page. - -## Can I have my own asciinema site instance? - -Yes, you can set up your own asciinema site. The source code of the app that -runs asciinema.org is available -[here](https://github.com/asciinema/asciinema-server). - -When you have the site up and running you can easily tell asciinema client to -use it by adding following setting to _~/.config/asciinema/config_ file: - - [api] - url = http://asciinema.example.com - -Alternatively, you can set `ASCIINEMA_API_URL` env variable: - - ASCIINEMA_API_URL=http://asciinema.example.com asciinema rec - -## Can I edit/post-process the recorded asciicast? - -Yes, if you know how to deal with [ansi escape -sequences](https://en.wikipedia.org/wiki/ANSI_escape_code). See documentation -for [asciicast -format](https://github.com/asciinema/asciinema/blob/main/doc/asciicast-v2.md). diff --git a/lib/asciinema_web/templates/doc/getting-started.html.eex b/lib/asciinema_web/templates/doc/getting-started.html.eex deleted file mode 100644 index 5fedab5b6..000000000 --- a/lib/asciinema_web/templates/doc/getting-started.html.eex +++ /dev/null @@ -1,39 +0,0 @@ -

Getting started

- -

1. Install the recorder

- -<%= render "quick_install.html", conn: @conn %> - -

2. Record

- -

- To start recording run the following command: -

- -
asciinema rec
- -

- This spawns a new shell instance and records all terminal output. - When you're ready to finish simply exit the shell either by typing exit or - hitting Ctrl-D. -

- -

- See usage instructions to learn about all commands and options. -

- -

3. Manage your recordings (optional)

- -

- If you want to manage your recordings on asciinema.org (set title/description, - delete etc) you need to authenticate. Run the following command and open - displayed URL in your web browser: -

- -
asciinema auth
- -

- If you skip this step now, you can run the above command later and all - previously recorded asciicasts will automatically get assigned to your - profile. -

diff --git a/lib/asciinema_web/templates/doc/how-it-works.html.md b/lib/asciinema_web/templates/doc/how-it-works.html.md deleted file mode 100644 index 74432cb68..000000000 --- a/lib/asciinema_web/templates/doc/how-it-works.html.md +++ /dev/null @@ -1,74 +0,0 @@ -# How it works - -asciinema project is built of several complementary pieces: - -* command-line based terminal session recorder, `asciinema`, -* website with an API at asciinema.org, -* javascript player - -When you run `asciinema rec` in your terminal the recording starts, capturing -all output that is being printed to your terminal while you're issuing the -shell commands. When the recording finishes (by hitting Ctrl-D or -typing `exit`) then the captured output is uploaded to asciinema.org website -and prepared for playback on the web. - -Here's a brief overview of how these parts work. - -## Recording - -You probably know `ssh`, `screen` or `script` command. Actually, asciinema -was inspired by `script` (and `scriptreplay`) commands. What you may not know -is they all use the same UNIX system capability: [a -pseudo-terminal](http://en.wikipedia.org/wiki/Pseudo_terminal). - -> A pseudo terminal is a pair of pseudo-devices, one of which, the slave, -> emulates a real text terminal device, the other of which, the master, -> provides the means by which a terminal emulator process controls the slave. - -Here's how terminal emulator interfaces with a user and a shell: - -> The role of the terminal emulator process is to interact with the user; to -> feed text input to the master pseudo-device for use by the shell (which is -> connected to the slave pseudo-device) and to read text output from the -> master pseudo-device and show it to the user. - -In other words, pseudo-terminals give programs the ability to act as a -middlemen between the user, the display and the shell. It allows for -transparent capture of user input (keyboard) and terminal output (display). -`screen` command utilizes it for capturing special keyboard shortcuts -like Ctrl-A and altering the output in order to display window -numbers/names and other messages. - -asciinema recorder does its job by utilizing pseudo-terminal for capturing all -the output that goes to a terminal and saving it in memory (together with timing -information). The captured output includes all the text and invisible -escape/control sequences in a raw, unaltered form. When the recording session -finishes it uploads the output (in -[asciicast format](https://github.com/asciinema/asciinema/blob/main/doc/asciicast-v2.md)) -to asciinema.org. That's all about "recording" part. - -For the implementation details check out [recorder source -code](https://github.com/asciinema/asciinema). - -## Playback - -As the recording is a raw stream of text and control -sequences it can't be just played by incrementally printing text in proper -intervals. It requires interpretation of [ANSI escape code -sequences](http://en.wikipedia.org/wiki/ANSI_escape_code) in order to -correctly display color changes, cursor movement and printing text at proper -places on the screen. - -The player comes with its own terminal emulator based on -[Paul Williams' parser for ANSI-compatible video terminals](https://vt100.net/emu/dec_ansi_parser). -It covers only the display part of the emulation as this is what the player is -about (input is handled by your terminal+shell at the time of recording anyway) -and its handling of escape sequences is fully compatible with most modern -terminal emulators like xterm, Gnome Terminal, iTerm, mosh etc. - -The end result is a smooth animation with all text attributes (bold, -underline, inverse, ...) and 256 colors perfectly rendered. - -For the implementation details check out [asciinema.org website source -code](https://github.com/asciinema/asciinema-server) and [player source -code](https://github.com/asciinema/asciinema-player). diff --git a/lib/asciinema_web/templates/doc/installation.html.md b/lib/asciinema_web/templates/doc/installation.html.md deleted file mode 100644 index 795f7f35c..000000000 --- a/lib/asciinema_web/templates/doc/installation.html.md +++ /dev/null @@ -1,158 +0,0 @@ -# Installation - -There are several ways to get asciinema recorder: - -- [Installing via Pip](#installing-via-pip) -- [Installing on Linux](#installing-on-linux) -- [Installing on macOS](#installing-on-macos) -- [Installing on FreeBSD](#installing-on-freebsd) -- [Installing on OpenBSD](#installing-on-openbsd) -- [Running in a container](#running-in-a-container) -- [Running from source](#running-from-source) - -If you use other operating system and you can build a native package for it then -don't hesitate, do it and let us know. We have [Github -issue](https://github.com/asciinema/asciinema/issues/116) where we track new -releases and packaging progress. - -## Installing via Pip -{: #installing-via-pip} - -asciinema is available on [PyPI](https://pypi.python.org/pypi/asciinema) and can -be installed with pip (Python 3 required): - - sudo pip3 install asciinema - -This is the universal installation method for all operating systems, which -always provides the latest version. - -## Installing on Linux -{: #installing-on-linux} - -### Arch Linux - - pacman -S asciinema - -### Debian - - sudo apt-get install asciinema - -### Fedora - -For Fedora < 22: - - sudo yum install asciinema - -For Fedora >= 22: - - sudo dnf install asciinema - -### Gentoo Linux - - emerge -av asciinema - -### NixOS / Nix - - nix-env -i asciinema - -### openSUSE - - zypper in asciinema - -### Ubuntu - - sudo apt-add-repository ppa:zanchey/asciinema - sudo apt-get update - sudo apt-get install asciinema - -## Installing on macOS -{: #installing-on-macos} - -### Homebrew - - brew install asciinema - -### MacPorts - - sudo port selfupdate && sudo port install asciinema - -### Nix - - nix-env -i asciinema - -## Installing on FreeBSD -{: #installing-on-freebsd} - -### Ports - - cd /usr/ports/textproc/py-asciinema && make install - -### Packages - - pkg install py39-asciinema - -## Installing on OpenBSD -{: #installing-on-openbsd} - - pkg_add asciinema - -## Running in a container -{: #running-in-a-container} - -asciinema Docker image is based on [Ubuntu -22.04](https://releases.ubuntu.com/22.04/) and has the latest version of -asciinema recorder pre-installed. - -```sh -docker pull ghcr.io/asciinema/asciinema -``` - -When running it don't forget to allocate a pseudo-TTY (`-t`), keep STDIN open -(`-i`) and mount config directory volume (`-v`): - -```sh -docker run --rm -it -v "${HOME}/.config/asciinema:/root/.config/asciinema" ghcr.io/asciinema/asciinema rec -``` - -Container's entrypoint is set to `/usr/local/bin/asciinema` so you can run the -container with any arguments you would normally pass to `asciinema` binary (see -Usage section for commands and options). - -There's not much software installed in this image though. In most cases you may -want to install extra programs before recording. One option is to derive new -image from this one (start your custom Dockerfile with `FROM -ghcr.io/asciinema/asciinema`). Another option is to start the container with -`/bin/bash` as the entrypoint, install extra packages and manually start -`asciinema rec`: - -```console -docker run --rm -it -v "${HOME}/.config/asciinema:/root/.config/asciinema" --entrypoint=/bin/bash ghcr.io/asciinema/asciinema rec -root@6689517d99a1:~# apt-get install foobar -root@6689517d99a1:~# asciinema rec -``` - -It is also possible to run the docker container as a non-root user, which has -security benefits. You can specify a user and group id at runtime to give the -application permission similar to the calling user on your host. - -```sh -docker run --rm -it \ - --env=ASCIINEMA_CONFIG_HOME="/run/user/$(id -u)/.config/asciinema" \ - --user="$(id -u):$(id -g)" \ - --volume="${HOME}/.config/asciinema:/run/user/$(id -u)/.config/asciinema:rw" \ - --volume="${PWD}:/data:rw" \ - --workdir='/data' \ - ghcr.io/asciinema/asciinema rec -``` - -## Running from source -{: #running-from-source} - -If none of the above works for you (or you want to help with development) just -clone the repo and run latest version of asciinema straight from the main -branch: - - git clone https://github.com/asciinema/asciinema.git - cd asciinema - git checkout main - python3 -m asciinema --version diff --git a/lib/asciinema_web/templates/doc/quick_install.html.eex b/lib/asciinema_web/templates/doc/quick_install.html.eex deleted file mode 100644 index fd85fd083..000000000 --- a/lib/asciinema_web/templates/doc/quick_install.html.eex +++ /dev/null @@ -1,9 +0,0 @@ -

- Install asciinema with: -

- -
brew install asciinema
- -

- See other installation options. -

diff --git a/lib/asciinema_web/templates/doc/topic_link.html.eex b/lib/asciinema_web/templates/doc/topic_link.html.eex deleted file mode 100644 index 379ce89fe..000000000 --- a/lib/asciinema_web/templates/doc/topic_link.html.eex +++ /dev/null @@ -1 +0,0 @@ - diff --git a/lib/asciinema_web/templates/doc/topics.html.eex b/lib/asciinema_web/templates/doc/topics.html.eex deleted file mode 100644 index abe4931e2..000000000 --- a/lib/asciinema_web/templates/doc/topics.html.eex +++ /dev/null @@ -1,11 +0,0 @@ -

Docs

- - diff --git a/lib/asciinema_web/templates/doc/usage.html.md b/lib/asciinema_web/templates/doc/usage.html.md deleted file mode 100644 index 2cd8f0f0e..000000000 --- a/lib/asciinema_web/templates/doc/usage.html.md +++ /dev/null @@ -1,149 +0,0 @@ -# Usage - -asciinema is composed of multiple commands, similar to `git`, `apt-get` or -`brew`. - -When you run `asciinema` with no arguments help message is displayed, listing -all available commands with their options. - -## `rec [filename]` - -__Record terminal session.__ - -By running `asciinema rec [filename]` you start a new recording session. The -command (process) that is recorded can be specified with `-c` option (see -below), and defaults to `$SHELL` which is what you want in most cases. - -Recording finishes when you exit the shell (hit Ctrl+D or type -`exit`). If the recorded process is not a shell then recording finishes when -the process exits. - -If the `filename` argument is omitted then (after asking for confirmation) the -resulting asciicast is uploaded to -[asciinema-server](https://github.com/asciinema/asciinema-server) (by default to -asciinema.org), where it can be watched and shared. - -If the `filename` argument is given then the resulting recording (called -[asciicast](https://github.com/asciinema/asciinema/blob/main/doc/asciicast-v2.md)) -is saved to a local file. It can later be replayed with `asciinema play -` and/or uploaded to asciinema server with `asciinema upload -`. - -`ASCIINEMA_REC=1` is added to recorded process environment variables. This -can be used by your shell's config file (`.bashrc`, `.zshrc`) to alter the -prompt or play a sound when the shell is being recorded. - -Available options: - -* `--stdin` - Enable stdin (keyboard) recording (see below) -* `--append` - Append to existing recording -* `--raw` - Save raw STDOUT output, without timing information or other metadata -* `--overwrite` - Overwrite the recording if it already exists -* `-c, --command=` - Specify command to record, defaults to $SHELL -* `-e, --env=` - List of environment variables to capture, defaults - to `SHELL,TERM` -* `-t, --title=` - Specify the title of the asciicast -* `-i, --idle-time-limit=<sec>` - Limit recorded terminal inactivity to max `<sec>` seconds -* `-y, --yes` - Answer "yes" to all prompts (e.g. upload confirmation) -* `-q, --quiet` - Be quiet, suppress all notices/warnings (implies -y) - -Stdin recording allows for capturing of all characters typed in by the user in -the currently recorded shell. This may be used by a player (e.g. -[asciinema-player](https://github.com/asciinema/asciinema-player)) to display -pressed keys. Because it's basically a key-logging (scoped to a single shell -instance), it's disabled by default, and has to be explicitly enabled via -`--stdin` option. - -## `play <filename>` - -__Replay recorded asciicast in a terminal.__ - -This command replays given asciicast (as recorded by `rec` command) directly in -your terminal. - -Following keyboard shortcuts are available: - -- <kbd>Space</kbd> - toggle pause, -- <kbd>.</kbd> - step through a recording a frame at a time (when paused), -- <kbd>Ctrl+C</kbd> - exit. - -Playing from a local file: - - asciinema play /path/to/asciicast.cast - -Playing from HTTP(S) URL: - - asciinema play https://asciinema.org/a/22124.cast - asciinema play http://example.com/demo.cast - -Playing from asciicast page URL (requires `<link rel="alternate" -type="application/x-asciicast" href="/my/ascii.cast">` in page's HTML): - - asciinema play https://asciinema.org/a/22124 - asciinema play http://example.com/blog/post.html - -Playing from stdin: - - cat /path/to/asciicast.cast | asciinema play - - ssh user@host cat asciicast.cast | asciinema play - - -Playing from IPFS: - - asciinema play dweb:/ipfs/QmNe7FsYaHc9SaDEAEXbaagAzNw9cH7YbzN4xV7jV1MCzK/ascii.cast - -Available options: - -* `-i, --idle-time-limit=<sec>` - Limit replayed terminal inactivity to max `<sec>` seconds -* `-s, --speed=<factor>` - Playback speed (can be fractional) - -> For the best playback experience it is recommended to run `asciinema play` in -> a terminal of dimensions not smaller than the one used for recording, as -> there's no "transcoding" of control sequences for new terminal size. - -## `cat <filename>` - -__Print full output of recorded asciicast to a terminal.__ - -While `asciinema play <filename>` replays the recorded session using timing -information saved in the asciicast, `asciinema cat <filename>` dumps the full -output (including all escape sequences) to a terminal immediately. - -`asciinema cat existing.cast >output.txt` gives the same result as recording via -`asciinema rec --raw output.txt`. - -## `upload <filename>` - -__Upload recorded asciicast to asciinema.org site.__ - -This command uploads given asciicast (recorded by `rec` command) to -asciinema.org, where it can be watched and shared. - -`asciinema rec demo.cast` + `asciinema play demo.cast` + `asciinema upload -demo.cast` is a nice combo if you want to review an asciicast before -publishing it on asciinema.org. - -## `auth` - -__Link your install ID with your asciinema.org user account.__ - -If you want to manage your recordings (change title/theme, delete) at -asciinema.org you need to link your "install ID" with asciinema.org user -account. - -This command displays the URL to open in a web browser to do that. You may be -asked to log in first. - -Install ID is a random ID ([UUID -v4](https://en.wikipedia.org/wiki/Universally_unique_identifier)) generated -locally when you run asciinema for the first time, and saved at -`$HOME/.config/asciinema/install-id`. It's purpose is to connect local machine -with uploaded recordings, so they can later be associated with asciinema.org -account. This way we decouple uploading from account creation, allowing them to -happen in any order. - -> A new install ID is generated on each machine and system user account you use -> asciinema on, so in order to keep all recordings under a single asciinema.org -> account you need to run `asciinema auth` on all of those machines. - -> asciinema versions prior to 2.0 confusingly referred to install ID as "API -> token". diff --git a/lib/asciinema_web/templates/layout/_donate_modal.html.heex b/lib/asciinema_web/templates/layout/_donate_modal.html.heex deleted file mode 100644 index 135320f53..000000000 --- a/lib/asciinema_web/templates/layout/_donate_modal.html.heex +++ /dev/null @@ -1,54 +0,0 @@ -<div class="modal fade" id="donate-modal" tabindex="-1" role="dialog" aria-hidden="true"> - <div class="modal-dialog modal-lg" role="document"> - <div class="modal-content"> - <div class="modal-header"> - <h5 class="modal-title">Support asciinema</h5> - <button type="button" class="close" data-dismiss="modal" aria-label="Close"> - <span aria-hidden="true">×</span> - </button> - </div> - - <div class="modal-body"> - <p>Hi, I'm <a href="https://github.com/ku1ik">Marcin</a>, the creator - and dedicated maintainer of the asciinema project.</p> - - <p>Please consider becoming a patron if you ever thought, "Wow, that's - cool!" about asciinema. Your support would allow me to dedicate more - time to the project, ensuring continuous maintenance, development of new - features, timely bug fixes, and the smooth operation of asciinema.org.</p> - - <hr /> - - <h3> - Sponsor via Github Sponsors - </h3> - - <p> - <a href="https://github.com/sponsors/ku1ik" class="btn btn-sm btn-gh-sponsors"> - 🩷  Sponsor - </a> - </p> - - <hr /> - - <h3> - Donate via Liberapay - </h3> - - <p> - <a href="https://liberapay.com/ku1ik/donate"> - <img - alt="Donate using - Liberapay" - src="https://liberapay.com/assets/widgets/donate.svg" - /> - </a> - </p> - - <hr /> - - <p>Thank you! ❤️</p> - </div> - </div> - </div> -</div> diff --git a/lib/asciinema_web/templates/layout/_header.html.heex b/lib/asciinema_web/templates/layout/_header.html.heex index 958c2998a..b6d908763 100644 --- a/lib/asciinema_web/templates/layout/_header.html.heex +++ b/lib/asciinema_web/templates/layout/_header.html.heex @@ -20,17 +20,17 @@ <div class="collapse navbar-collapse" id="navbarNavDropdown"> <ul class="navbar-nav mr-auto"> <li class="nav-item"> - <a class="nav-link" href={~p"/explore"}>Explore</a> + <a class="nav-link" href="https://docs.asciinema.org/getting-started/"> + Get Started + </a> </li> <li class="nav-item"> - <a class="nav-link" href={~p"/docs/getting-started"}> - Record - </a> + <a class="nav-link" href={~p"/explore"}>Explore</a> </li> <li class="nav-item"> - <a class="nav-link" href={~p"/docs/how-it-works"}>Docs</a> + <a class="nav-link" href="https://docs.asciinema.org/">Docs</a> </li> </ul> diff --git a/lib/asciinema_web/templates/layout/app.html.heex b/lib/asciinema_web/templates/layout/app.html.heex index 993bc75bb..c0ba49586 100644 --- a/lib/asciinema_web/templates/layout/app.html.heex +++ b/lib/asciinema_web/templates/layout/app.html.heex @@ -23,7 +23,6 @@ </main> <%= render("_footer.html", conn: @conn) %> - <%= render("_donate_modal.html") %> <script phx-track-static src={Routes.static_path(@conn, "/js/app.js")}> </script> </body> diff --git a/lib/asciinema_web/templates/recording/_download_modal.html.eex b/lib/asciinema_web/templates/recording/_download_modal.html.eex index 79f885312..51c358af4 100644 --- a/lib/asciinema_web/templates/recording/_download_modal.html.eex +++ b/lib/asciinema_web/templates/recording/_download_modal.html.eex @@ -30,7 +30,7 @@ <pre><code>asciinema play <%= download_filename(@asciicast) %></code></pre> <p> - If you don't have asciinema CLI installed then <a href="<%= Routes.doc_path(@conn, :show, :installation) %>">see installation instructions</a>. + If you don't have asciinema CLI installed then <a href="https://docs.asciinema.org/manual/cli/installation/">see installation instructions</a>. </p> <h2>Use with stand-alone player on your website</h2> diff --git a/lib/asciinema_web/templates/recording/_share_modal.html.eex b/lib/asciinema_web/templates/recording/_share_modal.html.eex index 04cc4e6cd..9c0539072 100644 --- a/lib/asciinema_web/templates/recording/_share_modal.html.eex +++ b/lib/asciinema_web/templates/recording/_share_modal.html.eex @@ -49,8 +49,7 @@ <hr> - <p>See <a href="<%= Routes.doc_path(@conn, :show, :embedding) %>">Sharing & embedding</a> for additional options.</p> - + <p>See <a href="https://docs.asciinema.org/manual/server/embedding/">embedding docs</a> for additional options.</p> </div> </div> </div> diff --git a/lib/asciinema_web/templates/recording/show.html.heex b/lib/asciinema_web/templates/recording/show.html.heex index 6d41cc8ad..8cdec540c 100644 --- a/lib/asciinema_web/templates/recording/show.html.heex +++ b/lib/asciinema_web/templates/recording/show.html.heex @@ -8,7 +8,7 @@ <section class="even info"> <div class="container"> <div class="row"> - <div class="col-md-8 col-xs-12"> + <div class="col-lg-8 col-md-7 col-xs-12"> <span class="author-avatar"> <.link navigate={author_profile_path(@asciicast)} title={author_username(@asciicast)}> <img src={author_avatar_url(@asciicast)} class="avatar" /> @@ -36,7 +36,7 @@ </small> </div> - <div class="col-md-4 col-xs-12 text-right actions"> + <div class="col-lg-4 col-md-5 col-xs-12 text-right actions"> <div class="btn-group pull-right"> <div> <.link diff --git a/lib/asciinema_web/templates/user/show.html.heex b/lib/asciinema_web/templates/user/show.html.heex index 91ff8b18a..0fdbf7973 100644 --- a/lib/asciinema_web/templates/user/show.html.heex +++ b/lib/asciinema_web/templates/user/show.html.heex @@ -41,7 +41,7 @@ <%= case {@asciicast_count, @user_is_self} do %> <% {0, true} -> %> <p> - Make sure you have asciinema recorder <a href={~p"/docs/installation"}>installed</a>. + Make sure you have asciinema recorder <a href="https://docs.asciinema.org/manual/cli/installation/">installed</a>. </p> <p> diff --git a/test/controllers/doc_controller_test.exs b/test/controllers/doc_controller_test.exs deleted file mode 100644 index b565388bb..000000000 --- a/test/controllers/doc_controller_test.exs +++ /dev/null @@ -1,25 +0,0 @@ -defmodule Asciinema.DocControllerTest do - use AsciinemaWeb.ConnCase - - test "GET /docs", %{conn: conn} do - conn = get(conn, "/docs") - assert redirected_to(conn, 302) == "/docs/getting-started" - end - - test "GET /docs/*", %{conn: conn} do - Enum.each( - [ - "/docs/how-it-works", - "/docs/getting-started", - "/docs/installation", - "/docs/usage", - "/docs/config", - "/docs/embedding" - ], - fn path -> - conn = get(conn, path) - assert html_response(conn, 200) =~ "<h2>Docs</h2>" - end - ) - end -end