Have a desktop reader application to read .md
and .markdown
files.
Needs a bit of Lego spirit to make it working. Reuse excellent available open source code, glue it together.
It's fun and educational.
- node and npm (get it from: http://nodejs.org/)
- node-webkit binaries (get it from: https://github.com/rogerwang/node-webkit#downloads)
- a ZIP archiver (gets usually pre-installed on your OS, open command line and type
zip
, if you get output = you have it) - this source folder. Get it with git or github 'clone' command or 'Download ZIP' and expand sources
- markdown module (get it with:
npm install marked
shall be called from within source folder and shall createnode_modules
folder, more about marked at https://github.com/chjj/marked/)
This requires a bit of juggling of files, but process is fairly well explained on https://github.com/rogerwang/node-webkit/wiki/How-to-package-and-distribute-your-apps
- zip all sources and node_modules to a .zip file
- rename .zip file to have extension .nw (example name it
viewMarkdown.nw
) - follow instruction on above page to compile executable (on windows result would be
viewMarkdown.exe
) - copy .exe to conveniet usage dir (example windows:
c:\Program Files\Markdown Reader\
) - copy supporting node-webkit libraries to usage dir (on windows you need .dll and .pak files that come with node-webkit binary distribution)
Once reader application is compiled to its binary form it expects one parameter - a file name. Markdown filenames are usually .md
or .markdown
File name shall be specified with a full path, otherwise reader would not manage to find it as it usually runs from a temp dir (not your current work dir)
- To read file, right click on
.md
or.markdown file
, select 'open with...', in the dialog click browse and navigate toviewMarkdown.exe
, select "always use this application", Click OK. - Reader shall show you rendered text, and every next time when you double-click on
.md
or.markdown file
it shall open reader automatically. - Windows supplies full path name to your file