Sublime Forum

SublimeMarkdown

#1

github.com/erinata/SublimeMarkdown

This plugin is somewhat a Markdown typing helper. It automatically add the * or - when you are typing bullet points. And it adds > for multiline blockquotes.

Press Ctrl+B to build the markdown into html and view it in browser. I do not know how to run a sublime text plugin in build system (And I asked in technical support no one answer). Therefore I bind the key Ctrl+B to the command when you are at a markdown file. Probably you need to disable other markdown build systems to get this to work.

For the tmlanguage file, I just copy from the textmate bundle for me own convenience.

This is the first time I wrote a Sublime Plugin and I have never wrote any Python before. The are probably many better way to do this but I think at least it works.

Also, how to make the plugin available at package manager?

0 Likes

#2

Now the plugin is at version 0.5.0

Added support for ordered lists. Also you can use tab and backspace to indent and unindent empty list items.

0 Likes

#3

Hi,

I tried the first version and it worked, but was always a little rough (no unindent, etc.). I just tried the 0.5.0, which sounded more promising, but there are still rough spots. For example, “tab” should indent the bullet when there is a space between the caret and the bullet, since that’s where the plugin places your caret after the previous bullet. (I hope this description makes sense; I still haven’t had coffee :smile: )

I think you should release the bullet plugin as a separate Package. People generally roll their own build systems (for example, I use Pandoc) and if they want to use the TextMate bundle, they can install it separately.

Sublime is very modular, so you don’t need all the “markdown stuff” in one package. A “MarkdownBullet” package will be picked up just fine.

There are several very good plugin developers in the forums; hopefully they can help out a bit more.

Alex

Edit: I removed a statement about the settings file, which, upon closer inspection, was probably false.

0 Likes

#4

Alex,

Thanks for your suggestion.

The bug you mentioned is totally valid. It’s caused by the fact the I always use spaces for tab so I didn’t notice that. I am still tweaking the regex checking and hopefully it will get better.

Sorry for putting the build system into the plugin. I guess for now people will have to comment out / delete the sublime-build file in the plugin to use their own build system.

And after some thought this plugin is not even markdown specific. in 0.5.0 you can put a bunch of selectors in the settings so that you can have Bullets points in plain text or whatever documents…So probably I should just separate it into a SublimeBullet instead ?

0 Likes

#5

As far as I can tell, for the bullet plugin all you need is MarkdownBullet.py and the settings file.

That’ll work if you’re talking about using Markdownish syntax. If you’re refering to Textile, ReStructuredText or other markup languages, things could get complicated very quickly.

Look at the variations, for example, of numeric lists (I’m working from memory, so perhaps I’m off a bit):

<!-- Markdown -->

1. List item
2. List item

<!-- Textile -->

# List item
# List item

<!-- Pandoc -->

#. List item
#. List item.

<!-- ReStructuredText -->

(1) List item
(2) List item

To further complicate the situation, some lightweight markup supports block-level content under lists [1]. This would either mean setting up very complicated rules or fighting against the plugin.

[1] E.g., for Pandoc: johnmacfarlane.net/pandoc/README … space-rule

0 Likes