timonwong / OmniMarkupPreviewer

Sublime Text 2&3 plugin to live preview markup files, supported (not limited to) markup formats are markdown, reStructuredText, WikiCreole and textile.
MIT License
500 stars 74 forks source link

KeyError: 'template_name' on export to HTML #47

Closed jonand closed 10 years ago

jonand commented 10 years ago

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.

timonwong commented 10 years ago

Thanks for your comprehensive bug report, I regret I just forgot to fix that soon.