Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/datsfilipe/md-previewer
This helps you preview markdown files in the web with reloading support while watching for changes.
https://github.com/datsfilipe/md-previewer
markdown markdown-preview markdown-previewer neovim neovim-plugin preview previewer vim
Last synced: 3 months ago
JSON representation
This helps you preview markdown files in the web with reloading support while watching for changes.
- Host: GitHub
- URL: https://github.com/datsfilipe/md-previewer
- Owner: datsfilipe
- Created: 2024-07-29T01:21:31.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-08-06T02:54:32.000Z (5 months ago)
- Last Synced: 2024-09-28T15:21:13.218Z (3 months ago)
- Topics: markdown, markdown-preview, markdown-previewer, neovim, neovim-plugin, preview, previewer, vim
- Language: TypeScript
- Homepage:
- Size: 1.7 MB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Markdown Previewer
This binary helps you preview markdown files in the web with reloading support while watching for changes.
## Demo
![demo](./assets/preview.gif)
## Usage
```sh
md-previewer --file=path/to/file.md
```## Neovim Plugin
- Installation:
```lua
-- lazy.nvim
{
'datsfilipe/md-previewer',
cmd = 'MdPreviewer',
ft = 'markdown',
-- this is for downloading the binaries from the latest release
build = ":lua dofile(vim.fn.stdpath('data') .. '/lazy/md-previewer/lua/build.lua')",
opts = {
quiet = true, -- default is false but rn it has no real usage :0
},
}-- packer.nvim
use {
'datsfilipe/md-previewer',
cmd = 'MdPreviewer',
ft = 'markdown',
-- this is for compiling the binaries with bun
run = 'bun install && bun compile',
config = function()
require('md-previewer').setup({
quiet = true, -- default is false but rn it has no real usage :0
})
end,
}
```### Troubleshooting
- If you're not using `bun` to compile the binaries, you might need to set them as executables. For example, on Linux you can do `chmod +x /path/to/lazy/md-previewer/bin/*`. On other platforms you might want to search and see how it works.
## Development
It's as any bun project, just run `bun run dev --file=path/to/file.md` to preview a file. `bun compile` will generate the binaries.
- Neovim Plugin:
I'm using [direnv](https://direnv.net/) to manage some env vars for Neovim to load the plugin right away instead of the `init.lua` in your `~/.config/nvim` folder. You might want to look into it. To use direnv for this simple do `mv .envrc1 .envrc` and `direnv allow`.
- Any other enhancements are welcome :0
## License
MIT