/micro-preview

A simple Micro editor plugin to preview markdown files using Pandoc.

Primary LanguageLuaGNU General Public License v3.0GPL-3.0

Micro-preview


A very simple plugin for the Micro editor to preview markdown using Pandoc.

Pandoc is also the only external dependency needed to run this plugin. I have not tested this with anything else than version 2.0.11 of Micro, so your mileage might vary.

Installation

Settings

Add this repo as a pluginrepos option in the ~/.config/micro/settings.json file (it is necessary to restart the micro after this change):

{
  "pluginrepos": [
      "https://raw.githubusercontent.com/weebi/micro-preview/master/repo.json"
  ]
}

Install

In your micro editor press Ctrl-e and run command:

> plugin install preview

or run in your shell

micro -plugin install preview

Usage

When installed, the plugin creates the preview command which splits the window vertically and opens a pane on the right side containing the converted markdown.

The preview window should update every time you save, but can also be forcibly updated by running preview again.

Configuration

For now, the default configuration looks like this:

{
  "preview.input_format": "gfm",
  "preview.output_format": "plain",
  "preview.extra_args": "--reference-links --reference-location=document"
}

All of the possible values for input_format and output_format can be listed using pandoc --list-output-formats and pandoc --list-input-formats.

The value for extra_args can be anything from pandoc --help.