tag:support.markedapp.com,2011-09-11:/discussions/questions/107-using-maruku-with-markedMarked: Discussion 2015-01-14T18:06:55Ztag:support.markedapp.com,2011-09-11:Comment/154123902012-04-20T00:14:53Z2012-04-20T00:14:53ZUsing Maruku with Marked<div><p>First, take a look at system.log in Console.app while you
refresh the preview and see if any com.brettterpstra.marky errors
show up there. That might help you find the issue pretty
quickly.</p>
<p>If Marked has a problem with finding the file or running it, it
reverts to the built-in processor, so the fact that you're getting
a blank preview means something's going on with Maruku. Are you
running rvm at all? Marked doesn't currently honor rvm settings, so
it's likely running your system default (which may not be
compatible with your version of maruku).</p>
<p>Let me know about the console and rvm, we can troubleshoot from
there.</p></div>Bretttag:support.markedapp.com,2011-09-11:Comment/154123902012-04-20T01:04:31Z2014-05-29T15:00:22ZUsing Maruku with Marked<div><p>Ah, you've hit the nail on the head with the RVM thing. I'm not
the most ruby-fluent of customers, I'm more interested in jekyll
for its allowing me to use markdown and html with nothing in the
way!</p>
<p>I have fixed the problem using a combination of this:</p>
<pre>
<code>#!/usr/bin/env ruby
require 'rubygems'
require 'maruku'
def markdown(text)
html = Maruku.new(text).to_html_document
end
puts markdown(STDIN.read)</code>
</pre>
<p>and this, borrowed from <a href=
"http://support.markedapp.com/discussions/problems/47-i-cannot-get-the-custom-processor-working">
here</a>:</p>
<pre>
<code>#!/bin/bash
export GEM_PATH=~/.rvm/gems/ruby-1.9.3-p0:~/.rvm/gems/ruby-1.9.3-p0@global
export GEM_HOME=~/.rvm/gems/ruby-1.9.3-p0
cat - | ~/maruku-markdown.rb</code>
</pre>
<p>Thanks for your time, I'll perhaps have a go at whacking this
into some sort of more universal format and then stick a link on
here.</p>
<p>Dave</p></div>david.pw.smithtag:support.markedapp.com,2011-09-11:Comment/154123902012-04-20T01:44:54Z2012-04-20T01:44:54ZUsing Maruku with Marked<div><p>Haven't tested it, but you could try something like this to
narrow it down to one script:</p>
<pre>
<code> #!/usr/bin/env ruby
require 'rubygems'
require 'maruku'
ENV['GEM_PATH']="~/.rvm/gems/ruby-1.9.3-p0:~/.rvm/gems/ruby-1.9.3-p0@global"
ENV['GEM_HOME']="~/.rvm/gems/ruby-1.9.3-p0"
def markdown(text)
html = Maruku.new(text).to_html_document
end
puts markdown(STDIN.read)</code>
</pre>
<p>If that works, let me know and I'll add a page to the
knowledgebase for it.</p></div>Bretttag:support.markedapp.com,2011-09-11:Comment/154123902012-04-20T08:54:57Z2014-05-29T15:00:23ZUsing Maruku with Marked<div><p>That doesn't work, I'm afraid, and I think those two lines would
be redundant, since those environment variables are set in
/usr/bin/env. It seems like Marked (or OSX?) doesn't follow the
variables set in the shebang /usr/bin/env...</p></div>david.pw.smithtag:support.markedapp.com,2011-09-11:Comment/154123902012-04-20T12:00:50Z2012-04-20T12:00:50ZUsing Maruku with Marked<div><p>It should, but it's basically spawning an entirely new shell
outside of your user login, so it's possible it's loading a blank
environment. If what you have is working, great, I'll mention the
two-file trick in the FAQ instead, then :).</p></div>Brett