Brett on 17 Sep, 2014 04:51 PM
If you provided permission when requested by "Update Permissions" then
this probably isn't a permissions error. I note references to ENV and an
error related to sed -e, which indicates that the script is loading an
incorrect version of utilities from within the Marked shell. Note that
your usual shell environment is unavailable when the custom processor is
run. The script needs to be able to function without any custom
environment variables or environment managers (rbenv, pyenv, etc.).
That is my wrapper script. I'm one step closer. Apparently some
of the permissions in /usr/local/ were off. Sticky bit
was set and the owning group was wheel. I fixed it by
using chmod -R. Now I get a new error.
mktemp fails. Let me check if I can work it out
I'm back to the old issue. While we have been discussing the
problem, I'll reinstalled Marked 2 twice, each time with deleting
all preferences files, etc. The last time I did so, I didn't
immediately click the "Update Permissions" button. I fixed
/usr/local and opened it in Marked. I wasn't asked to
grant permission, but the echo ... | gsed dummy script
worked. My real script, however, now complained that it couldn't
create a tempfile using mktemp, so I thought I give
this "Update permissions" button a try. Helped to solve the issue
that I couldn't access /tmp, but R is still
complaining. It is by the way R that uses sed for it's
This is how my script looks by the way. I'm setting
HOME just is case, because pandoc which
is used by rmarkdown if HOME is not
Simply executing chmod g-s solves the problem. I
just missed some files. I don't know how my executables ended up
with these permissions in the first place, but I'm happy it works!
Sorry, for all the trouble and thank you very much for your help
and patience! I'm a big fan of Marked btw. and now that I can
directly view my statistics reports, I love it even more!
The script (from #14) is not working for me. I made a txt file from the script code listed and made it executable. Should the link to that executable be in the "Processor" or "Pre-processor" tab? The output from Marked 2 do not include results from R, but has a thin red line above R code sections. Where is the error output/log to read what went wrong?
Brett on 06 Jun, 2017 03:02 PM
Sorry for the late reply on this, Mark,
The first thing to check is that the script is working for you from the command line. Run cat your_markdown_file.md | scriptfile.sh > outfile.html (replacing the filenames appropriately) and ensure that the output you're getting is what you're expecting. The resulting outfile.html should be "partial" HTML (not a full document with head/body tags) and should view properly when you load it in a browser.
Because you're using the script to do the complete render resulting in HTML, you'll want to use it as the Processor. Preprocessors are subsequently run through the selected default processor (Markdown or GFM), so they expect Markdown input.
You can see the STDOUT/STDERR output of the script within Marked by going to Help->Show Custom Processor Log.