CNK's blog

StackEdit

Installing StackEdit Locally

I have been looking into different editing and publishing tools for a new project at work. One of the formats of interest in Markdown because it is fairly straightforward to do a number of basic things and the stored format is cleaner than html. But since most people, myself included, don’t have the various tags committed to memory, we are going to need to provide an in browser preview for the Markdown input. So I went looking for libraries that would allow us to add a preview pane to our textareas.

One of the tools I found is an in browser editor that uses Markdown as it’s fundamental input format and can save the markdown to a variety of collaboration and blogging tools or export the text as html or PDF. It will also save your file to a ssh server. I am not sure I want to put my username and password into a web site - any web site. So instead of using the web interface, I think I’ll try to install it on my laptop and use it from there.

So, following the developer instructions at https://github.com/benweet/stackedit/blob/master/doc/developer-guide.md, I did:

  1. Git clone https://github.com/benweet/stackedit.git into ~/Code/javascript

  2. StackEdit needs node and npm. I have those, but I bet my versions are out of date, so let’s update all my homebrew software:

     brew update
     brew upgrade
    
  3. Update my version of npm (gets released more frequently than node.js):

     npm install npm -g
    
  4. I need gulp and bower and probably want them global / in my path:

     npm install -g bower
     npm install -g gulp
    
  5. install local dependencies (in ~/Code/javascript/stackedit):

     npm install
    
  6. Now back on the developer instructions:

     bower install
    
  7. The instructions for running the node server were export PORT=80 && node server.js but that gave me errors because I was trying to bind to a privileged port. So instead I did

     export PORT=9999 && node server.js
    

    and I am now editing this on http://localhost:9999/editor

Unfortunately, I was not able to get the saving to an ssh server to work - at least not when the ssh server is my local Mac. I am pretty sure this is an issue with how my Mac’s ssh daemon is configured. But without that, I don’t know that editing in the browser with side by side preview is all that much more convenient than creating posts in emacs and using Octopress’s rake preview task. So installing StackEdit locally was a fun exercise. But I think I will mostly be using it on the web at http://stackedit.io/

Comments