I am using Org-mode in Emacs to handle all my technical documentation. I would like to use Emacs to prepare questions that I have for Stack Overflow. Is there an Emacs mode for that, or even better, an extension for Org-mode to handle Stack Overflow formatting? Ideally it should include all formatting options supported by the markdown syntax used in the Stack Overflow question/comment buffers.
Share
Integrating Emacs with Stack Overflow
As mentioned you can use markdown-mode. To integrate markdown-mode with Stack Overflow you can use the Firefox plugin It’s All Text which lets you edit textareas with an external editor. Here is how to set it up:
Install markdown-mode. If you use Debian or Ubuntu you can install it by issuing
or if you’re on emacs 24 (or have package.el on emacs 23) and Marmalade or Melpa you can install it with
Install It’s All Text.
Add the following to your .emacs to enable markdown-mode for Stack Overflow and Stack Exchange textareas:
Alternatively, if
as-external-alistis defined—ifM-x describe-variable RET as-external-alistdoesn’t fail—it will probably override yourauto-mode-alist. It has a slightly different format (it’s a list of pairs instead of a list of cons cells) so this will work:Press the blue edit button at the bottom right side of a textarea to edit it via emacs. The blue edit button is shown in the following screenshot:
In the following screenshot is an Emacs buffer in markdown-mode editing this post:
When you are done editing in Emacs save the buffer to send it to Firefox.
If you want this functionality for other domains you need to change the regexp above. The following recognizes Stack Exchange, Stack Overflow, Ask Ubuntu and Super User:
Using markdown-mode with Org-mode
To use markdow-mode with Org-mode you can use its feature for working with source code. With it you can include blocks of markdown inside your Org-mode buffers which you can edit via markdown-mode. You can use it as follows:
When in an Org-mode buffer enter
<son a newline and press Tab. This will result inEnter
markdownafter#+begin_srcso that you haveWhen inside the source block (between
#+begin_src markdownand#+end_src) press C-c ' to edit the source block with markdown-mode.Edit the source block in markdown-mode.
Press C-c ' to return to the Org-mode buffer and insert the edit. This can look like what the following screenshot shows: