How can automate the process of:
piping a Markdown through markdown.pl having it open in an external browser of my choice (preferably Opera 8 beta as it does the best job of honoring print related CSS) grabbing the X/HTML source putting the source into a new TM document
Is that even possible. I'm open to other suggestions about going from Markdown to PDF.
-t
Well, assuming that markdown.pl is somewhere in your path and is executable do the following:
Filter through command (Option+Shift+R) Enter "markdown.pl" for the command. Choose input->document Choose output->replace document
And you're done!
BTW, if you need to see a preview, use the web preview built into TextMate (Ctrl+Option+Command+P), select "Show Options", select "Pipe text through" and enter the path to your markdown.pl script.
The web preview uses web kit (i.e. KHTML, the same rendering engine as Safari), which is, in my experience, as good or better than other browsers at rendering XHTML. THe only place it "fails" is when CSS rules try to change the appearance of form elements (mostly input buttons).
Cheers!
Texmate, the more I use it the more powerful it becomes!
This works well Jason, thanks.
Anyway to have the output inserted at a specific location in a new document based on a template. E.g., have output inserted between the body tags of an XHTML template?
-t
On Feb 2, 2005, at 3:36 PM, Jason Terk wrote:
Well, assuming that markdown.pl is somewhere in your path and is executable do the following:
Filter through command (Option+Shift+R) Enter "markdown.pl" for the command. Choose input->document Choose output->replace document
And you're done! ______________________________________________________________________ For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
On Feb 3, 2005, at 3:45, Tim Martens wrote:
Anyway to have the output inserted at a specific location in a new document based on a template. E.g., have output inserted between the body tags of an XHTML template?
What you can do is a command like this:
---8<--- cat <<HEAD <!DOCTYPE ...> <html><head>...</head> <body> HEAD ~/bin/Markdown.pl cat <<TAIL </body> </html> TAIL --->8---
And set input: entire document, output: replace document (I'll add “open in new window” real soon).
This will cat the header, then run markdown on your document, inserting the result, and finally cat the tail. So you'll need to have the “template” in the command (though you could also store it in a file and cat that file -- if you want it in a file you can use 'sed' to cut the top/bottom part divided e.g. by <!-- markdown output here -->, let me know if you want an example of this).