various issues in markdown and rst templates

- remove prompts from default output
- add missing HTML block
- remove double-wrapping of latex
- use plain-markdown indentation for code blocks (could use GFM ``` ` ` `python```)
- images didn't work in either one at all
- markdown extracts output

closes #4024

candidate for backport to 1.1