feed-read
Version:
a ATOM and RSS feed parser
64 lines (46 loc) • 2.42 kB
text/xml
<feed xmlns="http://www.w3.org/2005/Atom">
<title>DJG</title>
<link href="http://sentientwaffle.github.com/atom.xml" rel="self"/>
<link href="http://sentientwaffle.github.com/"/>
<updated>2012-03-01T12:01:58-08:00</updated>
<id>http://sentientwaffle.github.com/</id>
<author>
<name>DJG</name>
</author>
<entry>
<title>Save file on blur</title>
<link href="http://sentientwaffle.github.com/save-file-on-blur"/>
<updated>2012-02-09T00:00:00-08:00</updated>
<id>http://sentientwaffle.github.com/save-file-on-blur</id>
<content type="html"><h2>Intro</h2>
<p>When doing web development, I frequently need to switch back and
forth between the editor and a browser to see the updates.
This simple plugin will save the file whenever it loses focus.</p>
<h2><a href="https://github.com/sentientwaffle/save-on-blur">The Code</a></h2>
<pre><code>stratus = require 'stratus'
stratus.on "fractus.blur", (editor) -&gt;
editor.save()
</code></pre>
<p><em>3 whole lines.</em> Not bad.</p>
<p>The <code>fractus.blur</code> event is called whenever an editor loses focus, and
the callback receives that editor.</p>
<h3>By Bundle</h3>
<p>If you want to apply the bundle to only CSS, Sass, and Stylus files:</p>
<pre><code>stratus.on "fractus.blur", (editor) -&gt;
syntax = editor.syntax?.name
return unless syntax &amp;&amp; /^(CSS|Sass|Stylus)\b/.test(syntax)
editor.save()
</code></pre>
<h2>Installing the plugin</h2>
<pre><code>$ stratus plugin:install &lt;username&gt; path/to/your/plugin.coffee
</code></pre>
<h2>More info</h2>
<p>For more information on writing plugins for Stratus,
see the <a href="http://stratuseditor.com/plugins">plugin API</a>.</p>
<p>A configurable version of the save-on-blur plugin is available
on <a href="https://github.com/sentientwaffle/save-on-blur">GitHub</a>.</p>
<p>There are <a href="http://stratuseditor.com/plugins#Events">plenty of other useful events</a> you can use.</p>
</content>
</entry>
</feed>