UPDATE: The final palette has a new home here! Please test and provide feedback (usability, suggestions, bugs)
A note to the readers and voters: This is intended for community use, so please test the palettes in practice! I encourage all answerers to "steal" from each others, and come up with a solution that is the most pleasant / practical to use.
Sjoerd suggested that when we want to post input lines that alternate with output lines, instead of including the In/Out labels, we could simply comment out the output.
Read his suggestion here:
I have seen several people use this style in the past few days. The only problem with it that it requires a lot of manual editing (too much work for my taste).
How can we automate this process?
The challenge is:
Create a palette button that will copy the selection in the format suggested by Sjoerd. Two-dimensional expressions (i.e. things like $\int x^2 \; dx$) should be converted to plain text or input form. The notebook contents must not be modified/destroyed.
An example (directly copied from Sjoerd's post):
In:= D[Cos[x] Exp[x], x] Out= E^x Cos[x] - E^x Sin[x]
should be copied as
D[Cos[x] Exp[x], x] (* ===> E^x Cos[x] - E^x Sin[x] *)
Let us ignore cells that are neither input nor output for now (text, headings, etc.)
Can we create a tool that is good enough to be of practical use to the community?