Permalink
Browse files

remove docs

  • Loading branch information...
1 parent 7b56059 commit dd24370285631a22fbbc6dc9aae98b8512787839 @paularmstrong committed Dec 2, 2012
Showing with 2 additions and 1,172 deletions.
  1. +2 −2 README.md
  2. +0 −21 docs/README.md
  3. +0 −41 docs/browser.md
  4. +0 −102 docs/custom-tags.md
  5. +0 −40 docs/express.md
  6. +0 −456 docs/filters.md
  7. +0 −88 docs/getting-started.md
  8. +0 −91 docs/inheritance.md
  9. +0 −61 docs/syntax.md
  10. +0 −270 docs/tags.md
View
@@ -23,7 +23,7 @@ Installation
Documentation
-------------
-All documentation can be viewed online. [Documentation Table of Contents](https://github.com/paularmstrong/swig/tree/master/docs#readme)
+All documentation can be viewed online on the [Swig Website](http://paularmstrong.github.com/swig/).
Basic Example
-------------
@@ -73,4 +73,4 @@ The above copyright notice and this permission notice shall be included in all c
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-[1]: http://paularmstrong.github.com/node-templates/
+[1]: http://paularmstrong.github.com/node-templates/
View
@@ -1,21 +0,0 @@
-Swig Documentation
-==================
-
-Table of Contents
------------------
-
-1. [Getting Started](docs/getting-started.md#getting-started)
-1. [Syntax](docs/syntax.md#syntax)
-1. [Filters](docs/filters.md#filters)
-1. [Tags](docs/tags.md#tags)
-1. [Template Inheritance](docs/inheritance.md#inheritance)
-1. [Integrating with Express](docs/express.md#express)
-1. [In the Browser](docs/browser.md#browser)
-
-Examples
---------
-
-1. [Basic Usage](../examples/basic)
-1. [Custom Tags](../examples/custom_tags)
-1. [Express.js with Swig](../examples/express)
-1. [Macros](../examples/macros)
View
@@ -1,41 +0,0 @@
-Swig in Your Browser <a name="browser" href="#browser">#</a>
-====================
-
-To compile Swig for rendering in the browser, clone the Swig repository and run the following in your command-line:
-
- make && make browser
-
-In the `dist/browser/` directory, you will see 4 files:
-
-Swig relies heavily on [underscore.js](http://documentcloud.github.com/underscore/). Because of this, there are two versions of Swig built for the browser. In `dist/browser/`, you will see 4 files:
-
-1. _swig.js_ and _swig.min.js_
-1. _swig.pack.js_ and _swig.pack.min.js_
-
-You should only need one of these. If you already include _underscore.js_ in your website, choose _swig.js_ for development and _swig.min.js_ for production. If you have not included _underscore.js_ and you don't intend to, choose _swig.pack.js_ for development and _swig.pack.min.js_ for production.
-
-## The API <a name="api" href="#api">#</a>
-
-Swig's API in the browser is the same as [its API for node.js](getting-started.md), with the only difference being that you cannot use the `swig.compileFile` method, since browsers do not have a filesystem.
-
-Instead, you must always use `swig.compile` and pre-parse all templates.
-
-In order to use `extends`, `import`, and `include` correctly, another argument is available on `swig.compile`: `templateKey`
-
- swig.compile(templateString, { filename: templateKey });
-
-This is the key that will be used to lookup a template. For instance:
-
- var template = swig.compile('<p>{% block content %}{% endblock %}</p>', { filename: 'main' });
- var mypage = swig.compile('{% extends "main" %}{% block content %}Oh hey there!{% endblock %}', { filename: 'mypage' });
-
-When you render mypage, `mypage.render({});`, you will see
-
- <p>Oh hey there!</p>
-
-## Known Issues <a name="issues" href="#issues">#</a>
-
-* Opera and Internet Explorer fail to comply with the date filter format `r`.
-* Internet Explorer 9.0 **in compatibility mode** and IE 6 through 8:
- * Is unable to compute the ISO date time for date filter formate `c`.
- * Does not handle unicode properly and so it fails to escape output for `'js'`.
View
@@ -1,102 +0,0 @@
-Custom Tags <a name="custom-tags" href="#custom-tags">#</a>
-===========
-
-Swig makes it easy to write custom tags specific for your project.
-
-First, make sure to include your node.js file that declares your tags in the swig init:
-
- swig.init({ tags: require('mytags') });
-
-Requirements <a name="requirements" href="#requirements">#</a>
-------------
-
-First, include the helpers.
-
- var helpers = require('swig/lib/helpers');
-
-Define your tag and whether or not it requires an "end" tag:
-
- exports.mytag = function (indent, parser) {
- return 'output';
- };
- exports.mytag.ends = true;
-
-A Really Simple Tag <a name="example" href="#example">#</a>
--------------------
-
-To parse a swig variable with or without filters into a variable token, eg. `bar` or `foo|lowercase`
-
- exports.mytag = function (indent, parser) {
- var myArg = parser.parseVariable(this.args[0]);
- return 'output';
- };
- exports.mytag.ends = true;
-
-Use a parsed variable token with `helpers.setVar()` to bind a variable in your current scope into the templates scope. The `setVar` method cleans up variable output, applies filters and escaping for clean output:
-
- exports.mytag = function (indent, parser) {
- var myArg = parser.parseVariable(this.args[0]),
- output = '';
- output += helpers.setVar(name, myArg);
- return output;
- };
- exports.mytag.ends = true;
-
-To parse the inner content of a tag for outputting, use `parser.compile.apply(this, [indent, parentBlock])`:
-
- exports.mytag = function (indent, parser) {
- var myArg = parser.parseVariable(this.args[0]),
- output = [];
-
- output.push(helpers.setVar('__myArg', myArg));
-
- output.push('_output += "<h1>";');
- output.push('_output += __myArg;');
- output.push('_output += "</h1>";');
- output.push('_output += "<p>";');
- output.push(parser.compile.call(this, indent + ' '));
- output.push('_output += "</p>";');
-
- return output.join('');
- };
- exports.mytag.ends = true;
-
-When using your tag, it might have the following effect (assume `blah` is equal to "Scrumdiddlyumptious"):
-
-Template:
-
- {% mytag blah %}Tacos{% endmytag %}
-
-Output:
-
- <h1>Scrumdiddlyumptious</h1>
- <p>Tacos</p>
-
-Third-Party Extensions <a name="third-party-extensions" href="#third-party-extensions">#</a>
-----------------------
-
-To access a third-party library or method that is defined outside of your templates, you can add it to swig as an extention. For example, if you are using the i18next node module, add it as an extension when you initialize swig:
-
- var i18next = require('i18next');
- swig.init({
- extensions: {
- i18next: i18next
- }
- });
-
-Once you've added it, your custom tag can reference the `i18next` extension via the `_ext` object:
-
- exports.trans = function (indent, parser) {
- var myArg = parser.parseVariable(this.args[0]),
- output = [];
- output.push(helpers.setVar('__myArg', myArg));
-
- output.push('_output += _ext.i18next.t(__myArg);');
-
- return output.join('');
- };
-
-Write Your Own <a name="write-your-own" href="#write-your-own">#</a>
---------------
-
-To best understand how to write your own tag, reference [`swig/lib/tags.js`](../lib/tags.js) to see how the internal tags are written. These will give you a pretty clear indication of how to write your own.
View
@@ -1,40 +0,0 @@
-Using Swig in Express for View Rendering <a name="express" href="#express">#</a>
-========================================
-
-Swig is compatible with [Express][1]! It's very easy to set up your Express-based node project to use Swig as its template renderer. Here's how:
-
-First, get Express and Consolidate.js
-
- npm install express
- npm install consolidate
-
-Require `express`, `Swig`, and create the express server.
-
- var express = require('express'),
- cons = require('consolidate'),
- swig = require('swig'),
- app = express.createServer();
-
-Register Swig as the template renderer.
-
- app.engine('.html', cons.swig);
- app.set('view engine', 'html');
-
-Set up your views directory.
-
- // NOTE: Swig requires some extra setup so that it knows where to look for includes and parent templates
- swig.init({
- root: '/path/to/views/directory/',
- allowErrors: true // allows errors to be thrown and caught by express instead of suppressed
- });
- app.set('views', '/path/to/views/directory/');
-
-**Important!** Don't allow express to automatically pipe your template into a `layout.html` file. Setting this to false allows you to properly use `{% extends %}` and `{% block %}` tags!
-
-Render your `index.html` page!
-
- app.get('/', function (req, res) {
- res.render('index.html', { foo: 'bar' });
- });
-
-[1]:http://expressjs.com/
Oops, something went wrong. Retry.

0 comments on commit dd24370

Please sign in to comment.