Skip to content

Markdown editor plugin for Question2Answer

Notifications You must be signed in to change notification settings

svivian/q2a-markdown-editor

Repository files navigation

-------------------------------------------------
MARKDOWN EDITOR
Question2Answer plugin
-------------------------------------------------

This is an editor plugin for popular open source Q&A platform, Question2Answer <question2answer.org>. 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 WMD and Showdown scripts for the editor and live preview respectively.



INSTALLATION
-------------------------------------------------

1. Download and extract the `markdown-editor` folder to the `qa-plugins` folder in your Q2A installation.
2. Copy the CSS from sample.css to the bottom of your theme's current stylesheet.
3. Log in to your Q2A site as a Super Administrator and head to Admin > Posting.
4. Set the default editor for questions and answers to 'Markdown Editor'. (The editor does also work for comments, but I would recommend sticking to plain text.)



EXTRA BITS
-------------------------------------------------

Converting old posts:
If you have been running your Q2A site for a little while, you may wish to convert old content to Markdown automatically using the SQL query below. This does not work reliably for HTML content (created via the WYSIWYG editor). It is fairly safe for plain text content but make sure you check your posts afterwards as some formatting may go awry.
Make sure to change `qa_` below to your installation's table prefix if it is different.

    UPDATE qa_posts SET format='markdown' WHERE format='' AND type IN ('Q', 'A', 'Q_HIDDEN', 'A_HIDDEN')