Giter Club home page Giter Club logo

omnimarkuppreviewer's Introduction

OmniMarkupPreviewer

Description

OmniMarkupPreviewer is a plugin for both Sublime Text 2 and Sublime Text 3 that preview markups in web browsers. OmniMarkupPreviewer renders markups into htmls and send it to web browser in the backgound, which enables a live preview. Besides, OmniMarkupPreviewer provide support for exporting result to html file as well.

OmniMarkupPreviewer has builtin support following markups:

  • Markdown
  • reStructuredText
  • WikiCreole
  • Textile
  • Pod (Requires Perl >= 5.10 and can be found in PATH, if the perl version < 5.10, Pod::Simple should be installed from CPAN.)
  • RDoc (Requires ruby in your PATH)
  • Org Mode (Requires ruby, and gem org-ruby should be installed)
  • MediaWiki (Requires ruby, as well as gem wikicloth)
  • AsciiDoc (Requires ruby, as well as gem asciidoctor)
  • Literate Haskell

Donation

If you find my work useful, please consider buying me a cup of coffee, all donations are much appreciated :)

Donate via PayPal

Installation

With the Package Control plugin

The easiest way to install OmniMarkupPreviewer is through Package Control.

Once you have Package Control installed, restart Sublime Text.

  1. Bring up the Command Palette (Ctrl+Shift+P on Windows and Linux. ++P on OS X).
  2. Type "Install" and select "Package Control: Install Package".
  3. Select "OmniMarkupPreviewer" from list.

The advantage of using Package Control is that it will keep OmniMarkupPreviewer up to date automatically.

Manual Install

Without Git: Download the latest source code, and extract to the Packages directory.

With Git: Type the following command in your Sublime Text Packages directory:

git clone git://github.com/timonwong/OmniMarkupPreviewer.git

The "Packages" directory for Sublime Text 2 is located at:

  • Windows: %APPDATA%\Sublime Text 2\Packages\
  • Linux: ~/.config/sublime-text-2/Packages/
  • OS X: ~/Library/Application Support/Sublime Text 2/Packages/

And for the Sublime Text 3:

  • Windows: %APPDATA%\Sublime Text 3\Packages\
  • Linux: ~/.config/sublime-text-3/Packages/
  • OS X: ~/Library/Application Support/Sublime Text 3/Packages/

Usage

Key Bindings

The default key bindings:

Windows, Linux:

  • Ctrl+Alt+O: Preview Markup in Browser.
  • Ctrl+Alt+X: Export Markup as HTML.
  • Ctrl+Alt+C: Copy Markup as HTML.

OSX:

  • ++O: Preview Markup in Browser.
  • ++X: Export Markup as HTML.
  • Ctrl+Alt+C: Copy Markup as HTML.

Command Palette

Available OmniMarkupPreviewer commands in the command palette:

  • OmniMarkupPreviewer: Preview Current Markup in Browser
  • OmniMarkupPreviewer: Export Current Markup as HTML
  • OmniMarkupPreviewer: Empty Cache

NOTE Command will not be available (greyed out) if current file syntax (or filename) doesn't match any of OmniMarkupPreviewer renderers.

What's New

For a complete list of changes, see CHANGELOG.md

v3.0.0 (02/28/2015)

  • Use new flat github style (old style renamed to github-v1).
  • Upgrade pygments library to v2.0.2, with more lexers.
  • Upgrade Python-Markdown package to v2.4.1 final.
  • Add .mmd file extension support (MultiMarkdown).
  • Upgrade jQuery to 2.1.3 (Say good bye to IE8).
  • server_host setting is now taken into account when launching preview in browser.

v2.0.9 (08/02/2014)

  • Add syntax highlighting support for reStructureText.
  • Prefer to use xdg-open under linux environments.

v2.0.8 (04/15/2014)

  • Fix Sublime Text 2 compatibility (crash).

v2.0.7 (04/14/2014)

  • Fix unreliable default setting overriding, which confuses a lot of users when customizing their settings.
  • Prevent preview from the console, which will simply lead to crash.

v2.0.6 (01/27/2014)

  • Fix Sublime Text 2 compatibility (markdown).

v2.0.5 (01/24/2014)

  • MathJax library is now bundled directly instead of on demand downloading.
  • Python-Markdown module now upgraded to v2.4.
  • Fix incompatibility when using Sublime Text 3 under XFCE.

v2.0.4 (08/10/2013)

  • Fix ruby gems loading in OSX (Required by RDoc, AsciiDoc, Org Mode and MediaWiki).
  • Add AsciiDoc syntax support.
  • Ensure default setting for export_options when not available.

v2.0.3 (07/18/2013)

  • Fix html exporting when file contains images in Sublime Text 3.
  • Fix smart_strong and meta_data extention name for markdown.

v2.0.2 (06/17/2013)

  • Update cherrypy server, add detail information if socket could not be created.
  • Add support for file URIs in images path.

v2.0.1 (05/12/2013)

  • Strip YAML frontmatter for Markdown files automatically.
  • Check syntax name as well as filename extension for MediaWiki files.

v2.0 (03/31/2013)

  • Added support for Org Mode (Requires ruby, and gem org-ruby should be installed).
  • Added support for MediaWiki (Requires ruby, as well as gem wikicloth).
  • Added support for AsciiDoc (Requires ruby, as well as gem asciidoctor).
  • Reviving view (redirecting to the new location) automatically after reconnected.
  • Prevent Package Control for Sublime Text 3 installing this package as .sublime-package (zip archive).
  • Fixed broken ignored_renderer setting.
  • Improved Sublime Text 3 compatibility.

v1.20 (03/15/2013)

  • Add support Sublime Text 3 (Experimental).
  • Add new context command Copy Markup as HTML.
  • Remove unused command Sweep Cache (Remove Unused).
  • Auto scroll now works correctly for documents contain images and MathJax equations.

v1.12 (03/13/2013)

  • Renderes are now loaded asynchronously on startup (faster Sublime Text 2 startup).
  • Add litcoffee support.

License

This plugin released under MIT License:

Copyright © 2012 - 2015 Timon Wong

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Donors

DONORS.md

omnimarkuppreviewer's People

Contributors

charlesroper avatar circlecode avatar ckrybus avatar cmacrander avatar matthewwithanm avatar n1k0 avatar sa1nt avatar timonwong avatar zzjin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

omnimarkuppreviewer's Issues

error in Ubuntu 12.04 x64

OmniMarkupPreviewer: [ERROR] Error while launching default web browser
  Traceback (most recent call last):
    File "./OmniMarkupPreviewer.py", line 81, in launching_web_browser_for_url
    File "./desktop/__init__.py", line 294, in open
    File "./desktop/__init__.py", line 88, in _run
    File ".\subprocess.py", line 633, in __init__
    File ".\subprocess.py", line 1139, in _execute_child

System: Ubuntu 12.04 x64
Sublime Text 2

Update broke it - 404

Hi, got the update a few minutes ago. Used Ctrl+Alt+O to check out a markdown doc and

Error: 404 Not Found

Sorry, the requested URL 'http://localhost:51004/view/28' caused an error:

buffer_id(28) is not valid (closed or unsupported file format)

can run under Linux, except for the CreoleRenderer

OmniMarkupPreviewer: [ERROR] Failed to load renderer: OmniMarkupLib.Renderers.CreoleRenderer
  Traceback (most recent call last):
    File "./OmniMarkupLib/RendererManager.py", line 174, in load_renderers
    __import__(module_name)
    File "./OmniMarkupLib/Renderers/CreoleRenderer.py", line 2, in <module>
    import creoleparser
    File "/home/theophilus/.config/sublime-text-2/Packages/OmniMarkupPreviewer/OmniMarkupLib/./Renderers/libs/creoleparser/__init__.py", line 12, in <module>
    from core import Parser, ArgParser
    File "/home/theophilus/.config/sublime-text-2/Packages/OmniMarkupPreviewer/OmniMarkupLib/./Renderers/libs/creoleparser/core.py", line 13, in <module>
    import genshi.builder as bldr
    File "/home/theophilus/.config/sublime-text-2/Packages/OmniMarkupPreviewer/OmniMarkupLib/./Renderers/libs/genshi/__init__.py", line 26, in <module>
    from genshi.input import ParseError, XML, HTML
    File "/home/theophilus/.config/sublime-text-2/Packages/OmniMarkupPreviewer/OmniMarkupLib/./Renderers/libs/genshi/input.py", line 22, in <module>
    from xml.parsers import expat
    File ".\xml\parsers\expat.py", line 4, in <module>
  ImportError: No module named pyexpat

System: Ubuntu x64 12.04, Sublime Text 2 Dev 2220

So portion of modules distrubted with ST2 is missing.

Type in RenderManager.py: log.exceptions should be log.exception

Couldn't get OmniMarkupPreviewer to do anything and I initially thought it was because I was on Linux but it turns out there's a type in the _load_renderer method of RenderManager.py .

Offending line:

 except:
            log.exceptions('Failed to load renderer module: OmniMarkupLib/Renderers/%s', module_file)

log.exceptions should be log.exception.

Plugin now loads and works(except for the Creole module(which a solution has already been addressed by you).

Thanks a lot!

Previewing an .asciidoc file opens an empty page (Windows)

This is similar to an issue fixed for OS/X, but applies to Windows 7. As with OS/X, the browser opens to a blank page when "Preview Current Markup in Browser" is selected.

Back when the OS/X issue was fixed, your comment was: "Fix ruby gems loading in OSX, fix set_encoding missing in ruby 1.8.x #36"

Hopefully that will help identify this problem too. Thanks again!

Unsaved Textile buffer preview issue

unlike Markdown, unsaved Textile buffer can't be previewed. It needs to be saved on disk first to be able to be previewed.

Please fix to work as markdown.

Thank you.

Markdown renderer

OmniMarkupPreviewer renderers text start with two space as block quote currently. However this is not the case for most Markdown editors(e.g. Mou.app) and previewers (try Github's).

example (press Edit to see Markdown source):

Package Control Messages

OmniMarkupPreviewer:

OmniMarkupPreviewer v1.8 Changelog:

  • OmniMarkupPreview is now able to use user defined browser command for launching
    web browser, through the "browser_command" option.
  • File which is previewing (not already open) can now be previewed correctly in
    browser without returning "404" error.
  • Update cherrypy module in order to fix a random server crash on startup in
    Windows (Refer to CherrPy #1016)

Commands not available for certain syntaxes

  1. The "Preview Current Markup in Browser" command doesn't appear for any non-markdown syntax. This seems logical enough, and maybe just means something should be added to the README. But it had me confused for awhile.
  2. Some legitimate markdown syntaxes have the same problem. For instance, a separate package gives me github-flavored markdown. But I cannot use the preview command with this syntax. Could be solved with a well-commented entry in the default settings allowing me to add my own syntaxes, but I don't see one.

Not working(list has no .copy())

Recently, my ST2 updates OmniMarkupPreviewer from 2.0.5 to 2.0.7.
Then this plugin doesn't work.

When starting ST2, there's a error massage:
cls.OLD_IGNORED_RENDERERS = setting.ignored_renderers.copy()
in ./OmniMarkupLib/RendererManager.py:442

after tracing the code, it seems to be caused by the changing of loading settings.
The old type of setting.ignored_renderers is set, but now list

And set has .copy() whereas list has not.

Changing that line into
cls.OLD_IGNORED_RENDERERS = setting.ignored_renderers[:]
works.

Preview not refreshing

With the latest update, my previews have quit refreshing when the source files are modified or saved. Hitting refresh in the browser works, though. Nothing shows in the console, but Fiddler shows a bunch of traffic, although every request is returning 200 NOT FOUND. I'm using ST3.

The request:

POST http://localhost:51004/api/revive HTTP/1.1
Host: localhost:51004
Connection: keep-alive
Content-Length: 88
Accept: application/json, text/javascript, */*; q=0.01
Origin: http://localhost:51004
X-Requested-With: XMLHttpRequest
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.154 Safari/537.36
Content-Type: application/json; charset=UTF-8
Referer: http://localhost:51004/view/72
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8

{"revivable_key":"RDpcTm90ZXNcVmlydHVhbEFyYm9yZXR1bVxJbnN0YWxsaW5nIE9wZW5UcmVlTWFwLm1k"}

And the response:

HTTP/1.1 200 OK
Content-Length: 23
Content-Type: application/json
Date: Tue, 15 Apr 2014 19:14:09 GMT
Server: cglaptop

{"status": "NOT FOUND"}

Thanks so much for writing this plugin. It's awesome!

Strip YAML front matter

It would be nice for Jekyll/Octopress users to live preview markdown with YAML front matter striped.

a Tab would stop OmniMarkupPreviewer from working

# this is title 
    Tab before,omnimarkdownpreviewer would stop working

if you type above worlds, omnimarkdownpreviewer would stop working, and it you delete this Tab like this

# this is title 
Tab before,omnimarkdownpreviewer would stop working

omnimarkdownpreviewer would be OK. is that a bug?

KeyError: 'template_name' on export to HTML

I just installed OmniMarkupPreviewer on Sublime 3 through Package Control. Tried Ctrl+Alt+O on a markdown file which previewed the file in browser as expected.

Then I tried to export to HTML using Ctrl+Alt+X which didn't work:

error: Error while exporting, please check your console for more information.
OmniMarkupPreviewer: [ERROR] Error while exporting
  Traceback (most recent call last):
    File "C:\SublimeText3\Data\Packages\OmniMarkupPreviewer\OmniMarkupPreviewer.py", line 169, in run
    html_content = RendererManager.render_view_as_html(view)
    File "C:\SublimeText3\Data\Packages\OmniMarkupPreviewer\OmniMarkupLib\RendererManager.py", line 329, in render_view_as_html
    return template(setting.export_options['template_name'],
  KeyError: 'template_name'

Copying the "export_options" from OmniMarkupPreviewers default settings to the User settings seems to have solved the problem.

A possibly related discrepancy:
In OmniMarkupPreviewer.sublime-settings it is mentioned that templates should be placed into ${packages}/User/OmniMarkupPreviewer/templates/. In my installation OmniMarkupPreviewer not installed in the User folder but to ${packages}/OmniMarkupPreviewer while ${packages}/User/OmniMarkupPreviewer was empty.

mw2html.rb not finding wikicloth

b"/Users/adam/Library/Application Support/Sublime Text 3/Packages/OmniMarkupPreviewer/OmniMarkupLib/Renderers/bin/mw2html.rb:3:in `require': no such file to load -- wikicloth (LoadError)\n\tfrom /Users/adam/Library/Application Support/Sublime Text 3/Packages/OmniMarkupPreviewer/OmniMarkupLib/Renderers/bin/mw2html.rb:3\n"

Which browser ?

Still me ;)
My installation is not very catholic, I'd like to know which command OmniMP run to launch the browser ?
Because when I press Ctrl+Alt+O nothing happens and there is nothing in console =/
(I link my browser to x-www-browser).

Antoine.

Attaching Custom CSS

I've been looking for way to:

  1. write my study notes in markdown in .md format (ST3 Markdown Editing)
  2. have it autocompile down to HTML on save (Prepros under windows)
  3. pick up on an external stylesheet of mine (??)
  4. refresh automatically in the browser (Live Reload)

So far I have 1, 2 and 4 wired. They all work great.

However #3 is problematic because markdown doesn't like <head> and <body> tags and etc. I've managed to put a link rel at the top of the document but this is ugly and has obvious limitations.

Does your plugin support this somehow and if not, isn't this something that a lot of people want? This process. Its kind of the obvious thing .. write your notes and documentation in real time, in the browser styled exactly how you want it ...

edit: if the answer is 'yes, just modify this file here, then awesome.

Is there anything more that can be done?
:'

⌘+⌥+O: Preview Markup in Browser stopped working

With this latest upgrade (v 2.0.5), the ⌘+⌥+O preview shortcuts stopped working. I downgraded to the prior version. Hoping this can be a quick hotfix.

Note: I have Sublime 2, so maybe it's just that version?

Text added to end of long doc is not scrolled into view

First I've got to say thank you so much for this brilliant plugin - it's beautiful. I'm really glad you built it. 👍

So the issue I've got is that when I've got a long document in rst or markdown, text added at the end doesn't get scrolled into view in the browser, meaning I have to switch to the browser and manually scroll down to see it. Seeing as text is mostly added to the end of docs, this gets quite frustrating and defeats the purpose of having a live preview. So is there a way of automatically getting the browser view to scroll to where the cursor is in ST?

Preview on MATE desktop does not work

Hello!

Browser preview does not work with MATE desktop.

Error message (from OmniMarkupPreviewer/OmniMarkupLib/desktop/__init__.py:302):

OSError: Desktop 'X11' not supported (neither DESKTOP_LAUNCH nor os.startfile could be used)

Actually, using xdg-open for MATE solves the problem.

Can't get Mediawiki support to work

The preview in browser and export to HTML commands don't appear in the command palette for me. It appears to be looking at which syntax the file is in to determine if the commands are available, but the option for Mediawiki syntax doesn't appear in the command palette either. It seems to work great with Markdown.

I installed the wikicloth gem in my system ruby, which is the ruby that Sublime appears to be using, but it's unclear which feature leverages this so I'm not sure if it's related to my issue or not.

I'm on Mac OS X 10.8.3 using Sublime Text 2.0.1 build 2217.

Math Equation not shown

I have set the setting in omnimarkuppreviewer

"mathjax_enabled": true,

Then the downloading fails, url error for

http://bitbucket.org/timonwong/omnimarkuppreviewer/downloads/mathjax.zip

it turns out that the url is https then i changed the url in OnDemandDownloader.py to

MATHJAX_LIB_URL = 'https://bitbucket.org/timonwong/omnimarkuppreviewer/downloads/mathjax.zip'

still cant show equations

this is the console when i restart sublime after i changed the url

OmniMarkupPreviewer: [INFO] Bottle v0.11.6 server starting up...
OmniMarkupPreviewer: [INFO] Listening on http://127.0.0.1:51004/
OmniMarkupPreviewer: [INFO] Downloading MathJax from https://bitbucket.org/timonwong/omnimarkuppreviewer/downloads/mathjax.zip
OmniMarkupPreviewer: [INFO] Loaded renderer: AsciiDocRenderer
OmniMarkupPreviewer: [INFO] Loaded renderer: MarkdownRenderer
OmniMarkupPreviewer: [INFO] Loaded renderer: RstRenderer
OmniMarkupPreviewer: [INFO] Loaded renderer: TextileRenderer
OmniMarkupPreviewer: [INFO] Loaded renderer: RDocRenderer
OmniMarkupPreviewer: [INFO] Loaded renderer: CreoleRenderer
OmniMarkupPreviewer: [INFO] Loaded renderer: OrgRenderer
OmniMarkupPreviewer: [INFO] Loaded renderer: MediaWikiRenderer
OmniMarkupPreviewer: [INFO] Loaded renderer: PodRenderer
Package Control: No updated packages

On Mac OS/X 10.7.5, previewing an .asciidoc file in browser opens empty page

Thank you for creating this awesome app. I'm using OmniMarkupPreviewer on Linux Mint 15 and love it. But I can't get it to work properly on Mac OS/X 10.7.5.

When I installed OmniMarkupPreviewer, I followed the manual installation instructions. Asciidoc and Asciidoctor are both installed and work properly, as does Sublime. I'm able to use snippits and custom build systems. What's not working is the Export Current Markup to HTML and Preview Current Markup in Browser commands.

When I preview markup in the browser, the window is empty. The url is http://localhost:51004/view/26. When I manually open the generated HTML file, it renders a blank screen. When I examine that HTML code, it contains styles for markdown, but none of my content.

Thanks for any help you can provide.

Will not update the browser view

When I make some changes to the Markup file, the plugin tries to update the browser view, but getting this error in the console continuously... and I have to kill sublime to restart

TypeError: b'L1VzZXJzL2JpYW5qaWFuZy9SZXNlYXJjaC9kZXYvcmVzZWFyY2gtcGxheWdyb3VuZC90aW1lc2VyaWVzLW1vdGlmcy93cml0ZS9Ob3RlLm1k' is not JSON serializable
Traceback (most recent call last):
File "/Users/bianjiang/Library/Application Support/Sublime Text 3/Packages/OmniMarkupPreviewer/OmniMarkupLib/libs/bottle.py", line 764, in _handle
return route.call(**args)
File "/Users/bianjiang/Library/Application Support/Sublime Text 3/Packages/OmniMarkupPreviewer/OmniMarkupLib/libs/bottle.py", line 1578, in wrapper
json_response = dumps(rv)
File "X/json/init.py", line 226, in dumps
File "X/json/encoder.py", line 189, in encode
File "X/json/encoder.py", line 410, in _iterencode
File "X/json/encoder.py", line 384, in _iterencode_dict
File "X/json/encoder.py", line 418, in _iterencode
File "X/json/encoder.py", line 169, in default
TypeError: b'L1VzZXJzL2JpYW5qaWFuZy9SZXNlYXJjaC9kZXYvcmVzZWFyY2gtcGxheWdyb3VuZC90aW1lc2VyaWVzLW1vdGlmcy93cml0ZS9Ob3RlLm1k' is not JSON serializable

Error when preview unsaved markups

OS X, installed via Package Control

Create a new tab, paste some markdown, preview, error in browser:

Error: 404 Not Found

Sorry, the requested URL 'http://localhost:51004/view/31' caused an error:

buffer_id(31) is not valid

error in console:

OmniMarkupPreviewer: [ERROR] 
  Traceback (most recent call last):
    File "./OmniMarkupLib/RendererManager.py", line 67, in _run_queued_item
    File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/posixpath.py", line 111, in basename
    i = p.rfind('/') + 1
  AttributeError: 'NoneType' object has no attribute 'rfind'

Error: 404 Not Found

When trying to preview markdown in browser the browser opens with a 404.

image

Here is the output from st3 console.

OmniMarkupPreviewer: [INFO] Launching web browser for http://localhost:51004/view/83
OmniMarkupPreviewer: [ERROR] Exception occured while rendering using MarkdownRenderer
  Traceback (most recent call last):
    File "X/distutils/sysconfig.py", line 435, in _init_posix
    File "X/distutils/sysconfig.py", line 304, in parse_makefile
    File "X/distutils/text_file.py", line 100, in __init__
    File "X/distutils/text_file.py", line 115, in open
  FileNotFoundError: [Errno 2] No such file or directory: './lib/python3.3/config-3.3m/Makefile'

During handling of the above exception, another exception occurred:

  Traceback (most recent call last):
    File "/Users/nicklang/Library/Application Support/Sublime Text 3/Packages/OmniMarkupPreviewer/OmniMarkupLib/RendererManager.py", line 266, in render_text
    rendered_text = renderer.render(text, filename=filename)
    File "/Users/nicklang/Library/Application Support/Sublime Text 3/Packages/OmniMarkupPreviewer/OmniMarkupLib/Renderers/MarkdownRenderer.py", line 31, in render
    extensions=self.extensions)
    File "/Users/nicklang/Library/Application Support/Sublime Text 3/Packages/OmniMarkupPreviewer/OmniMarkupLib/Renderers/libs/markdown/__init__.py", line 410, in markdown
    md = Markdown(*args, **kwargs)
    File "/Users/nicklang/Library/Application Support/Sublime Text 3/Packages/OmniMarkupPreviewer/OmniMarkupLib/Renderers/libs/markdown/__init__.py", line 138, in __init__
    configs=kwargs.get('extension_configs', {}))
    File "/Users/nicklang/Library/Application Support/Sublime Text 3/Packages/OmniMarkupPreviewer/OmniMarkupLib/Renderers/libs/markdown/__init__.py", line 163, in registerExtensions
    ext = self.build_extension(ext, configs.get(ext, []))
    File "/Users/nicklang/Library/Application Support/Sublime Text 3/Packages/OmniMarkupPreviewer/OmniMarkupLib/Renderers/libs/markdown/__init__.py", line 197, in build_extension
    module = __import__(module_name, {}, {}, [module_name.rpartition('.')[0]])
    File "/Users/nicklang/Library/Application Support/Sublime Text 3/Packages/OmniMarkupPreviewer/OmniMarkupLib/Renderers/libs/markdown/extensions/fenced_code.py", line 80, in <module>
    from .codehilite import CodeHilite, CodeHiliteExtension
    File "/Users/nicklang/Library/Application Support/Sublime Text 3/Packages/OmniMarkupPreviewer/OmniMarkupLib/Renderers/libs/markdown/extensions/codehilite.py", line 28, in <module>
    from pygments.lexers import get_lexer_by_name, guess_lexer, TextLexer
    File "/Users/nicklang/Library/Application Support/Sublime Text 3/Packages/OmniMarkupPreviewer/OmniMarkupLib/Renderers/libs/python3/pygments/lexers/__init__.py", line 18, in <module>
    from pygments.plugin import find_plugin_lexers
    File "/Users/nicklang/Library/Application Support/Sublime Text 3/Packages/OmniMarkupPreviewer/OmniMarkupLib/Renderers/libs/python3/pygments/plugin.py", line 39, in <module>
    import pkg_resources
    File "/usr/local/Cellar/python3/3.2.2/lib/python3.2/site-packages/distribute-0.6.24-py3.2.egg/pkg_resources.py", line 721, in <module>
    class Environment(object):
    File "/usr/local/Cellar/python3/3.2.2/lib/python3.2/site-packages/distribute-0.6.24-py3.2.egg/pkg_resources.py", line 724, in Environment
    def __init__(self, search_path=None, platform=get_supported_platform(), python=PY_MAJOR):
    File "/usr/local/Cellar/python3/3.2.2/lib/python3.2/site-packages/distribute-0.6.24-py3.2.egg/pkg_resources.py", line 106, in get_supported_platform
    plat = get_build_platform(); m = macosVersionString.match(plat)
    File "/usr/local/Cellar/python3/3.2.2/lib/python3.2/site-packages/distribute-0.6.24-py3.2.egg/pkg_resources.py", line 249, in get_build_platform
    plat = get_platform()
    File "X/distutils/util.py", line 103, in get_platform
    File "X/distutils/sysconfig.py", line 526, in get_config_vars
    File "X/distutils/sysconfig.py", line 441, in _init_posix
  distutils.errors.DistutilsPlatformError: invalid Python installation: unable to open ./lib/python3.3/config-3.3m/Makefile (No such file or directory)

reStructuredText preview does not seem to support syntax highlighting

The following reStructuredText results in a non-highlighted code-block

.. code:: javascript

      function test()
      {
        console.log("test");
      }

This is how it renders on my machine
(using OmniMarkupPreviewer, Sublime Text 3, OS X, in Chrome):
image

However, previewing Markdown does do correct syntax highlighting. The following:

```javascript
function test()
{
  console.log("test");
}
```

renders as:
image

on my machine.

Can't start local server in Sublime Text 3

Here is the error output:

OmniMarkupPreviewer: [INFO] Bottle v0.11.6 server starting up...
OmniMarkupPreviewer: [INFO] Listening on http://127.0.0.1:51004/
Exception in thread Thread-4:
    Traceback (most recent call last):
    File "X/threading.py", line 639, in _bootstrap_inner
    File "/Users/eddiechan/Library/Application Support/Sublime Text 3/Packages/OmniMarkupPreviewer/OmniMarkupLib/Server.py", line 212, in run
    bottle_run(server=self.server)
    File "/Users/eddiechan/Library/Application Support/Sublime Text 3/Packages/OmniMarkupPreviewer/OmniMarkupLib/Server.py", line 200, in bottle_run
    server.run(app)
    File "/Users/eddiechan/Library/Application Support/Sublime Text 3/Packages/OmniMarkupPreviewer/OmniMarkupLib/Server.py", line 185, in run
    self.srv.start()
    File "/Users/eddiechan/Library/Application Support/Sublime Text 3/Packages/OmniMarkupPreviewer/OmniMarkupLib/libs/cherrypy/wsgiserver/wsgiserver3.py", line 1539, in start
    raise socket.error(msg)
OSError: No socket could be created

Browser on Windows doesn't show anything

When I try to preview a Markdown file, the new blank tab opens in browser with the address localhost:51004/view/27 or like, but never shows anything, just stays blank. I guess I don't have server running or something.

[ST3] ,can't export to html when file contains images

>>> view.run_command('omni_markup_export')
OmniMarkupPreviewer: [ERROR] Exception occured while rendering using MarkdownRenderer
  Traceback (most recent call last):
    File "/home/matthieu/.config/sublime-text-3/Packages/OmniMarkupPreviewer/OmniMarkupLib/RendererManager.py", line 267, in render_text
    return post_process_func(rendered_text, fullpath)
    File "/home/matthieu/.config/sublime-text-3/Packages/OmniMarkupPreviewer/OmniMarkupLib/RendererManager.py", line 318, in render_text_postprocess_exporting
    return cls.IMG_TAG_RE.sub(encode_image_path, rendered_text)
    File "/home/matthieu/.config/sublime-text-3/Packages/OmniMarkupPreviewer/OmniMarkupLib/RendererManager.py", line 312, in encode_image_path
    data_uri = open(local_path, 'rb').read().encode('base64').replace('\n', '')
  AttributeError: 'bytes' object has no attribute 'encode'

Doesn't open default browser on Ubuntu 14.04

When trying to open preview in the browser it returns the following error:

/.config/sublime-text-3/Packages/OmniMarkupPreviewer/OmniMarkupLib/desktop/__init__.py", line 98, in _run
    opener = subprocess.Popen(cmd, shell=shell)
    File "X/subprocess.py", line 818, in __init__
    File "X/subprocess.py", line 1416, in _execute_child
  FileNotFoundError: [Errno 2] No such file or directory: 'gnome-open'

It seems that in (a clean and fresh install of) Ubuntu 14.04 gnome-open is not installed by default, and maybe gvfs-open should be used instead.
In Ubuntu 13.10 it worked fine though, with gnome-open.

Extra markup removal

Hi, how do i prevent plugin to keep adding these 's and HTML entities to exported HTML?
I find it annoying and would like to know if i can override that?

Check..
wlqsm6p

Configurable tab_length

All of my Markdown documents use 2-space tabs but Python Markdown expects 4 by default. It would be really great if a configurable tab_length parameter could make its way to markdown.markdown(...) in MarkdownRenderer.

ImportError: No module named _fileio

Hello !
I have an issue with your package :

Traceback (most recent call last): File "./sublime_plugin.py", line 62, in reload_plugin File "./OmniMarkupPreviewer.py", line 46, in <module> from OmniMarkupLib.Setting import Setting File "./OmniMarkupLib/Setting.py", line 3, in <module> import OnDemandDownloader File "./OmniMarkupLib/OnDemandDownloader.py", line 24, in <module> import io File ".\io.py", line 63, in <module> ImportError: No module named _fileio

So I can't use it ! (It's sad =()

Antoine.

(On Ubuntu Server 12.10 with Gnome Shell and Python 2.7.3)

Console filled with tracebacks

Over and over again:

Traceback (most recent call last):
  File "/Users/igazit/Library/Application Support/Sublime Text 3/Packages/OmniMarkupPreviewer/OmniMarkupLib/libs/bottle.py", line 764, in _handle
    return route.call(**args)
  File "/Users/igazit/Library/Application Support/Sublime Text 3/Packages/OmniMarkupPreviewer/OmniMarkupLib/libs/bottle.py", line 1575, in wrapper
    rv = callback(*a, **ka)
  File "/Users/igazit/Library/Application Support/Sublime Text 3/Packages/OmniMarkupPreviewer/OmniMarkupLib/Server.py", line 141, in handler_api_revive
    buffer_id = f.result()
  File "/Users/igazit/Library/Application Support/Sublime Text 3/Packages/OmniMarkupPreviewer/OmniMarkupLib/Common.py", line 353, in result
    reraise(exc[0], exc[1], exc[2])
  File "/Users/igazit/Library/Application Support/Sublime Text 3/Packages/OmniMarkupPreviewer/OmniMarkupLib/Common.py", line 44, in reraise
    raise value
  File "/Users/igazit/Library/Application Support/Sublime Text 3/Packages/OmniMarkupPreviewer/OmniMarkupLib/Common.py", line 340, in __call__
    self.__result = self.__func(*self.__args, **self.__kwargs)
  File "/Users/igazit/Library/Application Support/Sublime Text 3/Packages/OmniMarkupPreviewer/OmniMarkupLib/Server.py", line 139, in <lambda>
    f = Future(lambda: RendererManager.revive_buffer(revivable_key))
  File "/Users/igazit/Library/Application Support/Sublime Text 3/Packages/OmniMarkupPreviewer/OmniMarkupLib/RendererManager.py", line 371, in revive_buffer
    if filesystem_path_equals(view.file_name(), revivable_key):
  File "/Users/igazit/Library/Application Support/Sublime Text 3/Packages/OmniMarkupPreviewer/OmniMarkupLib/RendererManager.py", line 88, in filesystem_path_equals
    return path1.lower() == path2.lower()
AttributeError: 'NoneType' object has no attribute 'lower'

I'm a python dev, but I don't know how to grab the exception in a debuggable fashion and see what it was supposedly trying to render. Given that either path1 or path2 (or both) are None, maybe that would offer a clue as to what is broken. Some guidance here would be helpful.

v2.0.7 does not works.

v2.0.7 does not works on my MacBook.

  • OS X 10.9.2
  • ST2 v2.0.2
  • Python 2.7.5

log

Traceback (most recent call last):
  File "./sublime_plugin.py", line 62, in reload_plugin
  File "./OmniMarkupPreviewer.py", line 398, in <module>
    plugin_loaded()
  File "./OmniMarkupPreviewer.py", line 394, in plugin_loaded
    RendererManager.start()
  File "./OmniMarkupLib/RendererManager.py", line 481, in start
    cls.on_setting_changing(setting)
  File "./OmniMarkupLib/RendererManager.py", line 442, in on_setting_changing
    cls.OLD_IGNORED_RENDERERS = setting.ignored_renderers.copy()
AttributeError: 'list' object has no attribute 'copy'

Package Control: Error downloading package

Using Sublime Text 2.0.1 (2217) on Mac OS X 10.8.2, trying to install via Package Control gives no installation successful confirmation and logs the following:

Package Control: Error downloading package. HTTP error 404 downloading https://nodeload.github.com/timonwong/OmniMarkupPreviewer/zipball/v1.0.1.

Add a TOC feature

Is it possible to add a placeholder interpretor, generating a Table Of Content for main markup language (like markup,textile, and so on...) ?

Sample: a textile file :

Summary

$[toc}

h1. level1

lorem ipsum 
lorem ipsum 
lorem ipsum 
lorem ipsum 
lorem ipsum 

h2. level 2

lorem ipsum 
lorem ipsum 
lorem ipsum 
lorem ipsum 

will drive to get $[toc} replaced by a

1. Level1
  1.1. level2

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.