sábado, 24 de diciembre de 2011

Installing restructuredText Bundle for TextMate

I recently discovered restructuredText and got TextMate some time ago but haven't been able to play
with it. I'm trying to blog with it. So I looked up if there were any Bundles for TextMate (not that I'm that clear on what a bundle is).

Install Docutils

Download Docutils 0.8.1 .

On Terminal run:

sudo setup.py install

You will get a an output like this:

running install
running build
running build_py
running build_scripts
running build_data
running install_lib
running install_scripts
changing mode of /usr/local/bin/rst2html.py to 755
changing mode of /usr/local/bin/rst2latex.py to 755
changing mode of /usr/local/bin/rst2man.py to 755
changing mode of /usr/local/bin/rst2odt.py to 755
changing mode of /usr/local/bin/rst2odt_prepstyles.py to 755
changing mode of /usr/local/bin/rst2pseudoxml.py to 755
changing mode of /usr/local/bin/rst2s5.py to 755
changing mode of /usr/local/bin/rst2xetex.py to 755
changing mode of /usr/local/bin/rst2xml.py to 755
changing mode of /usr/local/bin/rstpep2html.py to 755
running install_data
running install_egg_info
Removing /Library/Python/2.7/site-packages/docutils-0.8.1-py2.7.egg-info
Writing /Library/Python/2.7/site-packages/docutils-0.8.1-py2.7.egg-info

Install reStructuredText TextMate Bundle

Download the bundle in zip format from https://github.com/textmate/restructuredtext.tmbundle.

Unzip the file to a temporary location. In my case ~/Downloads/textmate-restructuredtext.tmbundle-edfe62e.
Edit the folder name from textmate-restructuredtext.tmbundle-edfe62e to textmate-restructuredtext.tmbundle using
Finder. The icon for the folder should change.

Open Terminal. Type the following commands:


mkdir -p ~/Library/ApplicationSupport/TextMate/Bundles


cp -r ~/Downloads/textmate-restructuredtext.tmbundle ~/Library/ApplicationSupport/TextMate/Bundles


Configure Environment Variables

I tried creating the variables using export but for some reason it didn't work. After doing some research
it seems there are several ways to declare environment list (using launchctl, using environment.plit and using export).
None of these methods worked for me on Lion, while trying to declare the TM_RST2HTML.

I kept getting the following error:

Couldn't find rst2html.py
You can either set the TM_RST2HTML variable to the full path of your docutils (docutils.sourceforge.net) installation (e.g. /Library/Frameworks/Python.framework/Versions/2.4/bin/rst2html.py or set the PATH variable to include the path of the docutils converters.
Locations searched:
/Applications/TextMate.app/Contents/SharedSupport/Support/bin/CocoaDialog.app/Contents/MacOS
/usr/bin
/bin
/usr/sbin
/sbin
/usr/local2/bin
/Applications/TextMate.app/Contents/SharedSupport/Support/bin

What finally worked for me was opening TextMate and going to TextMate\Preferences on Advanced on Shell Variable
added to the PATH variable /usr/local/bin.

No hay comentarios:

Publicar un comentario