incorporate old rst docs into org

This commit is contained in:
Noam Postavsky
2013-11-26 21:22:57 -05:00
parent 695211b761
commit b194ea56b3
9 changed files with 5700 additions and 3364 deletions

View File

@@ -1,201 +1,345 @@
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.8.1: http://docutils.sourceforge.net/" />
<title>Yet Another Snippet extension</title>
<link rel="stylesheet" href="styles.css" type="text/css" />
<title>Yet another snippet extension</title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<meta name="title" content="Yet another snippet extension"/>
<meta name="generator" content="Org-mode"/>
<meta name="generated" content="2013-11-26T21:02-0500"/>
<meta name="author" content=""/>
<meta name="description" content=""/>
<meta name="keywords" content=""/>
<style type="text/css">
<!--/*--><![CDATA[/*><!--*/
html { font-family: Times, serif; font-size: 12pt; }
.title { text-align: center; }
.todo { color: red; }
.done { color: green; }
.tag { background-color: #add8e6; font-weight:normal }
.target { }
.timestamp { color: #bebebe; }
.timestamp-kwd { color: #5f9ea0; }
.right {margin-left:auto; margin-right:0px; text-align:right;}
.left {margin-left:0px; margin-right:auto; text-align:left;}
.center {margin-left:auto; margin-right:auto; text-align:center;}
p.verse { margin-left: 3% }
pre {
border: 1pt solid #AEBDCC;
background-color: #F3F5F7;
padding: 5pt;
font-family: courier, monospace;
font-size: 90%;
overflow:auto;
}
table { border-collapse: collapse; }
td, th { vertical-align: top; }
th.right { text-align:center; }
th.left { text-align:center; }
th.center { text-align:center; }
td.right { text-align:right; }
td.left { text-align:left; }
td.center { text-align:center; }
dt { font-weight: bold; }
div.figure { padding: 0.5em; }
div.figure p { text-align: center; }
div.inlinetask {
padding:10px;
border:2px solid gray;
margin:10px;
background: #ffffcc;
}
textarea { overflow-x: auto; }
.linenr { font-size:smaller }
.code-highlighted {background-color:#ffff00;}
.org-info-js_info-navigation { border-style:none; }
#org-info-js_console-label { font-size:10px; font-weight:bold;
white-space:nowrap; }
.org-info-js_search-highlight {background-color:#ffff00; color:#000000;
font-weight:bold; }
/*]]>*/-->
</style>
<script type="text/javascript">
/*
@licstart The following is the entire license notice for the
JavaScript code in this tag.
Copyright (C) 2012-2013 Free Software Foundation, Inc.
The JavaScript code in this tag is free software: you can
redistribute it and/or modify it under the terms of the GNU
General Public License (GNU GPL) as published by the Free Software
Foundation, either version 3 of the License, or (at your option)
any later version. The code is distributed WITHOUT ANY WARRANTY;
without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU GPL for more details.
As additional permission under GNU GPL version 3 section 7, you
may distribute non-source (e.g., minimized or compacted) forms of
that code without the copy of the GNU GPL normally required by
section 4, provided you include this license notice and a URL
through which recipients can access the Corresponding Source.
@licend The above is the entire license notice
for the JavaScript code in this tag.
*/
<!--/*--><![CDATA[/*><!--*/
function CodeHighlightOn(elem, id)
{
var target = document.getElementById(id);
if(null != target) {
elem.cacheClassElem = elem.className;
elem.cacheClassTarget = target.className;
target.className = "code-highlighted";
elem.className = "code-highlighted";
}
}
function CodeHighlightOff(elem, id)
{
var target = document.getElementById(id);
if(elem.cacheClassElem)
elem.className = elem.cacheClassElem;
if(elem.cacheClassTarget)
target.className = elem.cacheClassTarget;
}
/*]]>*///-->
</script>
</head>
<body>
<div class="document" id="yet-another-snippet-extension">
<div id="header-region" class="clear-block"></div>
<div id="wrapper">
<div id="container" class="clear-block">
<div id="header">
<div id="logo-floater">
<h1 class="title">Yet Another Snippet extension</h1>
</div>
<ul class="primary-links">
<li>
<a title="" href="index.html">Intro and tutorial</a>
</li>
<li>
<a title="" href="snippet-organization.html">Howto: organize</a>
</li>
<li>
<a title="" href="snippet-expansion.html">Howto: expand</a>
</li>
<li>
<a title="" href="snippet-development.html">Howto: write </a>
</li>
<li>
<a title="" href="snippet-menu.html">Howto: menu </a>
</li>
<li>
<a title="" href="faq.html">FAQ</a>
</li>
<li>
<a title="" href="changelog.html">ChangeLog</a>
</li>
<li>
<a title="" href="http://code.google.com/p/yasnippet/downloads/list">Download</a>
</li>
</ul>
</div>
<div id="center">
<div id="squeeze">
<div class="right-corner">
<div class="left-corner">
<p>
<b>Important:</b> This documentation applies to
the <b>SVN trunk</b> of YASnippet, which you
get <a href="http://code.google.com/p/yasnippet/source/checkout">here</a>. Documentation
for other versions can be found <a title=""
href="http://code.google.com/p/yasnippet/downloads/list">here</a>.
</p>
<div class="contents topic" id="contents">
<p class="topic-title first">Contents</p>
<ul class="simple">
<li><a class="reference internal" href="#video-demo" id="id1">Video Demo</a></li>
<li><a class="reference internal" href="#installation" id="id2">Installation</a><ul>
<li><a class="reference internal" href="#install-with-yasnippet-bundle-el" id="id3">Install with <tt class="docutils literal"><span class="pre">yasnippet-bundle.el</span></tt></a></li>
<li><a class="reference internal" href="#normal-install" id="id4">Normal Install</a></li>
<div id="org-div-home-and-up" style="text-align:right;font-size:70%;white-space:nowrap;">
<a accesskey="h" href="./index.html"> UP </a>
|
<a accesskey="H" href="./index.html"> HOME </a>
</div>
<div id="preamble">
</div>
<div id="content">
<h1 class="title">Yet another snippet extension</h1>
<div id="table-of-contents">
<h2>Table of Contents</h2>
<div id="text-table-of-contents">
<ul>
<li><a href="#sec-1">Quick start</a>
<ul>
<li><a href="#sec-1-1">Watch a demo</a></li>
<li><a href="#sec-1-2">Installation</a></li>
<li><a href="#import-textmate">Import textmate snippets (rails example)</a></li>
<li><a href="#sec-1-4">Contributing snippets</a></li>
<li><a href="#sec-1-5">Documentation</a></li>
<li><a href="#sec-1-6">Bugs, discussion, contributions, etc</a></li>
</ul>
</li>
<li><a class="reference internal" href="#how-to-use-yasnippet" id="id5">How to use YASnippet</a></li>
<li><a class="reference internal" href="#bugs-contribution-and-support" id="id6">Bugs, Contribution and Support</a></li>
</ul>
</div>
<p><strong>YASnippet</strong> is a template system for Emacs. It allows you to type an
abbreviation and automatically expand it into function
templates. Bundled language templates includes: C, C++, C#, Perl,
Python, Ruby, SQL, LaTeX, HTML, CSS and more.</p>
<p>The snippet syntax is inspired from TextMate's syntax, you can even
<a class="reference external" href="snippet-development.html#importing-textmate-snippets">import</a>
import most TextMate templates. YASnippet is a re-write of the
extension <a class="reference external" href="http://code.google.com/p/smart-snippet/">smart-snippet</a>. Both are original creations of <a class="reference external" href="http://pluskid.lifegoo.org">pluskid</a>.</p>
<div class="section" id="video-demo">
<h1><a class="toc-backref" href="#id1">Video Demo</a></h1>
<object type="application/x-shockwave-flash"
width="425"
height="344"
align="right"
class="youtube-embed"
data="http://www.youtube.com/v/76Ygeg9miao">
<param name="movie" value="http://www.youtube.com/v/76Ygeg9miao"></param>
<param name="wmode" value="transparent"></param>
</object>
<p>Watch the <a class="reference external" href="http://www.youtube.com/watch?v=76Ygeg9miao">demo at YouTube</a> (download a higher
resolution version: <a class="reference external" href="http://yasnippet.googlecode.com/files/yasnippet.avi">yasnippet.avi</a>).</p>
</div>
<div class="section" id="installation">
<h1><a class="toc-backref" href="#id2">Installation</a></h1>
<p>There are two archives you can download. To quickly tryout YASnippet,
download the simpler &quot;bundle&quot; version. If you plan to modify the
bundled templates and/or build your own, download the &quot;normal&quot;
package.</p>
<div class="section" id="install-with-yasnippet-bundle-el">
<h2><a class="toc-backref" href="#id3">Install with <tt class="docutils literal"><span class="pre">yasnippet-bundle.el</span></tt></a></h2>
<ol class="arabic simple">
<li>Download the latest <tt class="docutils literal"><span class="pre">yasnippet-bundle-x.y.z.el.tgz</span></tt> and unpack it.</li>
<li>You'll get a file named <tt class="docutils literal"><span class="pre">yasnippet-bundle.el</span></tt>, put it under
<tt class="docutils literal"><span class="pre">~/.emacs.d/plugins/</span></tt> (create the directory if not exists).</li>
<li>Open the file in Emacs, and type <tt class="docutils literal">Alt+x <span class="pre">eval-buffer</span></tt>.</li>
<div id="outline-container-1" class="outline-2">
<h2 id="sec-1">Quick start</h2>
<div class="outline-text-2" id="text-1">
<p>
<b>YASnippet</b> is a template system for Emacs. It allows you to type an
abbreviation and automatically expand it into function templates. Bundled
language templates includes: C, C++, C#, Perl, Python, Ruby, SQL, LaTeX, HTML,
CSS and more. The snippet syntax is inspired from TextMate's syntax, you can
even <a href="#import-textmate">import most TextMate snippets</a>
</p>
<p>
YASnippet is an original creation of <a href="http://pluskid.lifegoo.org">pluskid</a> who also wrote its predecessor
<a href="http://code.google.com/p/smart-snippet">smart-snippet</a>.
</p>
</div>
<div id="outline-container-1-1" class="outline-3">
<h3 id="sec-1-1">Watch a demo</h3>
<div class="outline-text-3" id="text-1-1">
<p>
On <a href="http://www.youtube.com/watch?v=ZCGmZK4V7Sg">youtube</a>.
</p>
</div>
</div>
<div id="outline-container-1-2" class="outline-3">
<h3 id="sec-1-2">Installation</h3>
<div class="outline-text-3" id="text-1-2">
<p>
Clone this repository somewhere
</p>
<pre class="example">$ cd ~/.emacs.d/plugins
$ git clone https://github.com/capitaomorte/yasnippet
</pre>
<p>
Add the following in your <code>.emacs</code> file:
</p>
<pre class="example">(add-to-list 'load-path
"~/.emacs.d/plugins/yasnippet")
(require 'yasnippet)
(yas-global-mode 1)
</pre>
<p>
Add your own snippets to <code>~/.emacs.d/snippets</code> by placing files there or
invoking <a href="snippet-reference.html#yas-new-snippet"><code>yas-new-snippet</code></a>.
</p>
</div>
</div>
<div id="outline-container-import-textmate" class="outline-3">
<h3 id="import-textmate"><a name="sec-1-3" id="sec-1-3"></a>Import textmate snippets (rails example)</h3>
<div class="outline-text-3" id="text-import-textmate">
<p>
YASnippet lets you use TextMate bundles directly:
</p>
<pre class="example">$ cd ~/.emacs.d/plugins
$ git clone https://github.com/capitaomorte/yasnippet
$ cd yasnippet
$ git submodule init
$ git submodule update
$ gem install plist trollop
$ rake convert_bundles # will convert ruby, rails and html bundles from drnic
</pre>
<p>
Then, in your <code>.emacs</code> file
</p>
<pre class="example">(add-to-list 'load-path
"~/.emacs.d/plugins/yasnippet")
(require 'yasnippet)
(setq yas-snippet-dirs '("~/.emacs.d/snippets" "~/.emacs.d/extras/imported"))
(yas-global-mode 1)
</pre>
<p>
Open some rails file (model, app, etc) and start using the textmate
snippets. Consider that this is a work-in-progress and many snippets/commands
might not work. Patches welcome!
</p>
</div>
</div>
<div id="outline-container-1-4" class="outline-3">
<h3 id="sec-1-4">Contributing snippets</h3>
<div class="outline-text-3" id="text-1-4">
<p>
Please <b>do not ask me</b> to add snippets to the default collection under
<code>/snippets</code>. This collection is considered frozen. By customizing
<a href="snippet-reference.html#yas-snippet-dirs"><code>yas-snippet-dirs</code></a> you can point yasnippet to good
snippet collections out there.
</p>
<p>
The <code>extras/textmate-import.rb</code> tool can import many actual Textmate
snippets. I'm focusing on developing it and the accompanying <code>yas-setup.el</code>
files that guide it with more difficult importations. The idea is to deprecate
<code>/snippets</code> and replace it with <code>extras/imported</code>.
</p>
</div>
</div>
<div id="outline-container-1-5" class="outline-3">
<h3 id="sec-1-5">Documentation</h3>
<div class="outline-text-3" id="text-1-5">
<p>
The documentation has been split into separate parts:
</p>
<ol>
<li><a href="snippet-organization.html">Organizing Snippets</a>
Describes ways to organize your snippets in the hard disk.
</li>
<li><a href="snippet-expansion.html">Expanding Snippets</a>
Describes how YASnippet chooses snippets for expansion at point.
<p>
Maybe, you'll want some snippets to be expanded in a particular mode,
or only under certain conditions, or be prompted using <code>ido</code>, etc&hellip;
</p>
</li>
<li><a href="snippet-development.html">Writing Snippets</a>
Describes the YASnippet definition syntax, which is very close (but
not equivalent) to Textmate's. Includes a section about converting
TextMate snippets.
</li>
<li><a href="snippet-menu.html">The YASnippet menu</a>
Explains how to use the YASnippet menu to explore, learn and modify
snippets.
</li>
<li><a href="snippet-reference.html">YASnippet Symbol Reference</a>
An automatically generated listing of all YASnippet commands,
(customization) variables, and functions.
</li>
</ol>
<p>That's it. Now open any one of your language file, you'll see a menu
YASnippet. you can pull the menu to insert a template. Or, you can
type the a <em>trigger key</em> then press <tt class="docutils literal">TAB</tt> to expand it.</p>
<p>To have Emacs load YASnippet automatically when it starts, put the
following in your <tt class="docutils literal"><span class="pre">~/.emacs</span></tt> file:</p>
<blockquote>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%">(<span style="color: #19177C">add-to-list</span> <span style="color: #19177C">&#39;load-path</span>
<span style="color: #BA2121">&quot;~/.emacs.d/plugins&quot;</span>)
(<span style="color: #008000">require</span> <span style="color: #19177C">&#39;yasnippet-bundle</span>)
</pre></div>
</blockquote>
<p>The <a class="reference external" href="http://www.youtube.com/watch?v=76Ygeg9miao">youtube video</a>
demonstrates this quick installation.</p>
</div>
<div class="section" id="normal-install">
<h2><a class="toc-backref" href="#id4">Normal Install</a></h2>
<p>To install YASnippet as a normal emacs package, download and unpack
the latest <tt class="docutils literal"><span class="pre">yasnippet-x.y.z.tar.bz2</span></tt>. You'll get a directory named
<tt class="docutils literal"><span class="pre">yasnippet-x.y.z</span></tt>, which you can put it in your
<tt class="docutils literal"><span class="pre">~/.emacs.d/plugins</span></tt> and add the following in your <tt class="docutils literal">.emacs</tt> file:</p>
<blockquote>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%">(<span style="color: #19177C">add-to-list</span> <span style="color: #19177C">&#39;load-path</span>
<span style="color: #BA2121">&quot;~/.emacs.d/plugins/yasnippet-x.y.z&quot;</span>)
(<span style="color: #008000">require</span> <span style="color: #19177C">&#39;yasnippet</span>) <span style="color: #408080; font-style: italic">;; not yasnippet-bundle</span>
(<span style="color: #19177C">yas/initialize</span>)
(<span style="color: #19177C">yas/load-directory</span> <span style="color: #BA2121">&quot;~/.emacs.d/plugins/yasnippet-x.y.z/snippets&quot;</span>)
</pre></div>
</blockquote>
<p>Please refer to the documentation for full customization, or use the
customization group.</p>
</div>
<div id="outline-container-1-6" class="outline-3">
<h3 id="sec-1-6">Bugs, discussion, contributions, etc</h3>
<div class="outline-text-3" id="text-1-6">
<p>
If you think you've found a bug, please report it on <a href="https://github.com/capitaomorte/yasnippet/issues">the GitHub issue tracker</a>
(please **do not** submit new issues to the old <a href="http://code.google.com/p/yasnippet/issues/list">googlecode tracker</a>).
</p>
<p>
If you run into problems using YASnippet, or have snippets to contribute,
post to the <a href="http://groups.google.com/group/smart-snippet">yasnippet forum</a>. Thank you very much for using YASnippet!
</p>
</div>
</div>
<div class="section" id="how-to-use-yasnippet">
<h1><a class="toc-backref" href="#id5">How to use YASnippet</a></h1>
<p>Since version 0.6, YASnippet contains more functionality. You don't
need to know all of it to use it successfully, but you it can improve
your snippeting experience.</p>
<p>Hence this section has been split into separate documents:</p>
<ol class="arabic simple">
<li><a class="reference external" href="snippet-organization.html">Organizing Snippets</a></li>
</ol>
<blockquote>
Describes ways to organize your snippets in the hard disk (or not
organize them at all and just use <tt class="docutils literal"><span class="pre">yasnippet-bundle.el</span></tt>.</blockquote>
<ol class="arabic simple" start="2">
<li><a class="reference external" href="snippet-expansion.html">Expanding Snippets</a></li>
</ol>
<blockquote>
<p>Describes how YASnippet chooses snippets for expansion at point.</p>
<p>Maybe, you'll want some snippets to be expanded in a particular
mode, or only under certain conditions, or be prompted using
<tt class="docutils literal">ido</tt>, etc...</p>
</blockquote>
<ol class="arabic simple" start="3">
<li><a class="reference external" href="snippet-development.html">Writing Snippets</a></li>
</ol>
<blockquote>
Describes the YASnippet definition syntax, which is very close (but
not equivalent) to Textmate's. Includes a section about converting
TextMate snippets.</blockquote>
<ol class="arabic simple" start="4">
<li><a class="reference external" href="snippet-menu.html">The YASnippet menu</a></li>
</ol>
<blockquote>
Explains how to use the YASnippet menu to explore, learn and modify
snippets.</blockquote>
</div>
<div class="section" id="bugs-contribution-and-support">
<h1><a class="toc-backref" href="#id6">Bugs, Contribution and Support</a></h1>
<ul class="simple">
<li>If you find a bug, please report it at <a class="reference external" href="http://code.google.com/p/yasnippet/issues/list">Issue List</a>.</li>
<li>If you have problem using YASnippet, or have some new ideas,
including snippets, please post to the <a class="reference external" href="http://groups.google.com/group/smart-snippet">discussion group</a>.</li>
</ul>
<p>Thank you very much for using YASnippet!</p>
<!-- LocalWords: YASnippet SQL LaTeX CSS yasnippet el eval html ido RET wiki -->
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-10536822-1");
pageTracker._trackPageview();
} catch(err) {}
</script>
<div id="postamble">
<p class="date">Date: 2013-11-26T21:02-0500</p>
<p class="creator"><a href="http://orgmode.org">Org</a> version 7.9.3f with <a href="http://www.gnu.org/software/emacs/">Emacs</a> version 24</p>
<a href="http://validator.w3.org/check?uri=referer">Validate XHTML 1.0</a>
</div>
</body>
</html>