mdp
markdown preview using marked, highlight.js, mermaid, node-emoji and live reload
https://ericlink.github.io/mdp/
features
highlight.js
syntax highlighting https://highlightjs.org/
mermaid diagrams
node-emoji
https://github.com/omnidan/node-emoji
marked markdown parsing
github flavored markdown
https://github.com/markedjs/marked
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
npm install
npm run dev
test and publish
npm run dev &
- run in background to test open-file with subsequent opennpm run dev-noarg
- tests launch with no arg, app starts with no window./node_modules/.bin/electron ./src/main.js ./README.md
npm run dev-publish
- open from finder once packaged
- open from mdp shell script once packaged
tail -f ~/Library/Logs/mdp/log.log
upstream repo is git clone https://github.com/ericlink/electron-forge-webapp-template.git
package
npm install
npm run package
npm run make && npm run publish
todo
features
-
print style sheets
-
get working with highlight.js themes
-
get working with marked themes
-
get working with mermaid themes / css (mermaid-cli -C)
-
keep scroll position on reload
-
vim keymappings
-
recent documents app.addRecentDocument('/Users/USERNAME/Desktop/work.type') app.clearRecentDocuments()
-
issues and site linked in about
-
autosave sometimes doesn't refresh (file watcher issue?)
-
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)