Updated Jael to use belatuk_symbol_table

This commit is contained in:
thomashii 2021-09-13 08:30:02 +08:00
parent c0457f0204
commit 9865ed93d2
45 changed files with 231 additions and 527 deletions

View file

@ -1,51 +0,0 @@
# Created by .ignore support plugin (hsz.mobi)
### JetBrains template
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
# User-specific stuff:
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/dictionaries
# Sensitive or high-churn files:
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.xml
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
# Gradle:
.idea/**/gradle.xml
.idea/**/libraries
# CMake
cmake-build-debug/
# Mongo Explorer plugin:
.idea/**/mongoSettings.xml
## File-based project format:
*.iws
## Plugin-specific files:
# IntelliJ
out/
# mpeltonen/sbt-idea plugin
.idea_modules/
# JIRA plugin
atlassian-ide-plugin.xml
# Cursive Clojure plugin
.idea/replstate.xml
# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties

View file

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>

View file

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/jael.iml" filepath="$PROJECT_DIR$/jael.iml" />
</modules>
</component>
</project>

View file

@ -1,8 +0,0 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="blocks within blocks in block_test.dart" type="DartTestRunConfigurationType" factoryName="Dart Test" singleton="true" nameIsGenerated="true">
<option name="filePath" value="$PROJECT_DIR$/jael_preprocessor/test/block_test.dart" />
<option name="scope" value="GROUP_OR_TEST_BY_NAME" />
<option name="testName" value="blocks within blocks" />
<method />
</configuration>
</component>

View file

@ -1,8 +0,0 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="for loop in render_test.dart" type="DartTestRunConfigurationType" factoryName="Dart Test" singleton="true" nameIsGenerated="true">
<option name="filePath" value="$PROJECT_DIR$/jael/test/render/render_test.dart" />
<option name="scope" value="GROUP_OR_TEST_BY_NAME" />
<option name="testName" value="for loop" />
<method />
</configuration>
</component>

View file

@ -1,7 +0,0 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="jael::example" type="DartCommandLineRunConfigurationType" factoryName="Dart Command Line Application" singleton="true">
<option name="filePath" value="$PROJECT_DIR$/jael/example/main.dart" />
<option name="workingDirectory" value="$PROJECT_DIR$/jael" />
<method />
</configuration>
</component>

View file

@ -1,7 +0,0 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="main.dart" type="DartCommandLineRunConfigurationType" factoryName="Dart Command Line Application" singleton="true" nameIsGenerated="true">
<option name="filePath" value="$PROJECT_DIR$/angel_jael/example/main.dart" />
<option name="workingDirectory" value="$PROJECT_DIR$/angel_jael/example" />
<method />
</configuration>
</component>

View file

@ -1,7 +0,0 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="tests in dsx_test.dart" type="DartTestRunConfigurationType" factoryName="Dart Test" singleton="true" nameIsGenerated="true">
<option name="filePath" value="$PROJECT_DIR$/jael/test/render/dsx_test.dart" />
<option name="testRunnerOptions" value="-j4" />
<method />
</configuration>
</component>

View file

@ -1,8 +0,0 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="tests in jael" type="DartTestRunConfigurationType" factoryName="Dart Test" singleton="true" nameIsGenerated="true">
<option name="filePath" value="$PROJECT_DIR$/jael" />
<option name="scope" value="FOLDER" />
<option name="testRunnerOptions" value="-j4" />
<method />
</configuration>
</component>

View file

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>

View file

@ -1,71 +0,0 @@
# See https://www.dartlang.org/tools/private-files.html
# Files and directories created by pub
.dart_tool
.packages
.pub/
build/
# If you're building an application, you may want to check-in your pubspec.lock
pubspec.lock
# Directory created by dartdoc
# If you don't generate documentation locally you can remove this line.
doc/api/
### Dart template
# See https://www.dartlang.org/tools/private-files.html
# Files and directories created by pub
# SDK 1.20 and later (no longer creates packages directories)
# Older SDK versions
# (Include if the minimum SDK version specified in pubsepc.yaml is earlier than 1.20)
.project
.buildlog
**/packages/
# Files created by dart2js
# (Most Dart developers will use pub build to compile Dart, use/modify these
# rules if you intend to use dart2js directly
# Convention is to use extension '.dart.js' for Dart compiled to Javascript to
# differentiate from explicit Javascript files)
*.dart.js
*.part.js
*.js.deps
*.js.map
*.info.json
# Directory created by dartdoc
# Don't commit pubspec lock file
# (Library packages only! Remove pattern if developing an application package)
### JetBrains template
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
# User-specific stuff:
## VsCode
.vscode/
## File-based project format:
*.iws
## Plugin-specific files:
# IntelliJ
.idea/
/out/
.idea_modules/
# JIRA plugin
atlassian-ide-plugin.xml
# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties

View file

@ -1,19 +1,32 @@
# 4.0.0 # Change Log
## 4.1.0
* Updated to use `belatuk_symbol_table` package
* Upgraded from `pendantic` to `lints` linter
## 4.0.0
* Migrated to support Dart SDK 2.12.x NNBD * Migrated to support Dart SDK 2.12.x NNBD
# 3.0.0 ## 3.0.0
* Migrated to work with Dart SDK 2.12.x Non NNBD * Migrated to work with Dart SDK 2.12.x Non NNBD
# 2.0.0 ## 2.0.0
* Angel 2 and Dart 2 updates. * Angel 2 and Dart 2 updates.
* Default to `.jael` instead of `.jl`. * Default to `.jael` instead of `.jl`.
# 1.0.3 ## 1.0.3
* Update for annoying map casting bug. * Update for annoying map casting bug.
# 1.0.2 ## 1.0.2
* Update for DSX support. * Update for DSX support.
* Clear the buffer on errors. * Clear the buffer on errors.
# 1.0.1 ## 1.0.1
* Use `Renderer.errorDocument`.
* Use `Renderer.errorDocument`.

View file

@ -1,21 +1,29 @@
MIT License (MIT) BSD 3-Clause License
Copyright (c) 2021 dukefirehawk.com 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.

View file

@ -1,25 +1,23 @@
# angel3_jael # Angel3 Jael
[![version](https://img.shields.io/badge/pub-v4.0.1-brightgreen)](https://pub.dartlang.org/packages/angel3_jael)
[![version](https://img.shields.io/badge/pub-v4.1.0-brightgreen)](https://pub.dev/packages/angel3_jael)
[![Null Safety](https://img.shields.io/badge/null-safety-brightgreen)](https://dart.dev/null-safety) [![Null Safety](https://img.shields.io/badge/null-safety-brightgreen)](https://dart.dev/null-safety)
[![Gitter](https://img.shields.io/gitter/room/angel_dart/discussion)](https://gitter.im/angel_dart/discussion) [![Gitter](https://img.shields.io/gitter/room/angel_dart/discussion)](https://gitter.im/angel_dart/discussion)
[![License](https://img.shields.io/github/license/dart-backend/belatuk-common-utilities)](https://github.com/dukefirehawk/angel/tree/angel3/packages/jael/angel_jael/LICENSE)
[![License](https://img.shields.io/github/license/dukefirehawk/angel)](https://github.com/dukefirehawk/angel/tree/angel3/packages/jael/angel_jael/LICENSE) [Angel 3](https://github.com/dukefirehawk/angel/tree/angel3) support for [Jael 3](https://github.com/dukefirehawk/angel/tree/angel3/packages/jael/jael).
## Installation
[Angel](https://github.com/dukefirehawk/angel/tree/angel3)
support for
[Jael](https://github.com/dukefirehawk/angel/tree/angel3/packages/jael/jael).
# Installation
In your `pubspec.yaml`: In your `pubspec.yaml`:
```yaml ```yaml
dependencies: dependencies:
angel3_jael: ^4.0.0 angel3_jael: ^4.1.0
``` ```
# Usage ## Usage
Just like `mustache` and other renderers, configuring Angel to use Just like `mustache` and other renderers, configuring Angel to use
Jael is as simple as calling `app.configure`: Jael is as simple as calling `app.configure`:
@ -38,19 +36,15 @@ AngelConfigurer myPlugin(FileSystem fileSystem) {
} }
``` ```
`package:angel3_jael` supports caching views, to improve server performance. `package:angel3_jael` supports caching views, to improve server performance. You might not want to enable this in development, so consider setting the flag to `app.isProduction`:
You might not want to enable this in development, so consider setting
the flag to `app.isProduction`:
``` ```dart
jael(viewsDirectory, cacheViews: app.isProduction); jael(viewsDirectory, cacheViews: app.isProduction);
``` ```
Keep in mind that this package uses `package:file`, rather than Keep in mind that this package uses `package:file`, rather than `dart:io`.
`dart:io`.
The following is a basic example of a server setup that can render Jael The following is a basic example of a server setup that can render Jael templates from a directory named `views`:
templates from a directory named `views`:
```dart ```dart
import 'package:angel3_framework/angel3_framework.dart'; import 'package:angel3_framework/angel3_framework.dart';
@ -58,7 +52,7 @@ import 'package:angel3_jael/angel3_jael.dart';
import 'package:file/local.dart'; import 'package:file/local.dart';
import 'package:logging/logging.dart'; import 'package:logging/logging.dart';
main() async { void main() async {
var app = Angel(); var app = Angel();
var fileSystem = const LocalFileSystem(); var fileSystem = const LocalFileSystem();
@ -83,5 +77,4 @@ main() async {
} }
``` ```
To apply additional transforms to parsed documents, provide a To apply additional transforms to parsed documents, provide a set of `patch` functions, like in `package:jael3_preprocessor`.
set of `patch` functions, like in `package:jael3_preprocessor`.

View file

@ -1,3 +1 @@
analyzer: include: package:lints/recommended.yaml
strong-mode:
implicit-casts: false

View file

@ -3,7 +3,7 @@ import 'package:angel3_code_buffer/angel3_code_buffer.dart';
import 'package:file/file.dart'; import 'package:file/file.dart';
import 'package:jael3/jael3.dart'; import 'package:jael3/jael3.dart';
import 'package:jael3_preprocessor/jael3_preprocessor.dart'; import 'package:jael3_preprocessor/jael3_preprocessor.dart';
import 'package:angel3_symbol_table/angel3_symbol_table.dart'; import 'package:belatuk_symbol_table/belatuk_symbol_table.dart';
/// Configures an Angel server to use Jael to render templates. /// Configures an Angel server to use Jael to render templates.
/// ///

View file

@ -1,5 +1,5 @@
name: angel3_jael name: angel3_jael
version: 4.0.0 version: 4.1.0
description: Angel support for the Jael templating engine, similar to Blade or Liquid. description: Angel support for the Jael templating engine, similar to Blade or Liquid.
homepage: https://github.com/dukefirehawk/angel/tree/angel3/packages/jael/angel_jael homepage: https://github.com/dukefirehawk/angel/tree/angel3/packages/jael/angel_jael
environment: environment:
@ -7,15 +7,18 @@ environment:
dependencies: dependencies:
angel3_framework: ^4.0.0 angel3_framework: ^4.0.0
angel3_code_buffer: ^2.0.0 angel3_code_buffer: ^2.0.0
angel3_symbol_table: ^2.0.0 belatuk_symbol_table: ^3.0.0
jael3: ^4.0.0 jael3: ^4.1.0
jael3_preprocessor: ^4.0.0 jael3_preprocessor: ^4.1.0
file: ^6.0.0 file: ^6.0.0
logging: ^1.0.1 logging: ^1.0.1
dev_dependencies: dev_dependencies:
angel3_test: ^4.0.0 angel3_test: ^4.0.0
html: ^0.15.0 html: ^0.15.0
test: ^1.17.3 test: ^1.17.3
lints: ^1.0.0
#dependency_overrides: #dependency_overrides:
# web_socket_channel: ^2.0.0 # jael3:
# http: ^0.13.0 # path: ../jael
# jael3_preprocessor:
# path: ../jael_preprocessor

View file

@ -1,71 +0,0 @@
# See https://www.dartlang.org/tools/private-files.html
# Files and directories created by pub
.dart_tool
.packages
.pub/
build/
# If you're building an application, you may want to check-in your pubspec.lock
pubspec.lock
# Directory created by dartdoc
# If you don't generate documentation locally you can remove this line.
doc/api/
### Dart template
# See https://www.dartlang.org/tools/private-files.html
# Files and directories created by pub
# SDK 1.20 and later (no longer creates packages directories)
# Older SDK versions
# (Include if the minimum SDK version specified in pubsepc.yaml is earlier than 1.20)
.project
.buildlog
**/packages/
# Files created by dart2js
# (Most Dart developers will use pub build to compile Dart, use/modify these
# rules if you intend to use dart2js directly
# Convention is to use extension '.dart.js' for Dart compiled to Javascript to
# differentiate from explicit Javascript files)
*.dart.js
*.part.js
*.js.deps
*.js.map
*.info.json
# Directory created by dartdoc
# Don't commit pubspec lock file
# (Library packages only! Remove pattern if developing an application package)
### JetBrains template
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
# User-specific stuff:
## VsCode
.vscode/
## File-based project format:
*.iws
## Plugin-specific files:
# IntelliJ
.idea/
/out/
.idea_modules/
# JIRA plugin
atlassian-ide-plugin.xml
# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties

View file

@ -1,48 +1,68 @@
# 4.0.0 # Change Log
## 4.1.0
* Updated to use `belatuk_symbol_table` package
* Upgraded from `pendantic` to `lints` linter
## 4.0.0
* Migrated to support Dart SDK 2.12.x NNBD * Migrated to support Dart SDK 2.12.x NNBD
# 3.0.0 ## 3.0.0
* Migrated to work with Dart SDK 2.12.x Non NNBD * Migrated to work with Dart SDK 2.12.x Non NNBD
# 2.0.2 ## 2.0.2
* Fixed handling of `if` in non-strict mode. * Fixed handling of `if` in non-strict mode.
* Roll `JaelFormatter` and `jaelfmt`. * Roll `JaelFormatter` and `jaelfmt`.
# 2.0.1 ## 2.0.1
* Fixed bug where the `textarea` name check would never return `true`. * Fixed bug where the `textarea` name check would never return `true`.
# 2.0.0+1 ## 2.0.0+1
* Meta-update for Pub score. * Meta-update for Pub score.
# 2.0.0 ## 2.0.0
* Dart 2 updates. * Dart 2 updates.
* Remove usage of `package:dart2_constant`. * Remove usage of `package:dart2_constant`.
# 1.0.6+1 ## 1.0.6+1
* Ensure `<element>` passes attributes. * Ensure `<element>` passes attributes.
# 1.0.6 ## 1.0.6
* Add `index-as` to `for-each`. * Add `index-as` to `for-each`.
* Support registering + rendering custom elements. * Support registering + rendering custom elements.
* Improve handling of booleans in non-strict mode. * Improve handling of booleans in non-strict mode.
# 1.0.5 ## 1.0.5
* Add support for DSX, a port of JSX to Dart. * Add support for DSX, a port of JSX to Dart.
# 1.0.4 ## 1.0.4
* Skip HTML comments in free text. * Skip HTML comments in free text.
# 1.0.3 ## 1.0.3
* Fix a scanner bug that prevented proper parsing of HTML nodes * Fix a scanner bug that prevented proper parsing of HTML nodes
followed by free text. followed by free text.
* Don't trim `<textarea>` content. * Don't trim `<textarea>` content.
# 1.0.2 ## 1.0.2
* Use `package:dart2_constant`. * Use `package:dart2_constant`.
* Upgrade `package:symbol_table`. * Upgrade `package:symbol_table`.
* Added `Renderer.errorDocument`. * Added `Renderer.errorDocument`.
# 1.0.1 ## 1.0.1
* Reworked the scanner; thereby fixing an extremely pesky bug * Reworked the scanner; thereby fixing an extremely pesky bug
that prevented successful parsing of Jael files containing that prevented successful parsing of Jael files containing
JavaScript. JavaScript.

View file

@ -1,21 +1,29 @@
MIT License (MIT) BSD 3-Clause License
Copyright (c) 2021 dukefirehawk.com 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.

View file

@ -1,25 +1,26 @@
# jael3 # Jael 3
[![version](https://img.shields.io/badge/pub-v4.0.0-brightgreen)](https://pub.dartlang.org/packages/jael3)
[![version](https://img.shields.io/badge/pub-v4.1.0-brightgreen)](https://pub.dev/packages/jael3)
[![Null Safety](https://img.shields.io/badge/null-safety-brightgreen)](https://dart.dev/null-safety) [![Null Safety](https://img.shields.io/badge/null-safety-brightgreen)](https://dart.dev/null-safety)
[![Gitter](https://img.shields.io/gitter/room/angel_dart/discussion)](https://gitter.im/angel_dart/discussion) [![Gitter](https://img.shields.io/gitter/room/angel_dart/discussion)](https://gitter.im/angel_dart/discussion)
[![License](https://img.shields.io/github/license/dart-backend/belatuk-common-utilities)](https://github.com/dukefirehawk/angel/tree/angel3/packages/jael/jael/LICENSE)
[![License](https://img.shields.io/github/license/dukefirehawk/angel)](https://github.com/dukefirehawk/angel/tree/angel3/packages/jael/jael/LICENSE)
A simple server-side HTML templating engine for Dart. A simple server-side HTML templating engine for Dart.
[See documentation.](https://docs.angel-dart.dev/packages/front-end/jael) [See documentation.](https://docs.angel-dart.dev/packages/front-end/jael)
# Installation ## Installation
In your `pubspec.yaml`: In your `pubspec.yaml`:
```yaml ```yaml
dependencies: dependencies:
jael3: ^4.0.0 jael3: ^4.1.0
``` ```
# API ## API
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:angel3_code_buffer/code_buffer.dart'; import 'package:angel3_code_buffer/code_buffer.dart';

View file

@ -1,4 +1 @@
include: package:pedantic/analysis_options.yaml include: package:lints/recommended.yaml
analyzer:
strong-mode:
implicit-casts: false

View file

@ -33,7 +33,9 @@ void main(List<String> args) async {
try { try {
var argResults = argParser.parse(args); var argResults = argParser.parse(args);
if (argResults['help'] as bool) { if (argResults['help'] as bool) {
stdout..writeln('Formatter for Jael templates.')..writeln(); stdout
..writeln('Formatter for Jael templates.')
..writeln();
printUsage(stdout); printUsage(stdout);
return; return;
} }
@ -49,7 +51,9 @@ void main(List<String> args) async {
} }
} }
} on ArgParserException catch (e) { } on ArgParserException catch (e) {
stderr..writeln(e.message)..writeln(); stderr
..writeln(e.message)
..writeln();
printUsage(stderr); printUsage(stderr);
exitCode = 65; exitCode = 65;
} }

View file

@ -2,7 +2,7 @@ import 'dart:io';
import 'package:charcode/charcode.dart'; import 'package:charcode/charcode.dart';
import 'package:angel3_code_buffer/angel3_code_buffer.dart'; import 'package:angel3_code_buffer/angel3_code_buffer.dart';
import 'package:jael3/jael3.dart' as jael; import 'package:jael3/jael3.dart' as jael;
import 'package:angel3_symbol_table/angel3_symbol_table.dart'; import 'package:belatuk_symbol_table/belatuk_symbol_table.dart';
void main() { void main() {
while (true) { while (true) {

View file

@ -1,5 +1,5 @@
import 'package:source_span/source_span.dart'; import 'package:source_span/source_span.dart';
import 'package:angel3_symbol_table/angel3_symbol_table.dart'; import 'package:belatuk_symbol_table/belatuk_symbol_table.dart';
import 'ast_node.dart'; import 'ast_node.dart';
import 'expression.dart'; import 'expression.dart';
import 'identifier.dart'; import 'identifier.dart';

View file

@ -1,5 +1,5 @@
import 'package:source_span/source_span.dart'; import 'package:source_span/source_span.dart';
import 'package:angel3_symbol_table/angel3_symbol_table.dart'; import 'package:belatuk_symbol_table/belatuk_symbol_table.dart';
import 'ast_node.dart'; import 'ast_node.dart';
import 'token.dart'; import 'token.dart';

View file

@ -1,5 +1,5 @@
import 'package:source_span/source_span.dart'; import 'package:source_span/source_span.dart';
import 'package:angel3_symbol_table/angel3_symbol_table.dart'; import 'package:belatuk_symbol_table/belatuk_symbol_table.dart';
import 'expression.dart'; import 'expression.dart';
import 'token.dart'; import 'token.dart';

View file

@ -1,6 +1,6 @@
import 'dart:mirrors'; import 'dart:mirrors';
import 'package:source_span/source_span.dart'; import 'package:source_span/source_span.dart';
import 'package:angel3_symbol_table/angel3_symbol_table.dart'; import 'package:belatuk_symbol_table/belatuk_symbol_table.dart';
import 'expression.dart'; import 'expression.dart';
import 'identifier.dart'; import 'identifier.dart';
import 'token.dart'; import 'token.dart';

View file

@ -1,6 +1,6 @@
import 'package:charcode/charcode.dart'; import 'package:charcode/charcode.dart';
import 'package:source_span/source_span.dart'; import 'package:source_span/source_span.dart';
import 'package:angel3_symbol_table/angel3_symbol_table.dart'; import 'package:belatuk_symbol_table/belatuk_symbol_table.dart';
import '../ast/ast.dart'; import '../ast/ast.dart';
import 'expression.dart'; import 'expression.dart';
import 'token.dart'; import 'token.dart';

View file

@ -2,7 +2,7 @@ import 'dart:convert';
import 'package:angel3_code_buffer/angel3_code_buffer.dart'; import 'package:angel3_code_buffer/angel3_code_buffer.dart';
import 'package:collection/collection.dart' show IterableExtension; import 'package:collection/collection.dart' show IterableExtension;
//import 'package:source_span/source_span.dart'; //import 'package:source_span/source_span.dart';
import 'package:angel3_symbol_table/angel3_symbol_table.dart'; import 'package:belatuk_symbol_table/belatuk_symbol_table.dart';
import 'ast/ast.dart'; import 'ast/ast.dart';
import 'text/parser.dart'; import 'text/parser.dart';
import 'text/scanner.dart'; import 'text/scanner.dart';
@ -119,7 +119,9 @@ class Renderer {
} }
} }
buffer..write('<')..write(element.tagName.name); buffer
..write('<')
..write(element.tagName.name);
for (var attribute in element.attributes) { for (var attribute in element.attributes) {
var value = attribute.value?.compute(childScope); var value = attribute.value?.compute(childScope);

View file

@ -1,5 +1,5 @@
name: jael3 name: jael3
version: 4.0.0 version: 4.1.0
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/angel3/packages/jael/jael homepage: https://github.com/dukefirehawk/angel/tree/angel3/packages/jael/jael
environment: environment:
@ -8,13 +8,13 @@ dependencies:
args: ^2.0.0 args: ^2.0.0
charcode: ^1.0.0 charcode: ^1.0.0
angel3_code_buffer: ^2.0.0 angel3_code_buffer: ^2.0.0
angel3_symbol_table: ^2.0.0 belatuk_symbol_table: ^3.0.0
source_span: ^1.0.0 source_span: ^1.0.0
string_scanner: ^1.0.0 string_scanner: ^1.0.0
collection: ^1.15.0 collection: ^1.15.0
matcher: ^0.12.10 matcher: ^0.12.10
dev_dependencies: dev_dependencies:
pedantic: ^1.11.0 lints: ^1.0.0
test: ^1.17.4 test: ^1.17.4
executables: executables:
jaelfmt: jaelfmt jaelfmt: jaelfmt

View file

@ -1,7 +1,7 @@
import 'dart:math'; import 'dart:math';
import 'package:angel3_code_buffer/angel3_code_buffer.dart'; import 'package:angel3_code_buffer/angel3_code_buffer.dart';
import 'package:jael3/jael3.dart' as jael; import 'package:jael3/jael3.dart' as jael;
import 'package:angel3_symbol_table/angel3_symbol_table.dart'; import 'package:belatuk_symbol_table/belatuk_symbol_table.dart';
import 'package:test/test.dart'; import 'package:test/test.dart';
void main() { void main() {

View file

@ -1,5 +1,5 @@
import 'package:jael3/jael3.dart'; import 'package:jael3/jael3.dart';
import 'package:angel3_symbol_table/angel3_symbol_table.dart'; import 'package:belatuk_symbol_table/belatuk_symbol_table.dart';
import 'package:test/test.dart'; import 'package:test/test.dart';
void main() { void main() {

View file

@ -1,6 +1,6 @@
import 'package:angel3_code_buffer/angel3_code_buffer.dart'; import 'package:angel3_code_buffer/angel3_code_buffer.dart';
import 'package:jael3/jael3.dart' as jael; import 'package:jael3/jael3.dart' as jael;
import 'package:angel3_symbol_table/angel3_symbol_table.dart'; import 'package:belatuk_symbol_table/belatuk_symbol_table.dart';
import 'package:test/test.dart'; import 'package:test/test.dart';
void main() { void main() {

View file

@ -1,21 +0,0 @@
# See https://www.dartlang.org/guides/libraries/private-files
# Files and directories created by pub
.dart_tool/
.packages
build/
# If you're building an application, you may want to check-in your pubspec.lock
pubspec.lock
# Directory created by dartdoc
# If you don't generate documentation locally you can remove this line.
doc/api/
# Avoid committing generated Javascript files:
*.dart.js
*.info.json # Produced by the --dump-info flag.
*.js # When generated by dart2js. Don't specify *.js if your
# project includes source files written in JavaScript.
*.js_
*.js.deps
*.js.map

View file

@ -1,71 +0,0 @@
# See https://www.dartlang.org/tools/private-files.html
# Files and directories created by pub
.dart_tool
.packages
.pub/
build/
# If you're building an application, you may want to check-in your pubspec.lock
pubspec.lock
# Directory created by dartdoc
# If you don't generate documentation locally you can remove this line.
doc/api/
### Dart template
# See https://www.dartlang.org/tools/private-files.html
# Files and directories created by pub
# SDK 1.20 and later (no longer creates packages directories)
# Older SDK versions
# (Include if the minimum SDK version specified in pubsepc.yaml is earlier than 1.20)
.project
.buildlog
**/packages/
# Files created by dart2js
# (Most Dart developers will use pub build to compile Dart, use/modify these
# rules if you intend to use dart2js directly
# Convention is to use extension '.dart.js' for Dart compiled to Javascript to
# differentiate from explicit Javascript files)
*.dart.js
*.part.js
*.js.deps
*.js.map
*.info.json
# Directory created by dartdoc
# Don't commit pubspec lock file
# (Library packages only! Remove pattern if developing an application package)
### JetBrains template
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
# User-specific stuff:
## VsCode
.vscode/
## File-based project format:
*.iws
## Plugin-specific files:
# IntelliJ
.idea/
/out/
.idea_modules/
# JIRA plugin
atlassian-ide-plugin.xml
# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties

View file

@ -1,21 +1,35 @@
# 4.0.1 # Change Log
## 4.1.0
* Updated to use `belatuk_symbol_table` package
* Upgraded from `pendantic` to `lints` linter
## 4.0.1
* Resolved static analysis warnings * Resolved static analysis warnings
# 4.0.0 ## 4.0.0
* Migrated to support Dart SDK 2.12.x NNBD * Migrated to support Dart SDK 2.12.x NNBD
# 3.0.0 ## 3.0.0
* Migrated to work with Dart SDK 2.12.x Non NNBD * Migrated to work with Dart SDK 2.12.x Non NNBD
# 2.0.1 ## 2.0.1
* Fixed a bug where failed file resolutions would not become proper errors. * Fixed a bug where failed file resolutions would not become proper errors.
# 2.0.0+1 ## 2.0.0+1
* Homepage update for Pub. * Homepage update for Pub.
# 2.0.0 ## 2.0.0
* Dart 2 updates. * Dart 2 updates.
* Fix a templating bug where multiple inheritance did not work. * Fix a templating bug where multiple inheritance did not work.
# 1.0.0+1 ## 1.0.0+1
* Minor change to `Patcher` signature for Dart 2 compatibility.
* Minor change to `Patcher` signature for Dart 2 compatibility.

View file

@ -1,21 +1,29 @@
MIT License (MIT) BSD 3-Clause License
Copyright (c) 2021 dukefirehawk.com 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.

View file

@ -1,22 +1,23 @@
# jael3_preprocessor # Jael Ppreprocessor
[![version](https://img.shields.io/badge/pub-v4.0.1-brightgreen)](https://pub.dartlang.org/packages/jael3_preprocessor)
[![version](https://img.shields.io/badge/pub-v4.0.1-brightgreen)](https://pub.dev/packages/jael3_preprocessor)
[![Null Safety](https://img.shields.io/badge/null-safety-brightgreen)](https://dart.dev/null-safety) [![Null Safety](https://img.shields.io/badge/null-safety-brightgreen)](https://dart.dev/null-safety)
[![Gitter](https://img.shields.io/gitter/room/angel_dart/discussion)](https://gitter.im/angel_dart/discussion) [![Gitter](https://img.shields.io/gitter/room/angel_dart/discussion)](https://gitter.im/angel_dart/discussion)
[![License](https://img.shields.io/github/license/dart-backend/belatuk-common-utilities)](https://github.com/dukefirehawk/angel/tree/angel3/packages/jael/jael_preprocessor/LICENSE)
[![License](https://img.shields.io/github/license/dukefirehawk/angel)](https://github.com/dukefirehawk/angel/tree/angel3/packages/jael/jael_preprocessor/LICENSE) A pre-processor for resolving blocks and includes within [Jael 3](https://github.com/dukefirehawk/angel/tree/angel3/packages/jael/jael) templates.
A pre-processor for resolving blocks and includes within ## Installation
[Jael](https://github.com/dukefirehawk/angel/tree/angel3/packages/jael/jael) templates.
# Installation
In your `pubspec.yaml`: In your `pubspec.yaml`:
```yaml ```yaml
dependencies: dependencies:
jael3_prepreprocessor: ^4.0.0 jael3_prepreprocessor: ^4.1.0
``` ```
# Usage ## Usage
It is unlikely that you will directly use this package, as it is It is unlikely that you will directly use this package, as it is
more of an implementation detail than a requirement. However, it more of an implementation detail than a requirement. However, it
is responsible for handling `include` and `block` directives is responsible for handling `include` and `block` directives
@ -49,4 +50,4 @@ myOtherFunction(jael.Document doc) {
} }
``` ```
**This package uses `package:file`, rather than `dart:io`.** **This package uses `package:file`, rather than `dart:io`.**

View file

@ -1,4 +1 @@
include: package:pedantic/analysis_options.yaml include: package:lints/recommended.yaml
analyzer:
strong-mode:
implicit-casts: false

View file

@ -3,7 +3,7 @@ import 'dart:collection';
import 'package:collection/collection.dart' show IterableExtension; import 'package:collection/collection.dart' show IterableExtension;
import 'package:file/file.dart'; import 'package:file/file.dart';
import 'package:jael3/jael3.dart'; import 'package:jael3/jael3.dart';
import 'package:angel3_symbol_table/angel3_symbol_table.dart'; import 'package:belatuk_symbol_table/belatuk_symbol_table.dart';
/// Modifies a Jael document. /// Modifies a Jael document.
typedef Patcher = FutureOr<Document>? Function(Document? document, typedef Patcher = FutureOr<Document>? Function(Document? document,

View file

@ -1,15 +1,18 @@
name: jael3_preprocessor name: jael3_preprocessor
version: 4.0.1 version: 4.1.0
description: A pre-processor for resolving blocks and includes within Jael templates. description: A pre-processor for resolving blocks and includes within Jael templates.
homepage: https://github.com/dukefirehawk/angel/tree/angel3/packages/jael/jael_preprocessor homepage: https://github.com/dukefirehawk/angel/tree/angel3/packages/jael/jael_preprocessor
environment: environment:
sdk: '>=2.12.0 <3.0.0' sdk: '>=2.12.0 <3.0.0'
dependencies: dependencies:
file: ^6.1.0 file: ^6.1.0
jael3: ^4.0.0 jael3: ^4.1.0
angel3_symbol_table: ^2.0.0 belatuk_symbol_table: ^3.0.0
collection: ^1.15.0 collection: ^1.15.0
dev_dependencies: dev_dependencies:
angel3_code_buffer: ^2.0.0 angel3_code_buffer: ^2.0.0
test: ^1.17.4 test: ^1.17.4
pedantic: ^1.11.0 lints: ^1.0.0
#dependency_overrides:
# jael3:
# path: ../jael

View file

@ -3,7 +3,7 @@ import 'package:file/file.dart';
import 'package:file/memory.dart'; import 'package:file/memory.dart';
import 'package:jael3/jael3.dart' as jael; import 'package:jael3/jael3.dart' as jael;
import 'package:jael3_preprocessor/jael3_preprocessor.dart' as jael; import 'package:jael3_preprocessor/jael3_preprocessor.dart' as jael;
import 'package:angel3_symbol_table/angel3_symbol_table.dart'; import 'package:belatuk_symbol_table/belatuk_symbol_table.dart';
import 'package:test/test.dart'; import 'package:test/test.dart';
void main() { void main() {

View file

@ -3,7 +3,7 @@ import 'package:file/file.dart';
import 'package:file/memory.dart'; import 'package:file/memory.dart';
import 'package:jael3/jael3.dart' as jael; import 'package:jael3/jael3.dart' as jael;
import 'package:jael3_preprocessor/jael3_preprocessor.dart' as jael; import 'package:jael3_preprocessor/jael3_preprocessor.dart' as jael;
import 'package:angel3_symbol_table/angel3_symbol_table.dart'; import 'package:belatuk_symbol_table/belatuk_symbol_table.dart';
import 'package:test/test.dart'; import 'package:test/test.dart';
void main() { void main() {

View file

@ -1,16 +0,0 @@
# Created by .ignore support plugin (hsz.mobi)
### Dart template
# See https://www.dartlang.org/tools/private-files.html
# Files and directories created by pub
.packages
.pub/
build/
# If you're building an application, you may want to check-in your pubspec.lock
pubspec.lock
# Directory created by dartdoc
# If you don't generate documentation locally you can remove this line.
doc/api/
.dart_tool