Post to WordPress from Ulysses, update 4/9

Note: there is now a GitHub repository for this project. Get the latest code there, including a downloadable Automator app 

After sleeping on this I decided there were a few things I could do better. Having to put raw source in the document was annoying. I looked into several ways to do this, but found Ulysses had the answer.

If a line of text is “marked” in Ulysses (that’s the :: notation) it gets exported as its own paragraph, but no other HTML tags are applied. This worked out perfectly. It gives me a way to highlight the WordPress tags in the document, and doesn’t require complicated scripting.

This makes handling the tags much easier. Simply write the tags out as a comma separated list on their own line directly after the heading and apply the marked markdown1 tag.

I also wanted a way to handle the WordPress “more” divider. It can be inserted anywhere as raw code: <!–more–>. But it’s ugly and fragile when done that way. With the updated script, a single line containing ::MORE:: (all caps with the Ulysses marked tag) will be converted into the WordPress tag.

This is an example showing the line of tags and the more divider.

[gist https://gist.github.com/8ae067b639caf96eafec]

The updated code for the Automator application:

[gist https://gist.github.com/38db468940e0c8ea7320]

Now the tag list and more divider are handled with markdown. This also means that they can be rendered invisible in a PDF or ePub with an updated style sheet.

As always, pull requests are welcome.

2015-04-09
permalink

<a href="/category/blog/">blog</a>

<a href="/tag/howto/">howto</a> <a href="/tag/ruby/">ruby</a> <a href="/tag/software/">software</a> <a href="/tag/ulysses/">ulysses</a> <a href="/tag/wordpress/">wordpress</a>