{"id":13410508,"url":"https://github.com/davidgranstrom/nvim-markdown-preview","last_synced_at":"2025-03-14T16:32:16.189Z","repository":{"id":43210671,"uuid":"132935644","full_name":"davidgranstrom/nvim-markdown-preview","owner":"davidgranstrom","description":"Markdown preview for neovim using pandoc and live-server","archived":false,"fork":false,"pushed_at":"2023-07-11T13:56:37.000Z","size":159,"stargazers_count":110,"open_issues_count":9,"forks_count":17,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-06T10:58:15.214Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"CSS","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/davidgranstrom.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2018-05-10T17:51:29.000Z","updated_at":"2025-02-09T12:00:06.000Z","dependencies_parsed_at":"2024-04-12T01:55:31.299Z","dependency_job_id":"f8c1ebfb-3033-4f0e-b948-9b612322b67a","html_url":"https://github.com/davidgranstrom/nvim-markdown-preview","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidgranstrom%2Fnvim-markdown-preview","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidgranstrom%2Fnvim-markdown-preview/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidgranstrom%2Fnvim-markdown-preview/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidgranstrom%2Fnvim-markdown-preview/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/davidgranstrom","download_url":"https://codeload.github.com/davidgranstrom/nvim-markdown-preview/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243610225,"owners_count":20318928,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-30T20:01:07.384Z","updated_at":"2025-03-14T16:32:15.719Z","avatar_url":"https://github.com/davidgranstrom.png","language":"CSS","funding_links":[],"categories":["Programming Languages Support"],"sub_categories":["Markdown and LaTeX"],"readme":"# nvim-markdown-preview\n\nMarkdown preview in the browser using [pandoc](https://pandoc.org/) and [live-server](https://github.com/tapio/live-server) through Neovim's [job-control API](https://neovim.io/doc/user/job_control.html).\n\n## Usage\n\nOpen a markdown file in vim and run `:MarkdownPreview`. The preview opens in a new browser tab which will be reloaded whenever you `:write` the buffer. If you accidentally close your browser tab or want to change the theme just run the command again. The file needs to be written to disk before you can start the preview.\n\n## Features\n\n* Asynchronous\n* Produces \"standalone\" html files (injected css)\n* Custom themes (`github`, `solarized-dark`, `solarized-light`)\n* Auto-reloads browser tab on save\n* Serves assets from the current working directory (embed pictures in your markdown etc.)\n* Custom markdown input formats\n  - [pandoc markdown](https://pandoc.org/MANUAL.html#pandocs-markdown)\n* [KaTeX](https://katex.org/) for formatting LaTeX math\n* Syntax highlighting from the [Kate Editor themes](https://github.com/KDE/syntax-highlighting#color-theme-files)\n\n## Requirements\n\n* `pandoc`\n* `live-server` (Node.js)\n\n`pandoc` and `live-server` executables should be installed and accessible in your `$PATH`.\n\n### Pandoc\n\nPandoc should be available in most Linux distributions and on macOS via brew and Windows via chocolatey.\n\nOn [macOS](https://pandoc.org/installing.html#macos) using Homebrew:\n\n```\nbrew install pandoc\n```\n\nFor [Linux](https://pandoc.org/installing.html#linux):\n\n* Ubuntu `sudo apt install pandoc`\n\n* Fedora `sudo dnf install pandoc`\n\nFor [Windows](https://pandoc.org/installing.html#windows):\n\nEither download the executable or get it with Chocolatey\n\n```\nchoco install pandoc\n```\n\nFor other systems please see the links in the description on how to install.\n\n### live-server\n\nAssuming you have [Node.js](https://nodejs.org/en/download/) installed:\n```\nnpm install -g @compodoc/live-server\n```\n\nSee this [issue](https://github.com/davidgranstrom/nvim-markdown-preview/issues/15) on why the live-server fork is preferred.\n\n## Installation\n\nIf you are using [vim-plug](https://github.com/junegunn/vim-plug)\n\n`Plug 'davidgranstrom/nvim-markdown-preview'`\n\nsource the file (`:source %`) (or restart vim) and then run `:PlugInstall`\n\n## Documentation\n\n### Usage\n\nThere is only a single command:\n\n```vim\n:MarkdownPreview [theme]    Starts the browser preview of the current file.\n                            Optional argument to select a theme.\n\n                            The available themes are currently:\n                            * github\n                            * solarized-light\n                            * solarized-dark\n\n```\n\n### Customization\n\nSet this variable in your init.vim to specify a default theme for the preview.\nThe default is the GitHub theme.\n\n```vim\nlet g:nvim_markdown_preview_theme = 'solarized-light'\n```\nSet this variable to specify the pandoc input format (--format/-f) option.\nThe default is `gfm` (GitHub flavored markdown).\n\n```vim\nlet g:nvim_markdown_preview_format = 'markdown'\n```\n\nTake a look at `:help nvim-markdown-preview` for complete documentation and examples.\n\n## Screenshots\n\n![](./screenshots/grid.png)\n\n## Q \u0026 A\n\n**Q:** Why doesn't the preview update in real-time while I type in vim?\n\n**A:** This plugin simply doesn't work like that. It only aims to provide some live update capabilities around what is essentially `:w !pandoc % -o /tmp/file.html`\n\n**Q:** I want the preview tab to open automatically without typing `:MarkdownPreview`\n\n**A:** Sure, use an `autocmd` like:\n```\nautocmd FileType markdown MarkdownPreview\n```\n\nOr the `\u003cPlug\u003e` mapping to bind it to the key of your choice\n```\nnmap \u003ccr\u003e \u003cplug\u003e(nvim-markdown-preview)\n```\n\n## TODO\n\nThe markdown file must be written to disk first. It should be possible to use Pandoc `stdin` and pipe the buffer content using `jobsend()` instead.\n\n## License\n\nGPL v3\n\n```\nnvim-markdown-preview\nCopyright (C) 2018 David Granström\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program.  If not, see \u003chttps://www.gnu.org/licenses/\u003e.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidgranstrom%2Fnvim-markdown-preview","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavidgranstrom%2Fnvim-markdown-preview","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidgranstrom%2Fnvim-markdown-preview/lists"}