Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

first commit

  • Loading branch information...
revolunet committed Jan 31, 2012
0 parents commit 5a9df57c7ee3e6600821d8ee0863ba05aacf2951
Showing with 5,148 additions and 0 deletions.
  1. +7 −0 Default.sublime-commands
  2. +19 −0 MarkdownPreview.py
  3. +29 −0 README.md
  4. +428 −0 markdown/__init__.py
  5. BIN markdown/__init__.pyc
  6. +87 −0 markdown/__main__.py
  7. +97 −0 markdown/blockparser.py
  8. BIN markdown/blockparser.pyc
  9. +555 −0 markdown/blockprocessors.py
  10. BIN markdown/blockprocessors.pyc
  11. +31 −0 markdown/etree_loader.py
  12. BIN markdown/etree_loader.pyc
  13. +51 −0 markdown/extensions/__init__.py
  14. BIN markdown/extensions/__init__.pyc
  15. +96 −0 markdown/extensions/abbr.py
  16. +128 −0 markdown/extensions/attr_list.py
  17. +226 −0 markdown/extensions/codehilite.py
  18. +110 −0 markdown/extensions/def_list.py
  19. +52 −0 markdown/extensions/extra.py
  20. +165 −0 markdown/extensions/fenced_code.py
  21. +299 −0 markdown/extensions/footnotes.py
  22. +201 −0 markdown/extensions/headerid.py
  23. +69 −0 markdown/extensions/html_tidy.py
  24. +96 −0 markdown/extensions/meta.py
  25. +36 −0 markdown/extensions/nl2br.py
  26. +114 −0 markdown/extensions/rss.py
  27. +49 −0 markdown/extensions/sane_lists.py
  28. +45 −0 markdown/extensions/smart_strong.py
  29. +98 −0 markdown/extensions/tables.py
  30. +154 −0 markdown/extensions/toc.py
  31. +155 −0 markdown/extensions/wikilinks.py
  32. +458 −0 markdown/inlinepatterns.py
  33. BIN markdown/inlinepatterns.pyc
  34. +162 −0 markdown/odict.py
  35. BIN markdown/odict.pyc
  36. +101 −0 markdown/postprocessors.py
  37. BIN markdown/postprocessors.pyc
  38. +282 −0 markdown/preprocessors.py
  39. BIN markdown/preprocessors.pyc
  40. +275 −0 markdown/serializers.py
  41. BIN markdown/serializers.pyc
  42. +359 −0 markdown/treeprocessors.py
  43. BIN markdown/treeprocessors.pyc
  44. +114 −0 markdown/util.py
  45. BIN markdown/util.pyc
@@ -0,0 +1,7 @@
[
{
"caption": "Markdown Preview: Preview Current File",
"command": "markdown_preview",
"args": {}
}
]
@@ -0,0 +1,19 @@
import sublime, sublime_plugin
import webbrowser
import tempfile
import markdown


class MarkdownPreviewCommand(sublime_plugin.TextCommand):
""" preview file contents with python-markdown and your web browser"""
def run(self, edit):
region = sublime.Region(0, self.view.size())
contents = self.view.substr(region)
tmp_html = tempfile.NamedTemporaryFile(delete=False, suffix='.html')
html = markdown.markdown(contents)
encoding = self.view.encoding()
tmp_html.write('<meta charset="%s">' % self.view.encoding())
tmp_html.write('<link href="https://raw.github.com/revolunet/Markdown-CSS/master/markdown.css" rel="stylesheet"></link>')
tmp_html.write(html.encode(encoding))
tmp_html.close()
webbrowser.open_new_tab(tmp_html.name)
@@ -0,0 +1,29 @@

Sublime Text 2 MarkDown preview
=====

A simple ST2 plugin to help you preview your markdown files.

Just preview the current md file in your web browser.

**Installation :**

- `cmd+shift+P` then `install packages`
- select `MarkdownPreview'
**Usage :**
- once installed :
- use `cmd+shift+P` then `MarkdownPreview` to launch a preview
- or bind some key in your user key binding
**Uses :**
- [python-markdown][0] for markdown parsing
- [clownfart markown.css][1] for markdown styling
The code is avilable at github [https://github.com/revolunet/sublimetext-markdown-preview][2]
[0]: https://github.com/waylan/Python-Markdown
[1]: https://github.com/clownfart/Markdown-CSS
[2]: https://github.com/revolunet/sublimetext-markdown-preview
Oops, something went wrong.

0 comments on commit 5a9df57

Please sign in to comment.
You can’t perform that action at this time.