revolunet / sublimetext-markdown-preview

markdown preview and build plugin for sublime text 2/3
MIT License
2.31k stars 362 forks source link

Smartypants extension #151

Closed charlesroper closed 10 years ago

charlesroper commented 10 years ago

Is there any chance the Smartypants module could be added please?

https://pypi.python.org/pypi/mdx_smartypants/

karland commented 10 years ago

@charlesroper Did you find a solution to this?

@revolunet sublime-markdown-preview is great. I understood from the sample.md that 3rd party extensions are possible to be included. smarty is in the list of officially supported extensions to python-markdown but I have no clue how to integrate/configure this into sublime-markdown-preview or if this is actually possible at all. Any help would be more than welcome. Thanks a lot.

charlesroper commented 10 years ago

No.

revolunet commented 10 years ago

You should add this module inside the markdown/extensions folder then add this to the plugin settings :

extensions=['smartypants(entities=named)']

tell me if it works

facelessuser commented 10 years ago

From what I understand, the smartypants extension has a least two other dependencies, but theoretically it can be done.

karland commented 10 years ago

@revolunet Thanks for the feedback. I have not really understood where or in which file you would want me to include the

extensions=['smartypants(entities=named)']

There is nothing like this in the MarkdownPreview.sublime-settings. I also cannot find any file that has plugin settings.

Independent of this I made some further research. The smartypants extension was introduced in version 2.4 as one can read here in the official package. Unfortunately your package only has version 2.3.1. So I am not sure if the extension with smartypants in version 2.3.1 is actually possible at all.

But I have tried and replaced the markdown directory in Markdown Preview package with the one from the newest version of the Python-Markdown here, but then Markdown Preview does not work any longer. Sorry and thanks again for your help. Cheers.

facelessuser commented 10 years ago

Not sure if an upgrade is needed, but I was considering looking into how hard an update would be. I think some of the sublime specific stuff should be pushed out of the markdown lib if possible.

karland commented 10 years ago

Well, thanks. I am looking forward to it.

facelessuser commented 10 years ago

I looked at this over lunch. Upgrading should go smooth. The differences aren't major, it is mainly improvements and bug fixes etc.

karland commented 10 years ago

Sounds good...

facelessuser commented 10 years ago

SmartyPants aka smarty and upgrade to 2.4.1 is in pull request #201

smarty is confirmed to be working in ST2 and ST3

When I've done some more testing and pushed it to the main branch, you will be able to set it up like so:

    "enabled_extensions":
    [
        "extra",
        "toc",
        "codehilite",
        "b64(base_path=${BASE_PATH})",
        "magiclink",
        "delete",
        "githubemoji",
        "tasklist",
        "smarty"  // <-- That is it (you can read instructions here
                       //        http://pythonhosted.org/Markdown/extensions/smarty.html
                       //        to learn how to turn off certain conversions)
    ],
karland commented 10 years ago

Works perfectly. Many thanks. I am impressed....

revolunet commented 10 years ago

yep thanks @facelessuser