File previews
Review Markdown, JSON, YAML, CSV and SVG files as what they make — a document, data, a table, a picture — with the changes marked in it.
A line diff of a Markdown guide shows you its markup, and a line diff of a pipeline shows you indentation. Neither shows you what changed for the person who reads the guide or the machine that runs the pipeline. Such files open in a Preview: the file as what it makes — a document, data, a table, a picture — with the changes marked in it.
Switch between Code and Preview
The file header has a Code / Preview switch. Code is the source diff, as for every other file; Preview is the view below. In Mantish's own keymap ⌥1 opens Code and ⌥2 the Preview (Alt+1 and Alt+2 on Windows and Linux). Which one a file opens in is yours to choose per format, in Settings › Languages.
What opens as a preview
| File | The Preview |
|---|---|
| Markdown | The document as it reads — headings, lists, tables, code blocks, images — as the Result, Inline (both versions merged) or Side by side |
| JSON | The data, as a Document, a Tree of every key, or a Table of every value by its path |
| YAML | The data as your app loads it, as a Document with its comments and anchors, a Tree with anchors and << merges expanded, or a Table of every value — and a view of its own for the file types below |
| CSV, TSV | A table — the rows and cells that changed, and the columns — as the Result, Inline or Side by side |
| SVG | The picture each version draws, the old one beside the new one |
Pipelines and manifests
With File type chosen — the default — a YAML file Mantish recognises opens in a view made for it:
- a GitHub Actions workflow, by its jobs;
- an Azure Pipelines pipeline, by its stages and jobs;
- Kubernetes manifests, by their resources;
- a Docker Compose file, by its services.
Any other YAML file opens as a Document. A YAML file that is a template — Helm's {{ … }} or Jinja's {% … %} — becomes YAML only once rendered, and the Preview says so.
While you read
- Comments work as in the code: the + beside a block, a row or a value comments on it. Where the window is wide enough they stand in the margin beside the document, as a word processor shows them; otherwise under the row they are on — Settings › Languages › each format › Comments.
- Sticky headings keep the sections you are reading pinned at the top — a document's headings, a workflow's jobs, a manifest's resources, a tree's open branches. Click one to go back to it.
- Find (⌘F over the Preview) searches the document as it is drawn.
- Width — Settings › Languages › Previews keeps a document to a reading column, lets it grow with a wide window, or gives it the whole view.
When a JSON, YAML or CSV file's data did not change although its text did — only formatting, comments or key order — the Preview says so, rather than showing an empty document.
Code files: the structure view
A code file has no Preview; its own way of being read other than line by line is the structure view — its classes and members, what was added, moved or removed.
In the other apps
- JetBrains: in development.
- Terminal: files show their source diff.