Skip to content

yang/wp-easy-filter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

Overview
--------

This is a simple, general filter plugin for [WordPress].  You specify a mapping
from tags to commands, such as:

  $tag2cmd = array('pandoc' => '/usr/bin/pandoc -S --tab-stop=2');

Then, for any posts which start with a shebang line containing that tag, as in:

  #!pandoc
  Hello, world.

the plugin will feed the post contents (minus the shebang line) to the mapped
command's stdin, and return the rendered output to WordPress for display.

This plugin was designed to allow me to start using [Pandoc] for writing my
blog posts.  (I couldn't force myself to use the [PHP Markdown Extras] plugin.)

It disables the `wpautop` filter, which automatically inserts `<p>` tags (among
other magic), because that filter cannot properly parse the style of HTML that
Pandoc outputs.

Setup
-----

Drop `easyfilt.php` into your `wp-content/plugins/` directory, then activate
the plugin from the admin interface.

Links
-----

The author of [PHP Markdown Extras] wrote an [informative blog post] describing
problems he had getting his filter to work properly and co-exist with the other
built-in filters.

Changes
-------

version 0.2, 2008-10-23

- fixed debugging code

version 0.1, 2008-10-22

- initial release

[WordPress]: http://www.wordpress.org/
[Pandoc]: http://johnmacfarlane.net/pandoc/
[PHP Markdown Extras]: http://michelf.com/projects/php-markdown/extra/
[informative blog post]: http://michelf.com/weblog/2005/wordpress-text-flow-vs-markdown/

About

Pipe blog post raw text through some command. Originally written so that I could use Pandoc.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published