Preview document wrtting in YOUR markdown.

Overview

Glance Vim

Do you know the number of Markdown flavours in the world? Everyone has an own flavour. It's hard to find the suitable Markdown previewer for your own flavored Markdown.

Glance Vim is YOUR previewer. You do not to wander anymore. Because this plugin provides a mechanism to customize renderer using markdown-it plugins.

If you want to use emoji in the markdown, then you just need to append markdown-it-emoji to g:glance#plugins

let g:glance#plugins = ['https://esm.sh/markdown-it-emoji']

The renderer dynamically loads your plugin with dynamic import in Deno, then it renders the buffer content with markdown-it, and finally it sends the HTML document to the browwser.

Of couse, Glance Vim also provide features as follows.

  • Spy the cursor motion in Vim.
  • Append custom preamble in a head of HTML output.
  • Synchronize content between the buffer and the browser.
  • Offline mode, Deno caches the markdown-it plugins.

Let's write document in your own flavoured Markdown.

Installation

This plugin requires denops.vim and Deno.

Plug 'vim-denops/denops.vim'
Plug 'tani/glance-vim'

Usage

Please hit the command :Glance in Vim and open http://localhost:8765 in the browser.

  • g:glance#server_port (8765) is a port number to serve the previewer.
  • g:glance#markdown_plugins ([]) is a list of URLs for the markdown-it plugins.
  • g:glance#markdown_html (v:false) is a boolean value to be enable HTML tags in markdown.
  • g:glance#markdown_linkify (v:false) is a boolean vlaue to render URLs as a elments .
  • g:glance#markdown_breaks (v:false) is a boolean vlaue to convert newlines into br elements.
  • g:glance#stylesheet ('') is a string, which will be appended as a CSS stylesheet..

Advanced Usage

Glance Vim has an interface to extend the MarkdownIt renderer in TypeScript.

Step1: Set path of configuration file g:glance#config such as ~/.config/glance/init.ts

let g:glance#config = extend('~/.config/glance/init.ts')

Step2: Write a configuration in TypeScript.

// ~/.config/glance/init.ts
import markdownItEmoji from 'https://esm.sh/markdown-it-emoji'
import MarkdownIt from 'https://esm.sh/markdown-it'

export function createMarkdownRenderer(md: MarkdownIt): MarkdownIt {
  return md.use(markdownItEmoji);
}

Related Plugins

Copyright and License

Copyrihgt (c) 2022 TANIGUCHI Masaya. All rights reserved. This plugin is released under MIT License

You might also like...

A tool to document your package.json scripts

A tool to document your package.json scripts

why A tool to document your package.json scripts Why why? As your project grows you add more scripts to package.json. When a new member joins the proj

Sep 22, 2022

Smart Time Ago is a little jQuery library to update the relative timestamps in your document.

Smart Time Ago Smart Time Ago is a little jQuery library to update the relative timestamps in your document intelligently. (e.g "3 hours ago"). It's o

Dec 6, 2022

Automatically document all of your Remix loaders and actions typings per each route. 📚

Automatically document all of your Remix loaders and actions typings per each route. 📚

About remix-docs-gen parses all of your Remix loaders and actions and automatically documents all the typings per each route. Installation First, you

Nov 9, 2022

Fully-typed utilities for defining, validating and building your document head

zhead Typed utilities for defining, validating and building best-practice document head's. Status: Pre-release Please report any issues 🐛 Made poss

Dec 21, 2022

This Photoshop script exports all top-level layers and groups to cropped PNG and JPEG files and creates a file usable in Tumult Hype 4 based on your Photoshop document.

This Photoshop script exports all top-level layers and groups to cropped PNG and JPEG files and creates a file usable in Tumult Hype 4 based on your Photoshop document.

Export To Hype (Photoshop Edition) This Photoshop script exports all top-level layers and groups to cropped PNG and JPEG files and creates a file usab

Nov 9, 2022

DGPreview - Make UIKit project enable preview feature of SwiftUI

DGPreview - Make UIKit project enable preview feature of SwiftUI

DGPreview Make UIKit project enable preview feature of SwiftUI Requirements iOS

Feb 14, 2022

Ultra Math Preview for VS Code

 Ultra Math Preview for VS Code

Ultra Math Preview for VS Code Real-time math preview for latex and markdown. Usage Install this extension, and then put your cursor into math block i

Dec 19, 2022

Utility for generating preview images of StarCraft: Brood War and Remastered maps

bwpreview Utility for generating preview images of StarCraft: Brood War and Remastered maps (.scm and .scx files). All of the actual work of parsing m

Oct 14, 2022

Preview Notion's private links in Slack

Preview Notion's private links in Slack

slack-notion-preview English | 日本語 Description A Slack App that shows a preview of a private Notion link posted to Slack. Features Notion article titl

Nov 16, 2022
Comments
  • fix: replace servest with oak

    fix: replace servest with oak

    • build(deno.json): remove experimentalDecorators compiler option
    • fix(server): migrate to Oak from Servest, which has been already deprecated

    Glance has been unable to launch with the following error:

    [denops] glance: TypeError: Module not found "https://dev.jspm.io/npm:@types/[email protected]/index.d.ts".
    [denops]     at https://deno.land/x/[email protected]/vendor/https/dev.jspm.io/@types/prop-types/index.d.ts:1:15
    

    This is because servest has been deprecated.

    opened by hasundue 5
  • feat: on-demand initializaiton

    feat: on-demand initializaiton

    Hi, tani san. Thank you for such a nice plugin!

    This PR modifies glance to start the server when :Glance is executed, not when the plugin is loeded. I believe this is always a better behavior, but I don't mind even if the feature is enabled by an option.

    I did some refactoring as well.

    opened by hasundue 1
Owner
TANIGUCHI Masaya
I am a LISP interpreter.
TANIGUCHI Masaya
Get an isolated preview database for every Netlify Preview Deployment

Netlify Preview Database Plugin Create an isolated preview database for each preview deployment in Netlify Quickstart • Website • Docs • Discord • Twi

Snaplet 10 Nov 16, 2022
A plugin for the Obsidian markdown note application, adding functionality to render markdown documents with multiple columns of text.

Multi-Column Markdown Take your boring markdown document and add some columns to it! With Multi Column Markdown rather than limiting your document lay

Cameron Robinson 91 Jan 2, 2023
A markdown-it plugin that process images through the eleventy-img plugin. Can be used in any projects that uses markdown-it.

markdown-it-eleventy-img A markdown-it plugin that process images through the eleventy-img plugin. Can be used in any projects that use markdown-it. F

null 25 Dec 20, 2022
An obsidian plugin for uploading local images embedded in markdown to remote store and export markdown for publishing to static site.

Obsidian Publish This plugin cloud upload all local images embedded in markdown to specified remote image store (support imgur only, currently) and ex

Addo.Zhang 7 Dec 13, 2022
Markdown Transformer. Transform markdown files to different formats

Mdtx Inspired by generative programming and weed :). So I was learning Elm language at home usually in the evening and now I am missing all this gener

Aexol 13 Jan 2, 2023
Preview and reply to your messages from within Alfred. Keep your hands on that keyboard!

Mouseless Messenger Mouseless Messenger offers you rapid keyboard-driven access to send and read conversations in the macOS Messages app via Alfred —

Stephan Casas 37 Dec 30, 2022
Generate social preview images in your Next.js API from Sanity webhooks

sanity-next-social-image-generator Automatically generate social share images using Sanity webhooks, and your Next.js API! Requirements A Next.js appl

Jordan McRae 9 Sep 4, 2022
Embed your NFT art anywhere, generate preview for oldschool platforms

Embed.Art Introduction Platform like twitter and facebook use meta tags to display preview when sharing url. The format these meta tags support are li

Ronan Sandford 12 Sep 26, 2022
A tool to document your package.json scripts

why A tool to document your package.json scripts Why why? As your project grows you add more scripts to package.json. When a new member joins the proj

Dragoș Străinu 13 Sep 22, 2022
This template is for generating a .NET C# wrapper for the RabbitMQ client based on your AsyncAPI document.

.NET C# RabbitMQ template This is a .NET C# RabbitMQ template for the AsyncAPI generator This template is for generating a .NET C# wrapper for the Rab

AsyncAPI Initiative 5 Dec 21, 2022