Updated JAEL
This commit is contained in:
parent
487d1e0bc7
commit
77a364c446
6 changed files with 43 additions and 61 deletions
|
@ -1,21 +1,29 @@
|
||||||
MIT License
|
BSD 3-Clause License
|
||||||
|
|
||||||
Copyright (c) 2017 The Angel Framework
|
Copyright (c) 2021, dukefirehawk.com
|
||||||
|
All rights reserved.
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Redistribution and use in source and binary forms, with or without
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
modification, are permitted provided that the following conditions are met:
|
||||||
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
|
1. Redistributions of source code must retain the above copyright notice, this
|
||||||
copies or substantial portions of the Software.
|
list of conditions and the following disclaimer.
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
this list of conditions and the following disclaimer in the documentation
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
and/or other materials provided with the distribution.
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
3. Neither the name of the copyright holder nor the names of its
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
contributors may be used to endorse or promote products derived from
|
||||||
SOFTWARE.
|
this software without specific prior written permission.
|
||||||
|
|
||||||
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
|
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||||
|
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
|
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||||
|
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||||
|
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||||
|
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
|
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
|
@ -1,26 +0,0 @@
|
||||||
Copyright 2017 dart_language_server authors
|
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
are permitted provided that the following conditions are met:
|
|
||||||
|
|
||||||
1. Redistributions of source code must retain the above copyright notice, this
|
|
||||||
list of conditions and the following disclaimer.
|
|
||||||
|
|
||||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
||||||
this list of conditions and the following disclaimer in the documentation
|
|
||||||
and/or other materials provided with the distribution.
|
|
||||||
|
|
||||||
3. Neither the name of the copyright holder nor the names of its contributors
|
|
||||||
may be used to endorse or promote products derived from this software without
|
|
||||||
specific prior written permission.
|
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
||||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
||||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
||||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
|
|
||||||
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
||||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
||||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
|
||||||
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
||||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
||||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
@ -1,10 +1,11 @@
|
||||||
# jael
|
# JAEL3
|
||||||
[![Pub](https://img.shields.io/pub/v/jael.svg)](https://pub.dartlang.org/packages/jael)
|
|
||||||
[![build status](https://travis-ci.org/angel-dart/jael.svg)](https://travis-ci.org/angel-dart/jael)
|
![Pub Version (including pre-releases)](https://img.shields.io/pub/v/jael3?include_prereleases)
|
||||||
|
|
||||||
A simple server-side HTML templating engine for Dart.
|
A simple server-side HTML templating engine for Dart.
|
||||||
|
|
||||||
Though its syntax is but a superset of HTML, it supports features such as:
|
Though its syntax is but a superset of HTML, it supports features such as:
|
||||||
|
|
||||||
* **Custom elements**
|
* **Custom elements**
|
||||||
* Loops
|
* Loops
|
||||||
* Conditionals
|
* Conditionals
|
||||||
|
@ -13,22 +14,21 @@ Though its syntax is but a superset of HTML, it supports features such as:
|
||||||
* `switch` syntax
|
* `switch` syntax
|
||||||
* Interpolation of any Dart expression
|
* Interpolation of any Dart expression
|
||||||
|
|
||||||
Jael is a good choice for applications of any scale, especially when the development team is small,
|
Jael is a good choice for applications of any scale, especially when the development team is small, or the time invested in building an SPA would be too much.
|
||||||
or the time invested in building an SPA would be too much.
|
|
||||||
|
|
||||||
## Documentation
|
## Documentation
|
||||||
Each of the [packages within this repository](#this-repository) contains
|
|
||||||
some sort of documentation.
|
Each of the [packages within this repository](#this-repository) contains some sort of documentation.
|
||||||
|
|
||||||
Documentation for Jael syntax and directives has been
|
Documentation for Jael syntax and directives has been
|
||||||
**moved** to the
|
**moved** to the
|
||||||
[Angel framework wiki](https://docs.angel-dart.dev/packages/front-end/jael).
|
[Angel3 framework wiki](https://angel3-docs.dukefirehawk.com/packages/front-end/jael).
|
||||||
|
|
||||||
## This Repository
|
## This Repository
|
||||||
|
|
||||||
Within this repository are three packages:
|
Within this repository are three packages:
|
||||||
|
|
||||||
* `package:jael` - Contains the Jael parser, AST, and HTML renderer.
|
* `package:jael3` - Contains the Jael parser, AST, and HTML renderer.
|
||||||
* `package:jael_preprocessor` - Handles template inheritance, and facilitates the use of "compile-time" constructs.
|
* `package:jael3_preprocessor` - Handles template inheritance, and facilitates the use of "compile-time" constructs.
|
||||||
* `package:build_jael` - Uses `package:build` to compile Jael templates, therefore allowing speedy incremental builds to HTML files.
|
* `package:angel3_jael` - [Angel3](https://angel3-framework.web.app/) support for Jael.
|
||||||
* `package:angel_jael` - [Angel](https://angel-dart.github.io) support for Jael. Angel contains other
|
|
||||||
facilities to speed up application development, so something like Jael is right at home.
|
facilities to speed up application development, so something like Jael is right at home.
|
||||||
|
|
|
@ -3,7 +3,6 @@ import 'package:angel3_framework/angel3_framework.dart';
|
||||||
import 'package:angel3_framework/http.dart';
|
import 'package:angel3_framework/http.dart';
|
||||||
import 'package:angel3_jael/angel3_jael.dart';
|
import 'package:angel3_jael/angel3_jael.dart';
|
||||||
import 'package:file/local.dart';
|
import 'package:file/local.dart';
|
||||||
import 'package:jael3/jael3.dart';
|
|
||||||
import 'package:logging/logging.dart';
|
import 'package:logging/logging.dart';
|
||||||
|
|
||||||
main() async {
|
main() async {
|
||||||
|
|
|
@ -23,9 +23,9 @@ dependencies:
|
||||||
The core `jael3` package exports classes for parsing Jael templates, an AST library, and a `Renderer` class that generates HTML on-the-fly.
|
The core `jael3` package exports classes for parsing Jael templates, an AST library, and a `Renderer` class that generates HTML on-the-fly.
|
||||||
|
|
||||||
```dart
|
```dart
|
||||||
import 'package:belatuk_code_buffer/code_buffer.dart';
|
import 'package:belatuk_code_buffer/belatuk_code_buffer.dart';
|
||||||
import 'package:belatuk_symbol_table/symbol_table.dart';
|
import 'package:belatuk_symbol_table/belatuk_symbol_table.dart';
|
||||||
import 'package:jael3/jael.dart' as jael;
|
import 'package:jael3/jael3.dart' as jael;
|
||||||
|
|
||||||
void myFunction() {
|
void myFunction() {
|
||||||
const template = '''
|
const template = '''
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
name: jael3
|
name: jael3
|
||||||
version: 4.2.0
|
version: 4.2.1
|
||||||
description: A simple server-side HTML templating engine for Dart. Comparable to Blade or Liquid.
|
description: A simple server-side HTML templating engine for Dart. Comparable to Blade or Liquid.
|
||||||
homepage: https://github.com/dukefirehawk/angel/tree/master/packages/jael/jael
|
homepage: https://angel3-framework.web.app/
|
||||||
|
repository: https://github.com/dukefirehawk/angel/tree/master/packages/jael/jael
|
||||||
environment:
|
environment:
|
||||||
sdk: '>=2.12.0 <3.0.0'
|
sdk: '>=2.12.0 <3.0.0'
|
||||||
dependencies:
|
dependencies:
|
||||||
|
|
Loading…
Reference in a new issue