[TxMt] Markdown->Markup->PDF

Allan Odgaard allan at macromates.com
Thu Feb 3 16:15:58 UTC 2005


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).




More information about the textmate mailing list