开发者

Support for live preview of Haml in Coda or Espresso?

I just discovered the beautiful Haml and Sass, and want to develop in these languages but with live previews. Coda and Espresso both allow for beautiful live previews of HTML files, but previews of an Haml file simply show it as plain text.

While there exist sugars for Espresso that add syntax highlighting, which is nice, I would like something that automatically compiles Haml files to HTML, and then lets me preview that instead of Haml.

Does anything like this exist for either Coda, or Espresso, or for any other web development tool out there?

(If it makes a differen开发者_Python百科ce, I'm not developing for Ruby on Rails, I'm making a static website, so the Ruby on Rails plugin shouldn't help AFAIK. Software I tried out were StaticMatic and Middleman. StaticMatic's development seems discontinued, and for some reason MiddleMan refuses to work after creating my initial directory structure. Maybe I'm using it wrong.)


I don't use Espresso, so no comment there. However, Coda does not provide any support for Haml or Sass that I can find. I've been closely following the Coda forums, as I am a paid user, and it looks as though a 2.0 version is forthcoming. Who knows, perhaps that'll be included.

For now, since you're not using Ruby on Rails, I might suggest TextMate. It doesn't do Haml or Sass "right out of the box", but it can be configured to do so using "Bundles."

Installing HAML bundle for TextMate is a primer on how to setup TextMate for Haml/Sass, and I suspect there are others.

That said, for roughly the cost of TextMate you can purchase RubyMine ($69), which does both Haml (via RubyGem) and Sass (via Plugin), and can also handle running Sass --watch internally. I know you're not using Ruby, so maybe the idea of using a tool made primarily for Ruby doesn't appeal, but it does work in both the Haml and Sass environments very nicely.

The third option would be BBEdit, which can also handle both Haml and Sass. Some information on the plugin for BBEdit is in BBEdit-Codeless-Language-Module-for-HAML-SASS.

I hope this helps.

P.S.: I'm a paid user on all the platforms I mentioned. While I use RubyMine as my primary tool, I find that TextMate still gets a lot of use when I'm programming and need a quick, friendly window to examine code in. I used to use BBEdit when I needed to do complex regular expression-style search and replacements, but then I discovered how to do the same thing in TextMate, so BBEdit is sort of collecting dust. Coda? It looks pretty, but doesn't get the job done so much any more (though Panic's Transmit is still very much a core application).


There are two plugins for Coda 2 that I am aware of:

Coda-Sass-Plug-in is available from GitHub and allows you to save out your scss files to css. I worked for me though I wasn't completely happy with needing to refresh multiple tabs all the time.

LessCSS is available from incident57 dot com. Although I was never able to make it work, it lead me to CodeKit (CodeKit has been mothballed due to production of CodeKit).

CodeKit has the ability to watch folders and generate css files from sass or less when they are saved. It also has the ability to handle Stylus, Haml, Javascript, CoffeeScript, Jade, Slim and Kit.


OK, for anyone else looking for an answer to this, I decided to go along with a different solution. I'm using my normal editors, along with 'serve', a Ruby gem that runs a web server using WEBrick, and automatically compiles any files which it detects has changed. This includes HAML, Sass, Slim, Markdown, etc. files. I'm going to be using either Coda's live preview, or the minimalist browser called Playground, which eliminates the need to press refresh when the local file it is displaying changes.

This workflow is nice for now, although it doesn't have any built-in method to build the entire site into a static site when I'm done and want to deploy. This is a feature in middleman, but middleman still refuses to run because a dependency of it, thin, refuses to work on 64 bits. I might have to manually compile all the files using the terminal command, and hope the Haml interpreter can handle combining template files with each file, which I seriously doubt at this stage. This limitation and thus the continued dependence on 'serve' might force me to consider one of the other applications out there, listed on the page Haml Sucks for Content.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜