WordPress Workflow
I’m inaugurating this blog with a description of the workflow I’m currently using to create and post new entries and articles.
I create the articles as MultiMarkdown1 files using BBEdit on my Mac (currently a Mac Mini running OS X 10.7). I use MultiMarkdown because it lets me create straightforward HTML content without writing much or any HTML markup. Unless I’m typing raw HTML in the midst of the text, there is no danger of making a syntax error.
Markdown syntax created by John Gruber and as a better toolset for processing markdown files.
Once I have the text the way I want it, I convert it to WordPress friendly HTML using the following command:2
multimarkdown something.mmd | grep -v "^<?xml" \
| /xpt/local/bin/tidy -wrap 0 > something.html
A bit of explanation may be in order:
-
The grep command is used to remove the XML processing instruction that MultiMarkdown inserts.
-
I like to wrap my text files at around column 72, but WordPress will insert
<br />
elements when it sees line breaks, so I specify the -wrap 0 option and tidy removes line breaks from within<p>
elements (but not from within<pre>
elements). -
At the moment I use MultiMarkdown 3.2, and I’m using the HTML5 version of tidy.
Next, I open the generated HTML file in BBEdit and copy just the content elements and paste them into a new post or page in WordPress, then give it a title, preview it to check text and links, and then publish.
Finally, I go back to the Terminal and commit the MultiMarkdown updates into my Git repository.
That’s the workflow. Not as completely automated as it might be. I’m interested in better ways to manage this workflow, but this is working for me at the moment.
-
Fletcher Penney created MultiMarkdown as both an extension of the ↩
-
The
\
is just a line continuation character. That only make sense in a script file; you wouldn’t type it if you were keying in the command interactively in a terminal window. ↩