Skip to content
This repository has been archived by the owner on Sep 12, 2023. It is now read-only.

elianiva/asciidoclive.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

asciidoclive.nvim

NOTE: I made this just for fun so I probably won't maintain it long term :p

An asciidoc live previewer for Neovim. Only works on recent Neovim version because it uses a relatively new nvim_add_user_command API

simplescreenrecorder-2022-01-11_15.13.58.mp4

Features

  • Live preview on each keystroke
  • Pretty stylings using sakura.css
  • honestly that's it

Requirements

Installation

i use packer so..

{
  "elianiva/asciidoclive.nvim",
  run = "cd ./app && npm ci", -- install node dependencies
  config = function()
    -- these are the default values
    require("asciidoclive").setup {
      port = 3000, -- server port
      host = "127.0.0.1" -- server host
      css  = "" -- path to custom css file, must be a local file
    }
  end
}

Usage

This plugin provides two commands:

  • AsciidocLivePreviewStart
  • AsciidocLivePreviewStop

They does exactly what they are.

Limitations

Some stuff could be improved, here's a temporary list which will probably get updated in the future.

  • automatically open the browser

  • asciidoctor.js seems to remove the first heading.. idk if that's intended or not

  • Add option to refresh on save

  • Debounce keystroke?

  • Send the entire buffer content on initial connection

  • No live scrolling

  • Only works on the buffer where you start the previewer

    Currently it behaves like this because I use nvim_buf_attach upon starting the server and it only listens to the current buffer. It should probably listen to any buffer with the same filename, but eh, it fits my need atm

  • TBD

PR's welcome, btw.

Acknowledgement


If you found any issue / something missing, just open an issue (or better, make a PR :)

About

An asciidoc live previewer plugin for neovim

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published