Giter VIP home page Giter VIP logo

sublimetext-markdown-preview's Introduction

Sublime Text Markdown Preview

New Repository location: https://github.com/facelessuser/MarkdownPreview. Please direct all issues, pulls, and feature requests to the new repository

Preview and build your markdown files quickly in your web browser.

⚠️ This project is now maintained here : facelessuser/MarkdownPreview.

Support

  • Any bugs about Markdown Preview please feel free to report here.

sublimetext-markdown-preview's People

Contributors

adamralph avatar albertcthomas avatar alch avatar bps10 avatar christiansiegert avatar christianvuerings avatar chronossc avatar cowboy avatar curtisgibby avatar danmactough avatar duncanhills avatar edvandance avatar edwardball avatar evanpurkhiser avatar facelessuser avatar gkampolis avatar hoffmannp avatar hozaka avatar int3h avatar jnraine avatar lyrixx avatar phette23 avatar qrohlf avatar revolunet avatar reyronald avatar sauerbraten avatar sdefresne avatar stummjr avatar tommi avatar xpol 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  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

sublimetext-markdown-preview's Issues

Port to Sublime Text 3

Currently, under Windows 7 x64 / Sublime Text 3 build 3008, MarkdownPreview returns the following error:

reloading plugin Markdown Preview.MarkdownPreview
Traceback (most recent call last):
  File "C:\sublimetext3\sublime_plugin.py", line 65, in reload_plugin
    m = importlib.import_module(modulename)
  File "X/importlib/__init__.py", line 88, in import_module
  File "<frozen importlib._bootstrap>", line 1577, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1558, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1525, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 586, in _check_name_wrapper
  File "<frozen importlib._bootstrap>", line 1023, in load_module
  File "<frozen importlib._bootstrap>", line 1004, in load_module
  File "<frozen importlib._bootstrap>", line 562, in module_for_loader_wrapper
  File "<frozen importlib._bootstrap>", line 854, in _load_module
  File "<frozen importlib._bootstrap>", line 981, in get_code
  File "<frozen importlib._bootstrap>", line 313, in _call_with_frames_removed
  File "C:\sublimetext3\Data\Packages\Markdown Preview\MarkdownPreview.py", line 148
    print "Markdown Preview: executing", cmd
                                      ^
SyntaxError: invalid syntax

Also, it looks like Will Bond's PackageControl will require a new package.json to support the 2 vs. 3 difference

[Feature Request] Generate HTML in a new tab

Can you please add a command to generate the HTML from the markdown source and just show it in a new tab?

It should be 99% the same to the current proccess, but showing the result in Sublime Text instead of a browser window (prefferably without the CSS).

Can't open preview from sublime text 2

Hi, I'm facing an issue with this plugin on a LinuxMint distribution (v13). Can't get it to launch the preview. In the console, i've got :

Traceback (most recent call last):
  File "./sublime_plugin.py", line 356, in run_
  File "./MarkdownPreview.py", line 92, in run
  File "./desktop/__init__.py", line 277, in open
OSError: Desktop 'X11' not supported (neither DESKTOP_LAUNCH nor os.startfile could be used)

It might be a configuration problem but which one ?

I first add a comment on #2 and figure out later that it was closed so there aren't any chance to get it known...

Basic functionality doesn't work with non-standard WM

I use a tiling window manager, which apparently means I can't use this plugin.

It seems it's checking which Desktop Manager is running to determine which GUI dialog tool should be available. I only glaced through the code, so please correct me if I'm wrong.

Two questions come to mind:

  • Are the dialog boxes absolutely needed for the basic functionality of this plugin? Or could it still offer some working subset without dialog boxes?
  • Could you test which GUI toolkit is available, instead of which window manager is running? (Smells like browser detection.)

Should it matter to this plugin which window manager the user is running? I have no problem installing zenity or Xdialog to make it work, but there's no way in hell I'm using Gnome, Mate or KDE.

Preview does not update on save

I have installed Livereload plugin in sublime text and chrome. I am editing a markdown file and have https://github.com/revolunet/sublimetext-markdown-preview installed. I make an edit and press ctrl+shift+P -> preview in browser and chrome opens up an html file. Now I enabled livereload on that page. I also have enabled the file:// urls for this plugin. Now when I make any changes to my markdown file, the changes don't get reflected in chrome.

Underscores to define bold text do not match github.

According to the github markdown cheatsheet:

__This will also be bold__

Will render as:

<strong>This will also be bold</strong>

as you can see: This will also be bold

When previewing in Sublime (with "parser": "github") I get:

<p>__This will also be bold__</p>

about preview on save feature

I don't the preview on save feature is handy, sometime it even a annoy to me.
When I save markdown file, it not mean I want to preview the file. I save file frequently much.
It will better if there is option to turn on/off this.

ImportError: No module named unicodedata

After updating to the latest Sublime Text 2, I've been getting this error sporadically when running markdown_preview:

Traceback (most recent call last):
  File ".\sublime_plugin.py", line 362, in run_
  File ".\MarkdownPreview.py", line 66, in run
  File ".\markdown2.py", line 174, in markdown
  File ".\markdown2.py", line 319, in convert
  File ".\markdown2.py", line 781, in _run_block_gamut
  File ".\markdown2.py", line 1295, in _do_headers
  File ".\markdown2.py", line 1272, in _atx_h_sub
  File ".\markdown2.py", line 1222, in header_id_from_text
  File ".\markdown2.py", line 1937, in _slugify
ImportError: No module named unicodedata

This is using Markdown Preview version 2012.08.12.18.21.50. Here's my Sublime Text build version:

Version: 2.0.1
Build: 2217

List-items being output as md5-hash

I'm not sure what caused this but under certain circumstances list-items are being shown as md5-hashes (in the screenshot you can see two list-items f and g were instead being shown as a a md5-hash).

Bildschirmfoto vom 2013-03-23 16:07:45

I got this bug in my README and reduced it to the bare essentials in a test .md file which shows this bug.

PlugIn version: 2013.03.13.07.11.59

Is it possible to support python markdown extensions

rt.

I've tried to modified MarkdownPreview.py:

    # convert the markdown
    markdown_html = markdown.markdown(contents, extensions=['extra','toc'])

It's not working. I can't preview any file. How could I debug it? Thanks for this nice plugin anyway.

Default, hard coded path to markdown.css is wrong

I installed this plugin by using Package Control's Add Repository functionality. The plugin gets installed in the sublimetext-markdown-preview folder. MarkdownPreview.py references the markdown.css file using a different path, Markdown Preview. This makes the command fail.

In MarkdownPreview.py I've replaced

styles = open(os.path.join(sublime.packages_path(), 'Markdown Preview', 'markdown.css'), 'r').read()

with

styles = open('markdown.css', 'r').read()

and it works. If the CSS is always going to be at the same place as MarkdownPreview.py, I don't think the whole path is necessary.

Offline GitHub or something else?

Are there any plans to support offline GitHub Markdown?

Default python-markdown2 parser doesn't play well with tables and Wiki format is horrible.

How can I use Pandoc or maybe there is something better than it?

Allow linking of other files than just <img>

I'm working on a tutorial for a third party, and wanted to be able to use markdown for the article, but also include things like javascript files for the actual demos. Looking at the code, it appears that only img files get their source attribute modified. Could support also be added for at least script tags?

Preview doesn't parse multi-paragraph lists correctly

1.   A list item.

    With multiple paragraphs.

2.  Another item in the list.

Should produce:

<ol>
<li><p>A list item.</p>
<p>With multiple paragraphs.</p></li>
<li><p>Another item in the list.</p></li>
</ol>

But instead produces:

<ol>
<li><p>A list item.</p></li>
<ol>
<p>With multiple paragraphs.</p>
<ol>
<li><p>Another item in the list.</p></li>
</ol>

Based on the original syntax guide.

Markdown Preview doesn't handle TOC headings in the correct order

Consider this document:

Test Markdown Preview
=====================
[TOC]

Heading 1
---------

### Subheading 1.1
Text 1.1

### Subheading 1.2

Heading 2
---------

### Subheading 2.1

Heading 3
---------

### Subheading 3.1

Looks decent enough, no? A series of ---- is equivalent to ## when it comes to generating headings. For sub-headings there is no equivalent, so ### is needed. However, when Markdown Preview generates the TOC all the subheadings come after the headings, that is, not in the order they are defined. Here's a screenshot to demonstrate the problem:
2013-04-17-190037_636x1005_scrot

If I generate html via the markdown tool that comes in Python, I don't see this problem.

UTF-8 Parsing Issues

Hi,
Thanks for this plugin, it's great and very helpful but I am still getting UTF-8 issues for some reason. I am using version 2012.04.30.05.38.02 from the package installer. Which seems to match the latest github commit that says it fixes UTF-8.

Even an simple file with only the content Über doesn't work, it becomes Ãœber.

Sublimetext Beta, Build 2181. Mac OS 10.7.2

Preview: current file in browser opens in the editor, instead of the default browser, on OS X Mountain Lion

Hi,

Similar issues have been reported here and here. When I try to Markdown Preview: current file in browser it opens in the editor, in an HTML formatted file, instead of my default browser.

/Library/Application Support/Sublime Text 2/Packages/Markdown Preview/package-metadata.json:
{"url": "https://github.com/revolunet/sublimetext-markdown-preview", "version": "2012.08.22.09.37.42", "description": "markdown preview plugin for sublime text 2"}

Sublime Text 2 Version 2.0.1, Build 2217

OS X Version 10.8 (Mountain Lion)

My default browser: Google Chrome 21.0.1180.82 (Stable)

Feature Req: Live Preview

It would be really neat if we could hook up the Markdown preview with LiveReload for ST2. I guess the key to this would be triggering a build on save and a consistent temp file. So you could preview the file, engage the LiveReload Chrome extension, then subsequent saves in ST would update the temp HTML file. LiveReload would detect the change and reload the page.

Edit: Alternatively you could pull live.js into the rendered html file and then subsequent saves would trigger a rebuild of the same file.

This combination would make ST2 a brilliant MD editor.

Hangs when browser is not "default" on Linux

Google Chrome is my default browser, however preview does not recognize it correctly. See my earlier issue for this problem.

To work around it, I changed the settings to:

"browser": "google-chrome"

When I preview in browser it launches Chrome which shows the previes. But then Sublime hangs until I close Chrome.

The fix:

Change (around line 162)

result = os.system(cmd)

To:
result = os.system(cmd + " &")

I just hacked the change in, and it will probably fail on Darwin, etc without some kind of guard statement.

But that gets me past my problem.

_italic_ and __bold__ don't work

in line 9 of sample.md

this is *italic* and this is **bold** . another _italic_ and another __bold__

but the html is:

<p>this is <em>italic</em> and this is <strong>bold</strong> . another _italic_ and another __bold__</p>

Emoji Support

Everybody loves emoji, those little icons make people deliriously happy.

🍖 💩 🌵 🐫 :neckbeard:

Finds wrong default browser on Linux Mint with Cinnamon desktop

My default browser is Google Chrome.

It's set in my preferred applications.

mimeopen x.html

opens files in Chrome.

Double clicking in the file browser opens in Chrome.

But preview in Browser launches Firefox.

I worked around the problem, by setting:

"browser": "google-chrome"

That launched Chrome but created another issue:

Sublime hung until the Chrome was closed.
'
I have submitted this as a separate issue, and I have a fix for it.

Preview doesn't open in default browser

I'm using Windows XP SP2 and have Chrome as my default browser. Issuing the command always opens the preview in IE, even if IE is not currently running.

I've had a look in MarkdownPreview.py but there's no explicit mentioning of the browser used to preview the file.

Error when putting a link in italic

Hi, when I'm trying to do this:

_This is [my_link](http://domain.com/some_path) I built it myself._

I don't get the whole link in italic, instead it stops right after it and I built it myself. is normal again.

Jump to currently edited section

When editing a big wiki document, it would be handy to scroll down browser page (jump) automatically to currently edited section.

For example, if I'm editing wiki document My doc.md at section "My Summary ", the preview would navigate browser to corresponding section anchor my-doc#my-summary.

Is it possible to support github flavored markdown

I've tried to modified MarkdownPreview.py:

before

markdown_html = markdown.markdown(contents)

after

data = json.dumps({"text":contents, "mode":"gfm"})
url = "https://api.github.com/markdown"
value = urllib2.urlopen(url, data)
html = value.read()
markdown_html = markdown.markdown(html)

I can see html.
But I cannot use normal markdown preview in this case.

I think that I must support css too.

Do you have any plan to support github flavored markdown?

Previewing Windows 1252 encoded files fails

Hi,

as mentioned in the title, previewing Windows 1252 encoded files fails.
I'm using the default setup (internal parser).

The failure reason and how I solved it, is here:
EdVanDance/subl-text-2@7bdf71a3826baabf45944b1a753822d5d5b03cb5

Greetings,
Ed

Syntax Highlighter

Hi,

I found that syntax highlighter doesn't work when preview in browser, is there any way to fix it and include to the final HTML so we could have a very nice HTML with all resources embedded :-)

Thanks.

Command not appearing

This might be a noob question...

The plugin was working for a while but now the command (markdown preview) is not pulling up in the Package Control Manager. Is there a way to fix this?

Doesn't work on Windows

i'm on a readme.md file and when I press ctrl+shift+p markdown preview isn't on the list.

Not rendering correctly

For the following codes:

*   list item 1

        % test.tex
        \documentclass{exam}
        \usepackage{xeCJK}
        \setCJKmainfont{WenQuanYi Zen Hei Sharp}

# Heading

*   list item 2

    paragraph in list item

Output:

alt

The content under the heading are not rendered correctly with your extension, what's happend?

After removing the the line \setCJKmainfont{WenQuanYi Zen Hei Sharp}

*   list item 1

        % test.tex
        \documentclass{exam}
        \usepackage{xeCJK}

# Heading

*   list item 2

    paragraph in list item

Output:

alt

It works again...

Weird : /

Better styling for code blocks

I want to start by saying that this plugin is a great addition.

I think better styling for code blocks would be better. Like an outline around the code and a slight background color change (something subtle like Github does. I couldn't tell my code blocks were targeted correctly until I looked at the html source.

I think some general wider page margins might be nice as well.

Thanks for the great plugin!

Include GitHub Markdown syntax highlighter CSS

If I have this code in my Markdown file:

```js
var x = 1;
var y = x + " testing";
var z = new RegExp(".");
```

When previewing, I don't see any syntax highlighter coloring:

before

If I grab the .css file from one of my GitHub gists and add it into the generated HTML however, all the colors are rendered as I would expect:

after

Can the appropriate syntax highlighter CSS be added into the rendered HTML?

Save as HTML?

Hi, I'm wondering if there's a way to add a command that would save (or export, or build, whatever) the file into the folder of the source, using the name of the source, instead of saving in a temp file?

i.e.: When I'm done editing and previewing C:\index.md, have it save into C:\index.html, instead of C:/Users/bering/appdata/local/temp/76.html

Thanks!

Remove outline for @media print

I think it would be a good idea to include

body {outline: none;}

to the @media print section of the standard CSS file. This improves printing to paper as well as PDF. Currently, you will get about 10px of #FAFAFA at the top and also at the end of the text filling up the last page. Adding the line mentioned above fixed this for me and gave me a nice clean PDF.

Preview in Browser command fails ("cannot execute none")

On my system (OS.X 10.7.4, SublimeText2 2217), I have a problem. I can see the command execute from the ST2 terminal, but a dialog pops up:

cannot execute none Please check your Markdown Preview settings

The settings file, MarkdownPreview.sublime-settings, has the browser set to

"browser": "default"

I commented it out and tried replacing it with

"browser": "/Applications/Google Chrome.app"

But I got the same error. So I tried hacking to source file, MarkdownPreview.py. On line 107, I replaced

cmd = '"%s" %s' % (config_browser, tmp_fullpath)

with a hardcoded link to my Chrome application

cmd = '"/Applications/Google Chrome.app" %s' % (tmp_fullpath)

This resolved the problem. Now running the Markdown Preview: preview in browser command successfully executes and opens chrome with the converted and styled text. So I suspect there is a bug in how the MarkdownPreview plugin is reading it's config file (correct paths etc etc?).

Cheers
Mac

P.S. Here is some info on what version of the package I have, from Markdown Preview/package-metadata.jason:

{"url": "https://github.com/revolunet/sublimetext-markdown-preview", "version": "2012.09.06.19.15.57", "description": "markdown preview plugin for sublime text 2"}

Preview not updated on save

The instructions mentions "once converted a first time, the output HTML will be updated on each file save". This doesn't work for me. I have to press Alt+M to convert, which also opens a new tab, and the tabs quickly add up.

preview not show headers

description

when i used

ctrl + shift + p
Markdown Preview : preview in Browser
example code headers appears in preview like paragraphs with '#' not like a headers.

example

markdown test

document with test ** information **

var x = 10;

shows

< p > #markdown test# < /p > // !!!!???
< p > document with test < strong > information < /strong > < /p >
< pre > < code > var x = 10; < /code > < /pre >

observations

windows 7, 64 bits and last version of sublime text 2, chrome browser

alternatives that dont works

  • markdown test

  • markdown test

Compile markdown with build system

I think that this plugin could behave as a build system, using cmd/ctrl + B to compile the markup and show it in a browser/pdf according to configuration automatically. Don't you?

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.