Home Download Buy Blog Forum Support

Is this possible as a plugin to sublime text?

Is this possible as a plugin to sublime text?

Postby sosuke on Mon Jul 16, 2012 11:45 pm

First of all, I must apologize for any ignorance. I am not a python developer. I'm simply trying to pick the brains of those who know more than me to help me determine the best way forward with a project I envision.

I use sublime to program PHP, and love it. I'm wondering if the plugin/package system is robust enough to make sublime into something it was not intended for, an editor which parses English specifically geared toward the writing of poetry. The general text editor and line numbers are good, but the ability to parse lines of text using dictionaries or the nltk to count syllables, separate words into syllables, lookup dictionary/thesaurus/rhymes then sort these rhymes into metrical feet (ie. iamb, trochee, dactyl, etc.) by comparing them to word lists, is what I'm looking to add. Would something like this be possible in a plugin, or would it require being written as its own application? I'm trying to get some input before I go off the deep end and learn python, or hire a developer, only to find out its not possible. Thank you for any input you can give.
sosuke
 
Posts: 9
Joined: Mon Jul 16, 2012 11:23 pm

Re: Is this possible as a plugin to sublime text?

Postby adzenith on Tue Jul 17, 2012 1:26 am

You could add a plugin that could look up words in the current buffer and measure them however. You could also make new buffers and put arbitrary text into them. All in all what you're saying sounds pretty reasonable.
adzenith
 
Posts: 1204
Joined: Mon Oct 19, 2009 9:12 pm

Re: Is this possible as a plugin to sublime text?

Postby sosuke on Tue Jul 17, 2012 1:50 am

I was worried about importing outside dependencies like nltk, to look up definitions and separate strings into syllables. ST2 plugins can handle that sort of thing?
sosuke
 
Posts: 9
Joined: Mon Jul 16, 2012 11:23 pm

Re: Is this possible as a plugin to sublime text?

Postby Xavura on Tue Jul 17, 2012 3:06 am

You can just drop a folder into your plugin directory and if it has an __init__.py you can import it.
Xavura
 
Posts: 19
Joined: Sat Jul 14, 2012 4:40 pm

Re: Is this possible as a plugin to sublime text?

Postby sosuke on Tue Jul 17, 2012 11:01 am

Thank you very much. I appreciate the answers. Now it's off to the books.
sosuke
 
Posts: 9
Joined: Mon Jul 16, 2012 11:23 pm

Re: Is this possible as a plugin to sublime text?

Postby sosuke on Fri Jul 20, 2012 2:56 pm

so, if i'm understanding correctly, I can drop an __init__.py into a folder to get ST to recognize files in nested folders? For Example, I make a package folder:
Code: Select all
MyPackage/
   myplugin.py
   anotherFolder/
         __init__.py
         moreplugins.py
         anotherplugin.py


Can I get ST to recognize the py files nested within that package folder? I notice that all other packages have a ton of files just shoved in to the top-level directory. This makes things difficult, not only for organization, but for including some of the functionality I'm trying to include. If all files must be top-level in package folders, I'm going to have to make two separate packages that function as one to work the way I'm wanting them to.
sosuke
 
Posts: 9
Joined: Mon Jul 16, 2012 11:23 pm

Re: Is this possible as a plugin to sublime text?

Postby phillip.koebbe on Fri Jul 20, 2012 3:59 pm

Take a look at BracketHighlighter [1] or FavoriteFiles [2]. I think they will help you out.

[1] https://github.com/facelessuser/BracketHighlighter
[2] https://github.com/facelessuser/FavoriteFiles
-- Phillip

Code: Select all
while self.living? do
    mistake = Mistake.new
    self.learn_from!(mistake) unless mistake.fatal?
end
phillip.koebbe
 
Posts: 208
Joined: Tue Dec 20, 2011 4:58 pm

Re: Is this possible as a plugin to sublime text?

Postby sosuke on Sat Jul 21, 2012 12:56 am

Perfect! Thanks. I can't promise no more questions, but that answers a lot.
sosuke
 
Posts: 9
Joined: Mon Jul 16, 2012 11:23 pm


Return to Plugin Development

Who is online

Users browsing this forum: No registered users and 4 guests

cron