Markdown preview PDF friendly

How to print a PDF

Edit the following files:

  • ~/.local/share/nvim/lazy/markdown-preview.nvim/app/_static/markdown.css
  • ~/.local/share/nvim/lazy/markdown-preview.nvim/app/_static/page.css

add the following lines at the bottom:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
@media print {
  #page-header {
    display: none;
  }
  .markdown-body {
    background-color: #fff;
    border: none;
    color: none;
  }
  main {
    background-color: #fff;
  }
}

Mermaid example

flowchart TD

a --> b