Skip to content

Commit

Permalink
v.1.1.9, update readme,manual,changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikos M committed Oct 26, 2018
1 parent 7fc647d commit c664366
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 24 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ There are a couple of other frameworks named also `contemplate`
[![Contemplate](/screenshots/contemplate-interactive.png)](http://foo123.github.com/examples/contemplate/)


###Contents
### Contents

* [Online Playground Example](http://foo123.github.com/examples/contemplate/)
* [Rationale](#rationale)
Expand All @@ -71,7 +71,7 @@ There are a couple of other frameworks named also `contemplate`
**If you use `Contemplate` in your application and you want to share it, feel free to submit an example link**


###Rationale
### Rationale

There are many templating engines out there, which are elegant, fast, multipurpose and so on..
Most of the sophisticated engines use a custom parser (and usually a full-fledged framework) to build the engine.
Expand Down Expand Up @@ -100,7 +100,7 @@ The solution is inspired by _John Resig's post_ ([see above](http://ejohn.org/bl



###Features:
### Features:

* `Contemplate` does a __minimum parsing__ (and caching) in order to create dynamic templates
and trying to contain the needed functionality inside the common language subset(s).
Expand Down Expand Up @@ -149,7 +149,7 @@ syntax, yet work the same in all the engine's implementations.
* **custom plugins can be also inlined**, i.e their code can be **expanded at compile-time** using `Contemplate::inline` templates in their definition, e.g saving unnecessary look-ups at render-time (see examples)


###Dependencies
### Dependencies

* Only 3 classes are used (`Contemplate.php`, `Contemplate.js`, `Contemplate.py`), no other dependencies
* `PHP` `5.2+` supported
Expand All @@ -159,7 +159,7 @@ syntax, yet work the same in all the engine's implementations.
* `Contemplate` is also a `XPCOM JavaScript Component` (Firefox) (e.g to be used in firefox browser addons/plugins for templating)


###Todo
### Todo

* add support for multiple `contexts` (which include separate `templates`, `cache` directories and related parameters) so that the engine can be **used in same application by different modules independantly** [DONE]
* simplify template `directives`, `functions` and `plugins` notation by eliminating the `%` prefix (compatibility mode to older versions also supported) [DONE]
Expand All @@ -169,7 +169,7 @@ syntax, yet work the same in all the engine's implementations.
* keep-up with `php`, `node`, `python`, browsers updates


###Performance
### Performance

*(for `php` see `/tests/perf/perf.php`)*

Expand Down Expand Up @@ -208,13 +208,13 @@ Previous tests are here [jsperf/0.6.7](http://jsperf.com/js-template-engines-com



###Tests
### Tests

Use `test.php` (for `php`), `test.js` (for `node`), `test.py` (for `python`)
under `/tests` folder, to test the basic functionality


###Screenshots
### Screenshots

Sample Template markup
[![Template markup](/screenshots/template_markup.png)](https://github.com/foo123/Contemplate/raw/master/screenshots/template_markup.png)
Expand Down
8 changes: 4 additions & 4 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
###ChangeLog
### ChangeLog

__NOTE__ TOFIX: Python (3.6) fails sometimes to load/import template module if template created just before loading, in subsequent calls it works
__NOTE__ TOFIX: Python (3.6) fails sometimes to load/import template module if template created just before loading. In subsequent calls it works.

__1.1.9__
* PHP: use `class_exists($class, false)`, JS/PY: update version numbers

__1.1.8__
* `create_function` is deprecated in PHP 7.2+, so eliminate use of `create_function` and use with `@` operator to avoid php notices. It is not used but left there for compatibility. maybe removed completely in another update
* `create_function` is deprecated in PHP 7.2+, so eliminate use of `create_function` and use with `@` operator to avoid php notices. It is not used but left there for compatibility. Maybe removed completely in another update

__1.1.7__
* minor changes for better code alignment/indentation
Expand Down Expand Up @@ -39,7 +39,7 @@ __1.1.2__
* inline, at compile-time, more template functions (e.g `concat`) for faster execution
* inlined plugins can receive passed arguments (via `$` array parameter) both as (comma-separated) string (`$0`), plus each separate argument (`$1..$n`)
* lazy init and rendering for inline templates and plugins for even faster execution
* remove `plural` functions and add liguisticaly contexual localisation `xlocale`, `nxlocale` functions
* remove `plural` functions and add linguisticaly contexual localisation `xlocale`, `nxlocale` functions
* `cc` function alias of `concat`
* fix php-like `date()` function in python implementation (wrong day of week for `Sunday`)

Expand Down
24 changes: 12 additions & 12 deletions manual.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
###Contemplate Manual
### Contemplate Manual

**version 1.1.9; platforms: PHP, Python, Node/XPCOM/JS**


###Contents
### Contents

1. [Template Separators](#template-separators)
2. [Template Variables](#template-variables)
Expand All @@ -17,14 +17,14 @@



####Template Separators
#### Template Separators

**IMPORTANT** As of version `0.6+`, template separators for `Contemplate` templates are defined **inside** the template itself
in the first non-empty line, separated by a space (see examples and tests). Optionally (for a single template) they can also be passed as **part of parse options** when calling the `Contemplate.tpl( tplID [, data, {separators: seps}] )` method



####Template Variables
#### Template Variables


Variables in a template are referenced using `PHP`-style Notation with `$` sign.
Expand Down Expand Up @@ -55,7 +55,7 @@ $obj.key.key2 // this will also work



####Literal Template Data
#### Literal Template Data


Literal `object`/`array` data are constructed in a template using `JavaScript` Literal Object-style Notation (similar to `JSON`)
Expand All @@ -64,7 +64,7 @@ example:

```javascript

// eg. a literal object having various string values, numeric, values and arrays:
// eg. a literal object having various string values, numeric values and arrays:
{
"stringVar" : "stringValue",
"numericVar" : 123,
Expand All @@ -78,7 +78,7 @@ example:
```


####Dynamic Template Inheritance
#### Dynamic Template Inheritance

Templates can extend another template. This is accomplished using `extends` directive, **inside** the template.
This means that the super-template (id) is hardcoded inside the cached template (once compiled).
Expand All @@ -104,7 +104,7 @@ tpl.render( data );

```

####Dynamic Contexts
#### Dynamic Contexts

The engine can use **multiple dynanic contexts** to have contextual settings, like `templates`, `locales`, `caching`, `plugins` so that different modules of an application can **use the engine independantly**.

Expand All @@ -120,7 +120,7 @@ TEMPLATE operations take place in the `current` context (which defaults to `glob



####Template Directives
#### Template Directives

**IMPORTANT** As of version `1.0.0+`, template `directives`, `functions` and `plugins` **no longer use** the `%` prefix i.e `%for`, `%if`, .. but `for`, `if`, .. If compatibility to older format is needed use `Contemplate.setCompatibilityMode( true )`

Expand Down Expand Up @@ -152,7 +152,7 @@ TEMPLATE operations take place in the `current` context (which defaults to `glob



####Template Functions and Plugins
#### Template Functions and Plugins

**IMPORTANT** As of version `1.0.0+`, template `directives`, `functions` and `plugins` **no longer use** the `%` prefix i.e `%for`, `%if`, .. but `for`, `if`, .. If compatibility to older format is needed use `Contemplate.setCompatibilityMode( true )`

Expand Down Expand Up @@ -199,7 +199,7 @@ TEMPLATE operations take place in the `current` context (which defaults to `glob



####Differences between `include` and `template`
#### Differences between `include` and `template`

The main difference is that `include` will actually copy the subtemplate contents inside the calling template (thus only one final template is generated). This is similar to PHP's `include` directive.

Expand All @@ -215,7 +215,7 @@ where the `{"var1":$value1, "var2":$value2, ..}` are the data to be passed to th
this is exactly how the `Contemplate.tpl(id, data)` method is called.


####Contemplate API
#### Contemplate API

**(javascript)**
```javascript
Expand Down

0 comments on commit c664366

Please sign in to comment.