Skip to content

chrisfesler/markdown-for-p2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Markdown for P2

This fork

The original plugin renders markdown directly in php. For me, this was pretty limiting: I want math; I want syntax highlighting in my codeblocks, etc. So I excised as much of the rendering code as I could do in a short time, and replaced it with a call to pandoc. The only other significant change is the inclusion of relevant stylesheets and javascript.

TODO

  • this plugin needs an admin page, so you can specify the exact commandline
    • could allow use of other markdown converters (like kramdown)
    • could allow setting of specific options, which are currently hardcoded (meta-TODO: add a link)
    • could allow specification of the highlightjs style (currently solarized light)

Acknowledgement (and for future reference)

This is the first time I've needed to write any PHP. I would have had a much more miserable time getting the stylesheets and javascript I needed included correctly had I not found a tutorial by Japh Thomson that directed me to the necessary incantations.

Original README

Contributors: ryanimel Tags: p2, markdown, formatting, comments Requires at least: 3.0 Tested up to: 3.4.1 Stable tag: 0.1.1 License: GPLv2 or later

Markdown for P2 will enable Markdown formatting within your P2 theme status updates and comments.

Description

Markdown for P2 will enable Markdown formatting within your status updates and comments.

If you use P2 for any stretch of time you might find yourself in a situation where you start typing out HTML. Since posting from P2 happens (or should) entirely from the front end of the theme, by default formatting options aren't available. So if you want to format a list, let's say, you might be tempted to start typing out ul and li tags. Or perhaps add formatting buttons that might clutter up the interface.

Markdown for P2 is another option, and will allow you to use the Markdown format when you post to P2. Learn more about Markdown at John Gruber's site.

Kudos

  • Markdown, of course, is a John Gruber production.
  • This plugin is almost entirely the work of Michel Fortin (released under the GPL, his copyright is included in the file), but wasn't bundled into a neat plugin on WordPress dot org, and not specifically for this purpose. The credit for that code goes to…
  • Markdown support added using Adam Backstrom's code via this Github Gist.
  • Markdown logo (in banner image) credit to Dustin Curtis. Lovely, isn't it?

Note

Technically this plugin will work with any WordPress site -- it simply checks the_content and comment_text for Markdown -- but this plugin is really only tested with P2. If you're interested in using Markdown on your non-P2 blog, I'd recommend Markdown on Save which I think will provide a better user experience in that situation.

== Installation ==

Upload the Markdown for P2 plugin to your blog or install it automatically via the dashboard. Activate it and enjoy typing in Markdown.

== Changelog ==

= 0.1 =

  • Pulled together the first functioning plugin. It could be fixed up bit I'm sure, but this works for a first version.
  • Released July 5, 2012

Releases

No releases published

Packages

No packages published