/pages/tests/highlight/index.md

https://github.com/rcarmo/sushy · Markdown · 43 lines · 29 code · 14 blank · 0 comment · 0 complexity · 12736989957dfb7b79177b1b4634e56a MD5 · raw file

  1. From: Rui Carmo
  2. Date: 2013-07-06 23:33:00
  3. Title: Syntax Highlighting Tests
  4. Index: no
  5. ## Inline [Markdown][m]
  6. The standard [Markdown][m] triple-backquote form.
  7. ```clojure
  8. ; parallel consumption of perishable resources
  9. (defn foo [bar drinks]
  10. (pmap (:patrons bar) (lazy-seq drinks)))
  11. ```
  12. ## PRE tag with `syntax` attribute
  13. This is meant for non-[Markdown][m] content.
  14. <pre syntax="python">
  15. from bottle import view, request, abort
  16. @view("rss")
  17. def render_feed()
  18. if not items:
  19. abort("418", "I'm a teapot")
  20. else:
  21. return {"items": items}
  22. </pre>
  23. ## From file via `src` attribute
  24. This slurps the file into the document and highlights it:
  25. <pre syntax="javascript" src="animate_svg.js"></pre>
  26. ## From missing file via `src` attribute
  27. This should show a nice error message.
  28. <pre syntax="javascript" src="no_file.txt"></pre>
  29. [m]: Wikipedia:Markdown