Git Product home page Git Product logo

smdv's Introduction

smdv

A Simple Markdown Viewer for linux.

Dependencies

Required

  • python3 pointing to Python 3.6+.
  • Python-Markdown [pip3 install markdown]
  • python-markdown-math [pip3 install https://github.com/Eugene-Kolesnikov/python-markdown-math]
  • Flask [pip3 install flask | apt install python3-flask | pacman -S python-flask | ... ]
  • Websockets [pip3 install websockets | apt install python3-websockets | pacman -S python-websockets | ... ]

Optional

  • Jupyter to view jupyter notebooks [pip3 install jupyter | apt install jupyter | pacman -S jupyter | ... ]
  • Neovim Remote [pip3 install neovim neovim-remote]

Installation

    pip3 install https://github.com/Eugene-Kolesnikov/smdv

Configuration

smdv listens to a single environment variable: SMDV_DEFAULT_ARGS. As an example, below you can see how smdv can be configured to always open in firefox on port 9999 by placing the following line in your .bashrc:

SMDV_DEFAULT_ARGS="--browser firefox --port 9999"

Consult smdv --help to see which flags can be used.

Compatibility with neovim

This viewer was made with neovim compatibility in mind. With the use of neovim-remote, this script is able to open files in the current neovim window (or spawn a new neovim window if there is no window available).

However, to make it fully compatible with neovim and to make neovim able to sync its current file to the viewer, neovim-remote should be installed and the following line should be added to your init.vim:

    " sync on save
    autocmd BufWritePost *.md silent execute '!smdv 'expand('%:p')' -v "'.v:servername'"'

This setting will sync the file to the viewer after every save.

Compatibility with vim-instant-markdown

Alternatively, if syncing after every save is not enough, smdv can also be used in conjuction with vim-instant-markdown for instant markdown previews. Install the vim-plugin and add the following line to your vimrc:

let g:instant_markdown_python = 1

This line disables the default javascript daemon handling instant previews in favor of smdv. Consider removing the sync-on-save line defined above when using this option; both options are not completely compatible.

Screenshots

markdown preview

smdv-dir

folder view

smdv-dir

smdv's People

Contributors

eugene-kolesnikov avatar flaport avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.