This is an editor plugin for popular open source Q&A platform, Question2Answer. It uses Markdown to format posts, which is a simple text-friendly markup language using for example **bold** for bold text or > for quoting sources.
The plugin uses modified versions of the PageDown scripts (released by Stack Overflow) for the editor and live preview respectively.
markdown-editor
folder to the qa-plugins
folder in your Q2A installation.qa-md-lang-default.php
to the required language code (e.g. qa-tt-lang-de.php
for German) and edit the phrases for your language.In Admin > Plugins, you can set three options:
pagedown/wmd.css
to the bottom of your theme's current stylesheet.pagedown/highlight.min.js
. If you ticked the box for CSS above, copy the CSS from pagedown/highlightjs.css
to the bottom of your theme's current stylesheet.Converting old posts: If you have been running your Q2A site for a little while, you may wish to convert old content to Markdown. This does not work reliably for HTML content (created via the WYSIWYG editor); it is pretty safe for plain text content, but check your posts afterwards as some formatting may go awry. You can convert text posts automatically using this SQL query:
UPDATE qa_posts SET format='markdown' WHERE format='' AND type IN ('Q', 'A', 'Q_HIDDEN', 'A_HIDDEN')
(Make sure to change qa_
above to your installation's table prefix if it is different.)
Most of my code is released under the open source GPLv3 license, and provided with a 'Pay What You Like' approach. Feel free to download and modify the plugins/themes to suit your needs, and I hope you value them enough to donate a few dollars.