vermiculus / sx.el

Stack Exchange for Emacs
http://stackapps.com/q/3950
709 stars 40 forks source link

Previewing question/answer on browser while writing it #303

Open nephewtom opened 9 years ago

nephewtom commented 9 years ago

Hi Sean. Is it possible to refresh the browser (visit) while writing a question or answer? Thanks!

vermiculus commented 9 years ago

Which browser? The question list buffer or the question buffer? (I think we also run into the problem of 'which list is which', but I'm not certain.)

nephewtom commented 9 years ago

Sorry if my question was not clear. When reading a question on sx-question buffer, I press 'a' to answer it. A new buffer sx draft answer emacs XXXXX is opened, and I can edit my answer. I can see two shortcuts C-c C-c: to finish and Send and C-c C-k to discard draft. I would like to be able to see how the answer looks like on the StackExchange site before posting it. And I wonder if it is possible to "visit" it on the browser.

Currently, I'm using "Edit with Emacs" on Chrome. When I click on the browser, a new Emacs buffer is created (I chosed markdown-mode to edit it). There, I can press C-x C-s, I see how the browser updates the changes. To post the answer I have to do it through the button in Chrome.

Hope this clarifies my question.

Malabarba commented 9 years ago

I see now. What you want is called "previewing".

The stack exchange API has a render method that gives us the html that's generated by a given markdown. We could save that to a temp file and open it in a browser.

vermiculus commented 9 years ago

Neat idea. There are also API calls for a given site's styling; we might be able to mock-up some 'okay' CSS.