mdp

mdp

Markdown preview using marked, highlight.js, mermaid, node-emoji and live reload.

mdp

markdown preview using marked, highlight.js, mermaid, node-emoji and live reload

https://ericlink.github.io/mdp/

markdown.png

mermaid.png

features

highlight.js

syntax highlighting https://highlightjs.org/

mermaid diagrams

https://mermaidjs.github.io/

node-emoji

https://github.com/omnidan/node-emoji

supported emoji

marked markdown parsing

github flavored markdown

https://marked.js.org/

https://github.com/markedjs/marked

example.md

keys

Open as HTML ⌘K

Edit Markdown ⌘E

Zoom - zoom in ⌘+, zoom out ⌘-, actual size ⌘0

macOS

full screen support

dark mode window

command line

put mdp.app/Contents/Resources/app/package/mdp script in your path

logs

on Linux - ~/.config/<app name>/log.log

on macOS - ~/Library/Logs/<app name>/log.log

on Windows - %USERPROFILE%\AppData\Roaming\<app name>\log.log

dev notes

  1. npm install
  2. npm run dev

test and publish

  1. npm run dev & - run in background to test open-file with subsequent open
  2. npm run dev-noarg - tests launch with no arg, app starts with no window
  3. ./node_modules/.bin/electron ./src/main.js ./README.md
  4. npm run dev-publish
  5. open from finder once packaged
  6. open from mdp shell script once packaged
  7. tail -f ~/Library/Logs/mdp/log.log

upstream repo is git clone https://github.com/ericlink/electron-forge-webapp-template.git

package

  1. npm install
  2. npm run package
  3. npm run make && npm run publish

todo

features

  • recent documents app.addRecentDocument('/Users/USERNAME/Desktop/work.type') app.clearRecentDocuments()
  • issues and site linked in about
  • keep scroll position on reload
  • autosave sometimes doesn't refresh (file watcher issue?)
  • vim keymappings
  • get working with highlight.js themes
  • get working with marked themes
  • zoom by window?

package and install

  • installer - install command line script into /usr/local/bin
  • sign app to enable auto updater using git releases

tech

  • upgrade packages
  • get electron-forge start working (not passing arg; detect mode and default arg to readme?)
  • load modules more efficiently?
  • webpack?
  • extendInfo any - The extra entries for Info.plist.

done

  • preferences to set editor, e.g. var executablePath = "mvim";
  • use tmp file for html
  • fixup markdown inline images to use base path of .md file they are in
  • emoji support
  • cmd+e to edit current markdown in system editor
  • open url only add listener once, not every reload
  • export menu (html, open in browser)
  • open links in os browser
  • expand cmd args to absolute path
  • fix up js
  • window menu
  • close window key
  • get working from file associated in finder
  • get working opening multiple from command line
  • get working as cmd line
  • get working as packaged
  • github release using electron-forge
  • keep scroll position on reload
  • move poc into app (works using dev command line)
not_used

Something missing? Edit this app.

Keyboard Shortcuts

Key Action
/ Focus the search bar
Esc Focus the search bar and cleans it
Select the next search result
Select the previous search result
Enter Open the selected search result
cmdEnter Ctrl+Enter Open the selected search result in a new tab