tag:support.markedapp.com,2011-09-11:/discussions/problems/47-i-cannot-get-the-custom-processor-workingMarked: Discussion 2018-10-19T05:38:38Ztag:support.markedapp.com,2011-09-11:Comment/114247742011-11-15T14:29:14Z2011-11-15T14:29:14ZI cannot get the Custom Processor working<div><p>Hi Roderik,</p>
<p>Sorry for any confusion. The custom processor does not take
arguments.<br>
You need to make the hashbang in the script point to your rvm<br>
environment, make the script executable and then make it work with
the<br>
contents piped to it rather than read from a file. In the end you
should<br>
have one single command that would be the equivalent of <code>cat
myfile.md | your/script.rb</code> and output goes to STDOUT.</p></div>Bretttag:support.markedapp.com,2011-09-11:Comment/114247742011-11-15T14:43:04Z2011-11-15T14:43:04ZI cannot get the Custom Processor working<div><p>Hmm, still does not output the same as the commandline</p>
<p>In the preferences i have now:<br>
/Users/roderik/Dropbox/Databases/github-flavored-markdown.rb</p>
<p>Running cat /opt/kDeploy/README.md |
/Users/roderik/Dropbox/Databases/github-flavored-markdown.rb
returns in STOUT</p>
<div class="highlight">
<pre>
<span class="nv">$ </span>sudo su -
<span class="nv">$ </span><span class="nb">cd</span> /opt
<span class="nv">$ </span>wget -q -O - <span class=
"s2">"https://raw.github.com/Kunstmaan/kDeploy/master/installations/basic-machine"</span> | bash
<span class="nv">$ </span>wget -q -O - <span class=
"s2">"https://raw.github.com/Kunstmaan/kDeploy/master/installations/puppet-client"</span> | bash
</pre></div>
<p>Marked returns</p>
<p><code>bash $ sudo su - $ cd /opt $ wget -q -O -
"https://raw.github.com/Kunstmaan/kDeploy/master/installations/basic-machine"
| bash $ wget -q -O -
"https://raw.github.com/Kunstmaan/kDeploy/master/installations/puppet-client"
| bash</code></p>
<p>Is there some way to see what it is doing in for example
Console? Since it does not give an error, but shows me "default"
markdown, i think it is not executing the custom processor
script.</p></div>Roderik van der Veertag:support.markedapp.com,2011-09-11:Comment/114247742011-11-15T14:48:30Z2011-11-15T14:48:30ZI cannot get the Custom Processor working<div><p>Ok, it still shows html but no "view" anymore. Console shows</p>
<p>15/11/11 15:45:13,432 [0x0-0x39039].com.brettterpstra.marky:
/Users/roderik/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in
`require': cannot load such file -- redcarpet (LoadError)</p>
<p>getting closer :)</p>
<p>On 15 Nov 2011, at 15:42, Roderik van der Veer wrote:</p>
<blockquote>
<p>Hmm, still does not output the same as the commandline</p>
<p>In the preferences i have now:
/Users/roderik/Dropbox/Databases/github-flavored-markdown.rb</p>
<p>Running cat /opt/kDeploy/README.md |
/Users/roderik/Dropbox/Databases/github-flavored-markdown.rb
returns in STOUT</p>
<div class="highlight">
<pre>
<span class="nv">$ </span>sudo su -
<span class="nv">$ </span><span class="nb">cd</span> /opt
<span class="nv">$ </span>wget -q -O - <span class=
"s2">"https://raw.github.com/Kunstmaan/kDeploy/master/installations/basic-machine"</span> | bash
<span class="nv">$ </span>wget -q -O - <span class=
"s2">"https://raw.github.com/Kunstmaan/kDeploy/master/installations/puppet-client"</span> | bash
</pre></div>
<p>Marked returns</p>
<p><code>bash $ sudo su - $ cd /opt $ wget -q -O -
"https://raw.github.com/Kunstmaan/kDeploy/master/installations/basic-machine"
| bash $ wget -q -O -
"https://raw.github.com/Kunstmaan/kDeploy/master/installations/puppet-client"
| bash</code></p>
<p>Is there some way to see what it is doing in for example
Console? Since it does not give an error, but shows me "default"
markdown, i think it is not executing the custom processor
script.</p>
<p>On 15 Nov 2011, at 15:29, Brett wrote:</p>
</blockquote></div>Roderik van der Veertag:support.markedapp.com,2011-09-11:Comment/114247742011-11-15T15:00:03Z2011-11-15T15:00:03ZI cannot get the Custom Processor working<div><p>Do you have the redcarpet gem installed across all of your RVM
installations? <code>rvm do gem install redcarpet</code>?</p>
<p>-Brett</p></div>Bretttag:support.markedapp.com,2011-09-11:Comment/114247742011-11-15T15:27:25Z2011-11-15T15:27:25ZI cannot get the Custom Processor working<div><p>Yes (did it again to be sure)</p>
<p>Fixed it by adding a bash script in between, seems like Marked
does not run with the same env variables as the terminal user.</p>
<h1>!/bin/bash</h1>
<p>export
GEM_PATH=/Users/roderik/.rvm/gems/ruby-1.9.3-p0:/Users/roderik/.rvm/gems/ruby-1.9.3-p0@global<br>
export GEM_HOME=/Users/roderik/.rvm/gems/ruby-1.9.3-p0</p>
<p>cat - |
/Users/roderik/Dropbox/Databases/github-flavored-markdown.rb</p></div>Roderik van der Veer