seth-brown / formd

A Markdown formatting tool
MIT License
147 stars 19 forks source link

formd as a module #7

Closed n1k0 closed 11 years ago

n1k0 commented 11 years ago

Very nice tool. I'd like to set up a package for Sublime Text but it would be much easier having formd as a reusable module than a command line executable :)

seth-brown commented 11 years ago

Thanks for the comments.

One option is to use TextExpander to execute formd. I do this when I'm working on something outside the terminal. Another option is to use a Sublime shell plugin such as:

https://github.com/misfo/Shell-Turtlestein

I've never used it, but it appears that this should allow you to use formd directly. Also, I'm love to see formd refactored as a module, so I'm definitely open to this if you'd like to submit a pull request.

Cheers.

n1k0 commented 11 years ago

love to see formd refactored as a module, so I'm definitely open to this if you'd like to submit a pull request.

Will do :)

n1k0 commented 11 years ago

PR #8 sent

seth-brown commented 11 years ago

I merged this request, but the original formd in formd/bin is not working. It looks like the import path is incorrect? I added another branch called module-refactoring which contains your merge until we can resolve this. Thanks for the work!

n1k0 commented 11 years ago

That's because you have to either python setup.py install the package or either alter your $PYTHONPATH accordingly (appending the path to the formd package folder to it).

The idea is to publish the package to pypi so you can pip install formd

I should probably have written this in the README or in the PR description, sorry.

seth-brown commented 11 years ago

Sorry for the delay. No need to apologize! Thanks again for your work. Is there any way to package this without moving the original formd script? I don't wan't any update to break backward compatibility. In other words, can we keep /bin/formd in it's original location at formd/formd (where it is currently)?

n1k0 commented 11 years ago

I think it's possible, you just have to update the path to the formd script in setup.py scripts directive, eg. scripts=['formd', ], instead of scripts=['bin/formd', ],

n1k0 commented 11 years ago

Poke. I can't find the branch where you merged my PR into. Any news?

seth-brown commented 11 years ago

Right, I forgot to push it. Here's a link to the branch:

https://github.com/drbunsen/formd/tree/module-refactoring

seth-brown commented 11 years ago

Hi, thanks for the help with refactoring ForMd into a module. I've just pushed an update that creates a reusable module.