Skip to main content

smdv

a simple markdown viewer for linux.

Dependencies

Required

  • python3 pointing to Python 3.6+.
  • Pandoc [pip3 install pandoc | apt install pandoc | pacman -S pandoc | ... ]
  • 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 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

Metadata

Release files for smdv 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for smdv 0.1.1
File Size Uploaded
smdv-0.1.1.tar.gz 14.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for smdv 0.1.1
File Interpreter ABI Platform
smdv-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 30.3 kB

Release files / smdv-0.1.1.tar.gz

Download URL smdv-0.1.1.tar.gz
Size 14.9 kB
Tags Source
SHA-256 checksum
How to use checksums
666f467c871cf2aed532cccaf2ccb4f9fbc02f7ec0ad9d074e35939b932da2aa
BLAKE2b-256 checksum
How to use checksums
08bcb49ec39d81f7305fcd2c7c12d9d62845002cbc64427c668f05dd98f5ea73
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3

Release files / smdv-0.1.1-py3-none-any.whl

Download URL smdv-0.1.1-py3-none-any.whl
Size 15.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e150afd033f1410a7e4c6b4daa2e69682723fdf090ad9d23e92231431a7a2ad6
BLAKE2b-256 checksum
How to use checksums
4a3fde0e7d85043fa0d89f54907d255bde5ee0c6112a22442c4164feb6200ed4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

0.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page