![]() It might have been smarter to use a different key combination for Good Preview and preserve ⌃⌥⌘P for the standard behavior. I deleted the original Preview command from the Blogging bundle and removed the ⌃⌥⌘P Key Equivalent from the Preview commands in the Markdown bundle. The Good Preview TextMate command is not included in the repository, which is why I’ve reproduced it here. In addition to writing a file, post-preview.py writes “Done” to standard output, which Good Preview shows as a tooltip when the command finishes successfully. The second line opens post-preview.html in my default browser. The first line runs the post-preview.py script, creating or overwriting the post-preview.html file on my Desktop. The two lines of code are ~/blog-preview/post-preview.py The TextMate command I use to preview my posts is this addition to the Blogging Bundle, called Good Preview: All of this is available for download from a GitHub repository, although I can’t imagine anyone using it without some serious editing. The script that actually does the four-step process is written in Python. The CSS file is an ever-so-slightly altered version of the CSS file I use for this blog (MultiMarkdown and PHP Markdown Extra use different classes for their footnotes). The JavaScript files are local versions of jsMath, my line numbering script, and my slightly-edited version of Lukas Mathis’s popup footnote script. It’s similar to my customized PHP Markdown Extra. I do the conversion in Step 3 using a customized version of MultiMarkdown that works with jsMath to generate nice-looking equations from LaTeX source. Wrap the fragment in more HTML, turning it into a complete page that references CSS and JavaScript files that give the page the look of my blog.Convert the body from Markdown to an HTML fragment.It’s followed by a blank line and then the rest is the body. Keywords: mac, blogging, programming, python, marseditĪt the top of the file. The header is a series of lines like this Blog: And now it's all this Separate the header from the body of the post. I was afraid that touching any one of them could screw up other commands. I thought about making some changes to the standard Preview command, but it relies on a series of scripts that call one another, some of which are also used for other purposes. In other words, it’s not really a preview. uses a small sans-serif font for the body text.Let’s say I’m writing my post (in Markdown, of course), and I want to see it before publishing. MarsEdit is supposed to handle previews very well, which happens to be the only thing I don’t like about the Blogging bundle. I don’t use MarsEdit and don’t plan to, but the hoopla and acclaim for the new version gave me the kick in the pants I needed to work up an addition to TextMate’s Blogging bundle. I’d like to thank Daniel Jalkut for releasing MarsEdit 3 this week. Next post Previous post Not a review of MarsEdit 3
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |