reStructuredText preview filter

189 views
Skip to first unread message

Oliver Taylor

unread,
Dec 28, 2013, 6:29:51 PM12/28/13
to bbe...@googlegroups.com
I’m trying to setup a simple Preview Filter for reStreucturedText using pandoc.

Pandoc reads from STDIN and prints to STDOUT - the following works great in the terminal:

echo "this is **marked-up** text" | pandoc -f rst -t html

=> <p>this is <strong>marked-up</strong> text</p>

My thought (and I’m sure this isn’t correct) was that making a Preview Filter would be as simple as a file that looks like this:

#!/bin/bash
pandoc -f rst -t html

…but no luck. Anyone know what I’m doing wrong?

Maarten Sneep

unread,
Dec 28, 2013, 7:02:23 PM12/28/13
to bbe...@googlegroups.com
I suspect that pandoc can’t be found in the environment that is presented to the shell script. Try using the full path to pandoc instead.

Best,

Maarten

Steve Piercy

unread,
Dec 28, 2013, 8:50:58 PM12/28/13
to bbe...@googlegroups.com
FYI, there is a nifty Python utility for a live preview of
reStructuredText called restview. Set up an HTML Web Site in
BBEdit with the name of the server, then edit .rst files and
view them with preview.
https://github.com/mgedmin/restview

And a BBEdit Language Module for syntax coloring and autocompletion.
https://bitbucket.org/EricFromCanada/ericfromcanada.bitbucket.org/src/default/bbedit/reStructuredText.plist

--steve


On 12/28/13 at 3:29 PM, oliver...@me.com (Oliver Taylor) pronounced:
------------------------
Steve Piercy, Soquel, CA

Oliver Taylor

unread,
Dec 29, 2013, 12:49:51 AM12/29/13
to bbe...@googlegroups.com
On Dec 28, 2013, at 4:02 PM, Maarten Sneep <maarte...@xs4all.nl> wrote:

> I suspect that pandoc can’t be found in the environment that is presented to the shell script. Try using the full path to pandoc instead.

Thanks Maarten, that did the trick.

Reply all
Reply to author
Forward
0 new messages