They block the Hello, Dolly! plugin.
Not cool, WP Engine. Not cool.
They block the Hello, Dolly! plugin.
Not cool, WP Engine. Not cool.
Text smileys are better. :-)
I put my SyntaxHighlighter Brush Pack on WordPress.org, using the excellent git to WordPress.org Subversion instructions to preserve history.
In order to check that it works, I moved my plugin (installed as a git submodule) outside the wp-content/plugins
directory, went to Add Plugin, searched for it, and instructed WordPress to automatically install it. It works! The following CoffeeScript code was highlighted using it:
launch() if ignition is on
If you use WordPress and either CoffeeScript or Clojure, I’d love for you to give it a shot!
I’m working on a plugin for displaying infoboxes for URLs called Resource Infobox. The interface is a shortcode with a single url property. To include an infobox, use an expression like the following:
[resource-infobox url="https://github.com/benatkin/wordpress-resource-infobox"]
This will show an Infobox with some basic information:
Examples of Infoboxes include those on Wikipedia, in the upper-right corner of pages, and the old Crunchbase ones I saw on TechCrunch:
The neat thing about the ones built by this WordPress Plugin is that it renders based on some JSON rules. The current rule file has two resource types, GitHub Repositories and GitHub Users. These are not limited to GitHub, though; with the current implementation they could be written for twitter, Crunchbase, and any URL that has straightforward mapping from the HTML url to the JSON url. Here are the current rules:
{ "github": { "repository": { "url": "https://github.com/:owner/:repo", "api_url": "http://github.com/api/v2/json/repos/show/:owner/:repo", "fields": [ { "label": "Repository", "param": "repo", "url": "https://github.com/:owner/:repo/" }, { "label": "Owner", "param": "owner", "url": "https://github.com/:owner/" }, { "label": "Last Commit", "path": "repository/pushed_at", "type": "date", "format": "Y-m-d" }, { "label": "Watchers", "path": "repository/watchers" } ] }, "user": { "url": "https://github.com/:username", "api_url": "http://github.com/api/v2/json/user/show/:username", "fields": [ { "label": "Username", "param": "username", "url": "https://github.com/:username/" }, { "label": "Followers", "path": "user/followers_count" }, { "label": "Respositories", "path": "user/public_repo_count" } ] } } }
It’s a JSON DSL inspired by the DSL for Django’s admin interface. It has few features now, but following Django’s lead, it can have more features added to it while retaining its essence. The nice thing about using a JSON DSL rather than custom code is that it can easily be validated, and due to its declarative nature, XSS attacks and other undesired behavior can be avoided. It uses WordPress’s esc_attr and esc_url functions to render strings.
I’d love feedback on this. My goals for it include:
I’d also like to make this work with more than just WordPress.