Skip to content

Commit

Permalink
First release
Browse files Browse the repository at this point in the history
Removed test files
Removed dependencies to other libraries
Added: License
Added: Readme
  • Loading branch information
Torben Köhn committed Oct 6, 2015
1 parent a6638ed commit 18019d6
Show file tree
Hide file tree
Showing 50 changed files with 129 additions and 1,223 deletions.
21 changes: 21 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2015 Talesoft GbR

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

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.
106 changes: 104 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,104 @@
# tale-jade
A PHP port of the Jade template engine (http://jade-lang.com)


# The Tale Jade Template Engine

> Finally a fully-functional, complete and clean port of the Jade language to PHP
> *— Abraham Lincoln*
The Tale Jade Template Engine brings the popular and powerful Templating-Language [Jade for Node.js](http://jade-lang.com) to PHP!

While previously there only existed ports of the existing Node.js Engine of Jade, **Tale Jade** is a completely new
implementation of the language utilizing the powerful and very specific features of PHP into your Jade application.

Build dynamic websites faster than ever before!

[Get started](http://jade.talesoft.io/getting-started) now or [dig into the dirt](http://jade.talesoft.io/hacking) by yourself!



## Supported features

Tale Jade for PHP does not only implement **every existing feature** of Jade there is, it also brings in some new ones!

### Supported official Node.js Jade Features
- [Tags](http://jade.talesoft.io/examples/tags)
- [Classes](http://jade.talesoft.io/examples/classes)
- [IDs](http://jade.talesoft.io/examples/ids)
- [Doctypes](http://jade.talesoft.io/examples/doctypes)
- [Attributes](http://jade.talesoft.io/examples/attributes)
- [Mixins](http://jade.talesoft.io/examples/mixins)
- [Blocks (with prepend, append and replace support)](http://jade.talesoft.io/examples/blocks)
- [Expressions & Escaping](http://jade.talesoft.io/examples/expressions)
- [Block Expansion](http://jade.talesoft.io/examples/block-expansion)
- [Assignments (&attributes)](http://jade.talesoft.io/examples/assignments)
- [Comments](http://jade.talesoft.io/examples/comments)
- [Inline Code](http://jade.talesoft.io/examples/code)
- [Inheritance](http://jade.talesoft.io/examples/inheritance)
- [Includes (with filters)](http://jade.talesoft.io/examples/includes)
- [Conditionals (if, else, elseif, case, when)](http://jade.talesoft.io/examples/conditionals)
- [Loops (each, while, do)](http://jade.talesoft.io/examples/loops)
- [Interpolation (with Element Interpolation)](http://jade.talesoft.io/examples/interpolation)
- [Filters](http://jade.talesoft.io/examples/filters)
- [Mixin Blocks](http://jade.talesoft.io/examples/mixin-blocks)
- [Variadics](http://jade.talesoft.io/examples/variadics)


### Supported Tale Jade Features
- [Named parameters](http://jade.talesoft.io/examples/named-parameters)
- [Attribute Stacking](http://jade.talesoft.io/examples/attribute-stacking)
- [Filter Maps](http://jade.talesoft.io/examples/filter-map)
- [Cross Assignments](http://jade.talesoft.io/examples/cross-assignments)


### Other, unrelated, cool features

- UTF-8 support via PHP's mb_* extension
- Hackable compiler, parser and lexer
- Huge amount of (optional) configuration possibilities
- Graceful compiler forgiving many mistakes (e.g. spaces around the code)
- Lightning fast and clean compilation
- Detailed error handling
- Renderer with different adapters (ease-of-use vs. performance)
- Intelligent expression parsing



## Getting started

To install and use the Tale Jade library, follow our [Getting Started](http://jade.talesoft.io/getting-started) guide.

If you're interested, you might also look into our in-depth guides:

- [In-depth configuration](http://jade.talesoft.io/configuration)
- [Hacking Tale Jade](http://jade.talesoft.io/hacking)



## There's more to come...

Tale Jade is actively used and developed in many projects and is improved constantly.

We don't stick to the Jade-convention, but we'll always provide compatibility to Node.js Jade to
help reducing confusion.

Planned features:
[ ] Import Attributes (`include some-file(some-var='some-value')`)
[ ] Helper Libraries
[ ] Aliases (Like mixins, just smaller)



## Get in touch

If you find a bug or miss a function, please use the [Issues](https://github.com/Talesoft/tale-jade/issues) on this page
to tell us about it. We will gladly hear you out :)

If you'd like to contribute, fork us, send us pull requests and we'll take a deep look at what you've been working at!
We're completely **Open Source**! You can do anything you like with out code, as long as you stick to the
**MIT-license** we've appended.

You can also contact us via E-Mail.

If you're interested in other projects, you might also contact us via E-Mail as well

**E-Mail: [[email protected]](mailto:[email protected])**
5 changes: 2 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
{
"name": "talesoft/tale-jade",
"description": "A PHP port of the Jade template engine",
"description": "The Jade Template Engine for PHP!",
"type": "library",
"require": {
"talesoft/tale-util": ">=1.0",
"php": ">=5.6.0"
"php": ">=5.5.0"
},
"autoload": {
"psr-0": {
Expand Down
2 changes: 1 addition & 1 deletion src/Tale/Jade/Compiler.php
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ public function resolvePath($path, $extension = null)

foreach ($paths as $directory) {

$fullPath = realpath(PathUtil::join($directory, $path));
$fullPath = realpath(rtrim($directory, '/\\').'/'.ltrim($path, '/\\'));

if ($fullPath)
return $fullPath;
Expand Down
5 changes: 1 addition & 4 deletions src/Tale/Jade/Renderer/Adapter/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,7 @@ public function render($path, array $args = null)
if (substr($path, -strlen($ext)) === $ext)
$path = substr($path, 0, -strlen($ext));

$outputPath = PathUtil::join(
$this->getOption('outputDirectory'),
$path.$this->getOption('extension')
);
$outputPath = rtrim($this->getOption('outputDirectory'), '/\\').'/'.ltrim($path.$this->getOption('extension'), '/\\');

$render = function($__path, $__args) {

Expand Down
28 changes: 0 additions & 28 deletions tests/anti.php

This file was deleted.

8 changes: 0 additions & 8 deletions tests/anti/block-without-name.jade

This file was deleted.

10 changes: 0 additions & 10 deletions tests/anti/nested-mixins.jade

This file was deleted.

3 changes: 0 additions & 3 deletions tests/anti/unclosed-attribute-block.jade

This file was deleted.

31 changes: 0 additions & 31 deletions tests/compiler.php

This file was deleted.

36 changes: 0 additions & 36 deletions tests/lexer.php

This file was deleted.

Loading

0 comments on commit 18019d6

Please sign in to comment.