Skip to main content
5 of 10
added 54 characters in body
Jeff Atwood
  • 960
  • 1
  • 12
  • 18

Stack Exchange Side-By-Side Edit and Preview

In response to requests for an option to show the markdown preview next to the text editor, and my own desire for this feature, I have created a small user script to do this. The Stack Exchange Side-By-Side Editor (SE-SBS) adds a link to your edit toolbar to enter side-by-side editing mode.

sbs launch

This mode creates a lightboxed window with just the edit text area and the markdown preview. In Chrome, the edit area will resize dynamically with the window to best fit the size. The markdown preview will always be the default width, so that your preview looks exactly how it will on the page.

stack exchange side-by-side

This script is also designed to play nicely with the SE Editor Toolkit. When the editor toolkit is detected, the link is shortened to allow space for the toolkit's buttons. The editor toolkit is disabled in side-by-side mode, but gets re-enabled when you return to normal editing mode.


##How to install##

Download the script here, then follow the instructions on the Stack Apps tag-wiki. Tested in Firefox 4 w/ Greasemonkey and Chrome 10.


##Compatibility##

Works for asking a question, editing an existing question or answer, and adding a new answer. Tested on Stack Overflow, Meta Stack Overflow, Server Fault, Super User, Web Apps, Gaming, Ask Ubuntu, OnStartups, and several other SE 2.0 sites.


##Known problems:##

  • Edit text area does not automatically resize in Firefox. This is due to how position:fixed is handled in Firefox differently from in Chrome. A workaround is in progress.

  • Markdown preview automatically scrolls back to the top whenever the preview is refreshed. Still under investigation.


##License##

This script is released under a Creative Commons Attribution-NonCommercial-ShareAlike license. Basically, you're free to change and redistribute it for non-commercial purposes if you credit the author (myself).

nhinkle
  • 481
  • 3
  • 8