eksperimental-forks / ex_doc

ExDoc produces HTML and online documentation for Elixir projects
http://elixir-lang.org
Other
0 stars 0 forks source link

Toggle between source code and highlighted code #16

Open eksperimental opened 9 years ago

eksperimental commented 9 years ago

add an icon at the right top corner of any code, (iex, elixir), (and maybe bash) that copies the real code, removing outputs, and prompts, so it can be pasted directly into the shell.

some examples of how frustrating this is: http://elixir-lang.org/getting-started/mix-otp/genevent.html

eksperimental commented 9 years ago

i think what we actually need is button (icon) that toggles between hightlighted source code and plain text ready to be input in the shell.

It could either be a button that toggles bettwen these two icons: https://octicons.github.com/icon/file-text/ https://octicons.github.com/icon/file-code/

or just one, turned on/off

We have two differentes cases to solve: one is for ex_doc, and the other one is for elixir-lang.org

in ex_doc we can create the text in html filtering with elixir, but in elixir-lang.org we cannot do that, so we need to rely on javascript and create the code on the fly. (we could do maybe with a replace in the template, but people my forget about putting the code, so javascript is the best solution)

eksperimental commented 9 years ago

So what are the languages we should support:

For ex_doc:

For elixir-lang.org:

the same!