[TxMt] About the reStructuredText bundle

Charilaos Skiadas skiadas at hanover.edu
Sat Apr 28 19:11:36 UTC 2007


On Apr 28, 2007, at 2:32 PM, Steve Lianoglou wrote:

> Hi,
>
> Two things tripped me up just now using the reST bundle:
>
> (1) I'm not sure if it's broken or not, but the Validate Syntax  
> command didn't work for me as it stands, and it's the first line  
> that's tripping it up for me:
> `TRST=${TM_PYTHON:=rst2html.py}`
>
> I found that most of the rest commands used `TRST=$ 
> {TM_RST2HTML:=rst2html.py}` and when I switched it in for that, it  
> seems to be working.
>
> Just out of curiousity, where/how is this $TM_RST2HTML environment  
> variable getting set, anyway (and what's `:=`)?

:= is "shell-speak". Type "bash" in a plain text document and run  
ctrl-H, and the man page for the bash shell will pop up. Then search  
for ":=", and you'll find a list of similar options. The description  
for this particular one is:

${parameter:=word}
Assign Default Values. If parameter is unset or null, the expansion  
of word is assigned to parameter. The value of param_eter is then  
substituted. Positional parameters and special parameters may not be  
assigned to in this way.

So in other words, the above sets the value of TM_RST2HTML to  
rst2html.py, unless it has already been set. Further, this value is  
also assigned to the TRST variable. So you could set the value of  
TM_RST2HTML manually if you want it to be something else.

The original was setting/using the value of the TM_PYTHON variable  
instead.

> (2) I feel like the "Convert Document to HTML" command should have  
> its output set to "Create New Document" instead of replacing the  
> reST in the file w/ the HTML so you don't blow out the file you've  
> been working on.

I think this follows the similar command in Markdown. I guess the  
idea is that you would only want to use this command within a bigger  
HTML document. i.e. you have an HTML document and want to add  
something you've written in reST. Then you copy and paste it in, then  
select it and convert it to HTML (It's rather unfortunate that you  
have to select it again I guess).

> Thanks,
> -steve

Haris Skiadas
Department of Mathematics and Computer Science
Hanover College






More information about the textmate mailing list