## Installation
From Source
```sh
cargo install mcat
```
or ~
```sh
git clone https://github.com/Skardyy/mcat
cd mcat
cargo install --path ./crates/core
```
Prebuilt
follow the instructions at the [latest release](https://github.com/Skardyy/mcat/releases/latest)
Homebrew (macOS/Linux)
```sh
brew install mcat
```
AUR (Arch linux)
```sh
yay -S mcat-bin
```
Nix
```nix
environment.systemPackages = [ pkgs.mcat ];
```
Scoop (Windows)
```sh
scoop install mcat
```
## How it works
Advanced explanation
---
| Input |
| ----- |
Inputs can be:
1. local file
2. url
3. bytes from stdin
The type of each input is inferred automatically, and it continues through the pipeline until it reaches the output format the user requested.
| In the pipeline |
| --------------- |
For example, if the user runs:
```
mcat file.docx file.pdf -o inline
```
`mcat` will:
- Convert both `file.docx` and `file.pdf` into a single Markdown file
- Convert that Markdown into HTML
- Convert the HTML into an image
- Convert the image into an inline terminal image and print it
You can also start from the middle of the pipeline.
For example:
```
mcat file.html -o image > image.png
```
This starts at an HTML file and directly converts it into a PNG image.
| Explanation of the blocks |
| ------------------------- |
- **`Markdown`** - set when `-o md` or when the stdout isn't the terminal (piped)
- **`Markdown Viewer`** is markdown with ANSI formatting, and is the **default** for any non video / image file. (the `-c` flag forces it)
- **`HTML`** set when `-o html` -- only works for non image / video files
- **`PNG Image`** set when `-o image` and gives an image
- **`Interactive Viewer`** set when `-o interactive` or `-I` and launches an interactive view to zoom and pan the image in the terminal.
- **`Inline Display`** set when `-o inline` or `-i` and prints the content as image in the terminal
---
## Example Usage
```
…
```
## Support
To see which file types support which features, see the table [here](./support.md).
## Optional Dependencies
> Mcat will continue working without them
Chromium (for rendering HTML/Markdown/Text to image)
---
1. Available by default on most Windows machines via Microsoft Edge.
2. Also works with any installed Chrome, Edge, or Chromium.
3. You can install it manually via `mcat --fetch-chromium`
---
FFmpeg (for videos)
---
1. If it's already on your machine.
2. Otherwise, you can install it with `mcat --fetch-ffmpeg`
---
---