Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

renamed HTAML to Jade

  • Loading branch information...
commit 2c0497600e9ed83f5a924d7d7f50738066171556 1 parent 56dff24
@everzet authored
View
20 README.md
@@ -1,6 +1,6 @@
-# HTAML - template compiler for PHP5.3
+# Jade - template compiler for PHP5.3
-*HTAML* is a high performance template compiler heavily influenced by [Haml](http://haml-lang.com)
+*Jade* is a high performance template compiler heavily influenced by [Haml](http://haml-lang.com)
and implemented for PHP 5.3.
## Features
@@ -17,11 +17,11 @@ and implemented for PHP 5.3.
- :cdata
- :javascript
- you even can write & add own filters throught API
- - [TextMate Bundle](http://github.com/everzet/HTAML-tmbundle)
+ - [TextMate Bundle](http://github.com/everzet/Jade-tmbundle)
## Public API
- $parser = new \Everzet\HTAML\Parser();
+ $parser = new \Everzet\Jade\Parser();
// Parse a string
echo $parser->parse('!!! 5');
@@ -34,7 +34,7 @@ and implemented for PHP 5.3.
### Indentation
-HTAML is indentation based, however currently only supports a _2 space_ indent.
+Jade is indentation based, however currently only supports a _2 space_ indent.
### Tags
@@ -85,7 +85,7 @@ well cool, but how about large bodies of text:
| foo bar baz
| rawr rawr
| super cool
- | go HTAML go
+ | go Jade go
renders `<p>foo bar baz rawr.....</p>`
@@ -104,7 +104,7 @@ now we have `<p><?php echo $something ?></p>`
### Attributes
-HTAML currently supports '(' and ')' as attribute delimiters.
+Jade currently supports '(' and ')' as attribute delimiters.
a(href='/login', title='View login page') Login
@@ -173,7 +173,7 @@ Renders:
### Buffered / Non-buffered output
-HTAML currently supports three classifications of executable code. The first
+Jade currently supports three classifications of executable code. The first
is prefixed by `-`, and is not buffered:
- var $foo = 'bar';
@@ -183,7 +183,7 @@ This can be used for conditionals, or iteration:
- foreach ($items as $item)
p= $item
-Due to HTAML's buffering techniques the following is valid as well:
+Due to Jade's buffering techniques the following is valid as well:
- if ($foo)
ul
@@ -204,7 +204,7 @@ Which outputs `bar<h1>bar<h1/>`.
### Code blocks
-Also, HTAML has Code Blocks, that supports basic PHP template syntax:
+Also, Jade has Code Blocks, that supports basic PHP template syntax:
ul
- while (true)
View
6 phpunit.xml.dist
@@ -12,14 +12,14 @@
bootstrap="tests/bootstrap.php"
>
<testsuites>
- <testsuite name="HTAML Test Suite">
- <directory>./tests/Everzet/HTAML/</directory>
+ <testsuite name="Jade Test Suite">
+ <directory>./tests/Everzet/Jade/</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
- <directory>./src/Everzet/HTAML/</directory>
+ <directory>./src/Everzet/Jade/</directory>
</whitelist>
</filter>
</phpunit>
View
6 ...zet/HTAML/Filters/BaseFilterInterface.php → ...rzet/Jade/Filters/BaseFilterInterface.php
@@ -1,9 +1,9 @@
<?php
-namespace Everzet\HTAML\Filters;
+namespace Everzet\Jade\Filters;
/*
- * This file is part of the HTAML package.
+ * This file is part of the Jade package.
* (c) 2010 Konstantin Kudryashov <ever.zet@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
@@ -13,7 +13,7 @@
/**
* Base filter interface.
*
- * @package HTAML
+ * @package Jade
* @author Konstantin Kudryashov <ever.zet@gmail.com>
*/
interface BaseFilterInterface
View
8 ...et/HTAML/Filters/BlockFilterInterface.php → ...zet/Jade/Filters/BlockFilterInterface.php
@@ -1,11 +1,11 @@
<?php
-namespace Everzet\HTAML\Filters;
+namespace Everzet\Jade\Filters;
-use \Everzet\HTAML\Filters\BaseFilterInterface;
+use \Everzet\Jade\Filters\BaseFilterInterface;
/*
- * This file is part of the HTAML package.
+ * This file is part of the Jade package.
* (c) 2010 Konstantin Kudryashov <ever.zet@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
@@ -15,7 +15,7 @@
/**
* Filter interface.
*
- * @package HTAML
+ * @package Jade
* @author Konstantin Kudryashov <ever.zet@gmail.com>
*/
interface BlockFilterInterface extends BaseFilterInterface
View
8 src/Everzet/HTAML/Filters/CDATA.php → src/Everzet/Jade/Filters/CDATA.php
@@ -1,11 +1,11 @@
<?php
-namespace Everzet\HTAML\Filters;
+namespace Everzet\Jade\Filters;
-use \Everzet\HTAML\Filters\BlockFilterInterface;
+use \Everzet\Jade\Filters\BlockFilterInterface;
/*
- * This file is part of the HTAML package.
+ * This file is part of the Jade package.
* (c) 2010 Konstantin Kudryashov <ever.zet@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
@@ -15,7 +15,7 @@
/**
* CDATA filter.
*
- * @package HTAML
+ * @package Jade
* @author Konstantin Kudryashov <ever.zet@gmail.com>
*/
class CDATA implements BlockFilterInterface
View
8 src/Everzet/HTAML/Filters/JavaScript.php → src/Everzet/Jade/Filters/JavaScript.php
@@ -1,11 +1,11 @@
<?php
-namespace Everzet\HTAML\Filters;
+namespace Everzet\Jade\Filters;
-use \Everzet\HTAML\Filters\BlockFilterInterface;
+use \Everzet\Jade\Filters\BlockFilterInterface;
/*
- * This file is part of the HTAML package.
+ * This file is part of the Jade package.
* (c) 2010 Konstantin Kudryashov <ever.zet@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
@@ -15,7 +15,7 @@
/**
* JavaScript filter.
*
- * @package HTAML
+ * @package Jade
* @author Konstantin Kudryashov <ever.zet@gmail.com>
*/
class JavaScript implements BlockFilterInterface
View
10 src/Everzet/HTAML/Filters/PHP.php → src/Everzet/Jade/Filters/PHP.php
@@ -1,12 +1,12 @@
<?php
-namespace Everzet\HTAML\Filters;
+namespace Everzet\Jade\Filters;
-use \Everzet\HTAML\Filters\BlockFilterInterface;
-use \Everzet\HTAML\Filters\TextFilterInterface;
+use \Everzet\Jade\Filters\BlockFilterInterface;
+use \Everzet\Jade\Filters\TextFilterInterface;
/*
- * This file is part of the HTAML package.
+ * This file is part of the Jade package.
* (c) 2010 Konstantin Kudryashov <ever.zet@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
@@ -16,7 +16,7 @@
/**
* PHP filter.
*
- * @package HTAML
+ * @package Jade
* @author Konstantin Kudryashov <ever.zet@gmail.com>
*/
class PHP implements BlockFilterInterface, TextFilterInterface
View
8 ...zet/HTAML/Filters/TextFilterInterface.php → ...rzet/Jade/Filters/TextFilterInterface.php
@@ -1,11 +1,11 @@
<?php
-namespace Everzet\HTAML\Filters;
+namespace Everzet\Jade\Filters;
-use \Everzet\HTAML\Filters\BaseFilterInterface;
+use \Everzet\Jade\Filters\BaseFilterInterface;
/*
- * This file is part of the HTAML package.
+ * This file is part of the Jade package.
* (c) 2010 Konstantin Kudryashov <ever.zet@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
@@ -15,7 +15,7 @@
/**
* TextFilter interface.
*
- * @package HTAML
+ * @package Jade
* @author Konstantin Kudryashov <ever.zet@gmail.com>
*/
interface TextFilterInterface extends BaseFilterInterface
View
34 src/Everzet/HTAML/Parser.php → src/Everzet/Jade/Parser.php
@@ -1,17 +1,17 @@
<?php
-namespace Everzet\HTAML;
+namespace Everzet\Jade;
-use \Everzet\HTAML\ParserException;
-use \Everzet\HTAML\Filters\BaseFilterInterface as Filter;
-use \Everzet\HTAML\Filters\BlockFilterInterface as BlockFilter;
-use \Everzet\HTAML\Filters\TextFilterInterface as TextFilter;
-use \Everzet\HTAML\Filters\PHP;
-use \Everzet\HTAML\Filters\CDATA;
-use \Everzet\HTAML\Filters\JavaScript;
+use \Everzet\Jade\ParserException;
+use \Everzet\Jade\Filters\BaseFilterInterface as Filter;
+use \Everzet\Jade\Filters\BlockFilterInterface as BlockFilter;
+use \Everzet\Jade\Filters\TextFilterInterface as TextFilter;
+use \Everzet\Jade\Filters\PHP;
+use \Everzet\Jade\Filters\CDATA;
+use \Everzet\Jade\Filters\JavaScript;
/*
- * This file is part of the HTAML package.
+ * This file is part of the Jade package.
* (c) 2010 Konstantin Kudryashov <ever.zet@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
@@ -19,9 +19,9 @@
*/
/**
- * HTAML Parser.
+ * Jade Parser.
*
- * @package HTAML
+ * @package Jade
* @author Konstantin Kudryashov <ever.zet@gmail.com>
*/
class Parser
@@ -80,9 +80,9 @@ class Parser
protected $mode;
/**
- * Inits HTAML parser with the given input string.
+ * Inits Jade parser with the given input string.
*
- * @param string $input HTAML string
+ * @param string $input Jade string
*/
public function __construct($input = null)
{
@@ -117,9 +117,9 @@ public function setBlockEnd($begin, $end) {
}
/**
- * Sets HTAML string to parse
+ * Sets Jade string to parse
*
- * @param string $input HTAML to parse
+ * @param string $input Jade to parse
*/
public function setInput($input)
{
@@ -129,7 +129,7 @@ public function setInput($input)
/**
* Parse input string.
*
- * @param string $input HTAML string
+ * @param string $input Jade string
*
* @return string HTML
*/
@@ -347,7 +347,7 @@ protected function peek()
*
* @return stdClass
*
- * @throws \Everzet\HTAML\ParserException
+ * @throws \Everzet\Jade\ParserException
*/
protected function expect($type)
{
View
8 src/Everzet/HTAML/ParserException.php → src/Everzet/Jade/ParserException.php
@@ -1,9 +1,9 @@
<?php
-namespace Everzet\HTAML;
+namespace Everzet\Jade;
/*
- * This file is part of the HTAML package.
+ * This file is part of the Jade package.
* (c) 2010 Konstantin Kudryashov <ever.zet@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
@@ -11,9 +11,9 @@
*/
/**
- * HTAML Parser Basic Exception.
+ * Jade Parser Basic Exception.
*
- * @package HTAML
+ * @package Jade
* @author Konstantin Kudryashov <ever.zet@gmail.com>
*/
class ParserException extends \Exception
View
12 src/Everzet/HTAML/Renderers/Cached.php → src/Everzet/Jade/Renderers/Cached.php
@@ -1,12 +1,12 @@
<?php
-namespace Everzet\HTAML\Renderers;
+namespace Everzet\Jade\Renderers;
-use \Everzet\HTAML\Parser;
-use \Everzet\HTAML\Renderers\Renderer;
+use \Everzet\Jade\Parser;
+use \Everzet\Jade\Renderers\Renderer;
/*
- * This file is part of the HTAML package.
+ * This file is part of the Jade package.
* (c) 2010 Konstantin Kudryashov <ever.zet@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
@@ -14,9 +14,9 @@
*/
/**
- * HTAML cached renderer
+ * Jade cached renderer
*
- * @package HTAML
+ * @package Jade
* @author Konstantin Kudryashov <ever.zet@gmail.com>
*/
class Cached extends Renderer
View
12 src/Everzet/HTAML/Renderers/Renderer.php → src/Everzet/Jade/Renderers/Renderer.php
@@ -1,12 +1,12 @@
<?php
-namespace Everzet\HTAML\Renderers;
+namespace Everzet\Jade\Renderers;
-use \Everzet\HTAML\Parser;
-use \Everzet\HTAML\ParserException;
+use \Everzet\Jade\Parser;
+use \Everzet\Jade\ParserException;
/*
- * This file is part of the HTAML package.
+ * This file is part of the Jade package.
* (c) 2010 Konstantin Kudryashov <ever.zet@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
@@ -14,9 +14,9 @@
*/
/**
- * HTAML basic renderer
+ * Jade basic renderer
*
- * @package HTAML
+ * @package Jade
* @author Konstantin Kudryashov <ever.zet@gmail.com>
*/
class Renderer
View
28 tests/Everzet/HTAML/FiltersTest.php → tests/Everzet/Jade/FiltersTest.php
@@ -1,9 +1,9 @@
<?php
-use \Everzet\HTAML\Parser;
+use \Everzet\Jade\Parser;
/*
- * This file is part of the HTAML package.
+ * This file is part of the Jade package.
* (c) 2010 Konstantin Kudryashov <ever.zet@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
@@ -22,10 +22,10 @@ public function testFilterCodeInsertion()
{
$this->assertEquals(
"<script type=\"text/javascript\">\n//<![CDATA[\nvar name = \"<?php echo \$name ?>\";\n//]]>\n</script>",
- $this->parse(<<<HTAML
+ $this->parse(<<<Jade
:javascript
| var name = "{{\$name}}";
-HTAML
+Jade
)
);
}
@@ -34,29 +34,29 @@ public function testCDATAFilter()
{
$this->assertEquals(
"<![CDATA[\nfoo\n]]>",
- $this->parse(<<<HTAML
+ $this->parse(<<<Jade
:cdata
| foo
-HTAML
+Jade
)
);
$this->assertEquals(
"<![CDATA[\nfoo\nbar\n]]>",
- $this->parse(<<<HTAML
+ $this->parse(<<<Jade
:cdata
| foo
| bar
-HTAML
+Jade
)
);
$this->assertEquals(
"<![CDATA[\nfoo\nbar\n]]>\n<p>something else</p>",
- $this->parse(<<<HTAML
+ $this->parse(<<<Jade
:cdata
| foo
| bar
p something else
-HTAML
+Jade
)
);
}
@@ -65,10 +65,10 @@ public function testJavaScriptFilter()
{
$this->assertEquals(
"<script type=\"text/javascript\">\n//<![CDATA[\nalert('foo')\n//]]>\n</script>",
- $this->parse(<<<HTAML
+ $this->parse(<<<Jade
:javascript
| alert('foo')
-HTAML
+Jade
)
);
}
@@ -77,12 +77,12 @@ public function testPHPFilter()
{
$this->assertEquals(
"<?php\n\$bar = 10;\n\$bar++;\necho \$bar;\n?>",
- $this->parse(<<<HTAML
+ $this->parse(<<<Jade
:php
| \$bar = 10;
| \$bar++;
| echo \$bar;
-HTAML
+Jade
)
);
}
View
62 tests/Everzet/HTAML/ParserTest.php → tests/Everzet/Jade/ParserTest.php
@@ -1,9 +1,9 @@
<?php
-use \Everzet\HTAML\Parser;
+use \Everzet\Jade\Parser;
/*
- * This file is part of the HTAML package.
+ * This file is part of the Jade package.
* (c) 2010 Konstantin Kudryashov <ever.zet@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
@@ -26,7 +26,7 @@ public function testDoctypes()
public function testUnknownFilter()
{
- $this->setExpectedException("Everzet\\HTAML\\ParserException");
+ $this->setExpectedException("Everzet\\Jade\\ParserException");
$this->parse(":doesNotExist\n");
}
@@ -48,10 +48,10 @@ public function testSingleQuotes()
<?php \$path = 'foo' ?>
<a href="/<?php echo \$path ?>"></a>
HTML
-, $this->parse(<<<HTAML
+, $this->parse(<<<Jade
- \$path = 'foo'
a(href='/{{\$path}}')
-HTAML
+Jade
));
}
@@ -94,7 +94,7 @@ public function testTags()
public function testNestedTags()
{
- $htaml = <<<HTAML
+ $htaml = <<<Jade
ul
li a
li b
@@ -103,7 +103,7 @@ public function testNestedTags()
li c
li d
li e
-HTAML;
+Jade;
$html = <<<HTML
<ul>
<li>a</li>
@@ -119,11 +119,11 @@ public function testNestedTags()
HTML;
$this->assertEquals($html, $this->parse($htaml));
- $htaml = <<<HTAML
+ $htaml = <<<Jade
a(href="#") foo
| bar
| baz
-HTAML;
+Jade;
$html = <<<HTML
<a href="#">
foo
@@ -133,12 +133,12 @@ public function testNestedTags()
HTML;
$this->assertEquals($html, $this->parse($htaml));
- $htaml = <<<HTAML
+ $htaml = <<<Jade
ul
li one
ul two
li three
-HTAML;
+Jade;
$html = <<<HTML
<ul>
<li>one</li>
@@ -153,7 +153,7 @@ public function testNestedTags()
public function testVariableLengthNewlines()
{
- $htaml = <<<HTAML
+ $htaml = <<<Jade
ul
li a
@@ -166,7 +166,7 @@ public function testVariableLengthNewlines()
li d
li e
-HTAML;
+Jade;
$html = <<<HTML
<ul>
<li>a</li>
@@ -185,7 +185,7 @@ public function testVariableLengthNewlines()
public function testNewlines()
{
- $htaml = <<<HTAML
+ $htaml = <<<Jade
ul
li a
@@ -201,7 +201,7 @@ public function testNewlines()
li c
li d
li e
-HTAML;
+Jade;
$html = <<<HTML
<ul>
<li>a</li>
@@ -302,21 +302,21 @@ public function testCodeAttrs()
public function testCode()
{
- $htaml = <<<HTAML
+ $htaml = <<<Jade
- \$foo = "<script>";
= \$foo
-HTAML;
+Jade;
$html = <<<HTML
<?php \$foo = "<script>"; ?>
<?php echo \$foo ?>
HTML;
$this->assertEquals($html, $this->parse($htaml));
- $htaml = <<<HTAML
+ $htaml = <<<Jade
- \$foo = "<script>";
- if (null !== \$foo)
= \$foo
-HTAML;
+Jade;
$html = <<<HTML
<?php \$foo = "<script>"; ?>
<?php if (null !== \$foo): ?>
@@ -325,12 +325,12 @@ public function testCode()
HTML;
$this->assertEquals($html, $this->parse($htaml));
- $htaml = <<<HTAML
+ $htaml = <<<Jade
- \$foo = "<script>";
p
- if (null !== \$foo)
= \$foo
-HTAML;
+Jade;
$html = <<<HTML
<?php \$foo = "<script>"; ?>
<p>
@@ -341,12 +341,12 @@ public function testCode()
HTML;
$this->assertEquals($html, $this->parse($htaml));
- $htaml = <<<HTAML
+ $htaml = <<<Jade
- \$foo = "<script>";
p
- if (null !== \$foo)
strong= \$foo
-HTAML;
+Jade;
$html = <<<HTML
<?php \$foo = "<script>"; ?>
<p>
@@ -357,14 +357,14 @@ public function testCode()
HTML;
$this->assertEquals($html, $this->parse($htaml));
- $htaml = <<<HTAML
+ $htaml = <<<Jade
- \$foo = "<script>";
p
- if (null !== \$foo)
strong= \$foo
- else
h2= \$foo / 2
-HTAML;
+Jade;
$html = <<<HTML
<?php \$foo = "<script>"; ?>
<p>
@@ -377,14 +377,14 @@ public function testCode()
HTML;
$this->assertEquals($html, $this->parse($htaml));
- $htaml = <<<HTAML
+ $htaml = <<<Jade
- \$foo = "<script>";
p
- if (null !== \$foo)
strong= \$foo
- else
h2= \$foo / 2
-HTAML;
+Jade;
$html = <<<HTML
<?php \$foo = "<script>"; ?>
<p>
@@ -397,7 +397,7 @@ public function testCode()
HTML;
$this->assertEquals($html, $this->parse($htaml));
- $htaml = <<<HTAML
+ $htaml = <<<Jade
- \$foo = "<script>";
p
- switch (\$foo)
@@ -407,7 +407,7 @@ public function testCode()
strong#name= \$foo * 2
- case 5
p some text
-HTAML;
+Jade;
$html = <<<HTML
<?php \$foo = "<script>"; ?>
<p>
@@ -429,7 +429,7 @@ public function testCode()
public function testCorrectEndings()
{
- $htaml = <<<HTAML
+ $htaml = <<<Jade
!!! strict
html
- use_helper('LESS')
@@ -451,7 +451,7 @@ public function testCorrectEndings()
a( href = '#' ) Третий
= \$sf_content
-HTAML;
+Jade;
$html = <<<HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
Please sign in to comment.
Something went wrong with that request. Please try again.