https://github.com/rikulo/uxl
Rikulo UXL (User-interface eXtensible Language) is a markup language allowing developers to define user-interface in XML, and then compile and debug it in Dart.
https://github.com/rikulo/uxl
Last synced: 8 months ago
JSON representation
Rikulo UXL (User-interface eXtensible Language) is a markup language allowing developers to define user-interface in XML, and then compile and debug it in Dart.
- Host: GitHub
- URL: https://github.com/rikulo/uxl
- Owner: rikulo
- License: other
- Created: 2012-10-19T11:29:06.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2013-12-29T14:22:09.000Z (over 12 years ago)
- Last Synced: 2025-06-05T01:31:15.500Z (about 1 year ago)
- Language: Dart
- Homepage: http://rikulo.org
- Size: 563 KB
- Stars: 5
- Watchers: 7
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGES.md
- License: LICENSE
Awesome Lists containing this project
README
#Rikulo UXL
[Rikulo UXL](http://rikulo.org) (User-interface eXtensible language) is a markup language for describing applications' user interfaces. UXL is a simple variant of XML. It allows you to define user interfaces in a similar manner to authoring HTML and XML pages. It also allows you to use the Model-View-Controller (MVC) pattern to develop applications.
* [Home](http://rikulo.org)
* [UXL Documentation](http://docs.rikulo.org/ui/latest/UXL)
* [UXL API Reference](http://api.rikulo.org/uxl/latest/)
* [Discussion](http://stackoverflow.com/questions/tagged/rikulo)
* [Source Code Repos](https://github.com/rikulo/uxl)
* [Issues](https://github.com/rikulo/uxl/issues)
Rikulo UXL is distributed under the Apache 2.0 License.
##Installation
Add this to your `pubspec.yaml` (or create it):
dependencies:
rikulo_uxl:
Then run the [Pub Package Manager](http://pub.dartlang.org/doc) (comes with the Dart SDK):
pub install
##Usage
First, you have to prepare UXL files defining the user interface. Next, there are two ways to compile it into dart files: automatic building with Dart Editor or manual compiling.
###Build with Dart Editor
To compile your UXL files automatically, you just need to add a build.dart file in the root directory of your project, with the following content:
import 'package:rikulo_uxl/uc.dart' show build;
void main(List arguments) {
build(arguments);
}
With this build.dart script, whenever your UXL is modified, it will be re-compiled.
###Compile Manually
To compile a UXL file manually, run `uc` (UXL compiler) to compile it into the dart file with [command line interface](http://en.wikipedia.org/wiki/Command-line_interface) as follows:
dart bin/uc.dart your-uxl-file(s)
A dart file is generated for each UXL file you gave.
###UXL and Its Generated Dart File
A UXL file can define one or multiple templates. For example, here is a UXL file defining a template called `ScrollViewTemplate`:
```xml
```
A template is actually compiled to a Dart function with the name specified in UXL:
List ScrollViewTemplate({parent, rows: 30, cols: 30}) {
List _vcr_ = new List();
var _this_;
final _v0_ = _this_ = new ScrollView()
...
_vcr_.add(_v0_);
...
return _vcr_;
}
> For a complete dart file, please refer to [here](https://github.com/rikulo/uxl/blob/master/example/scroll-view/ScrollView.uxl.dart).
Having you UXL compiled, you can instantiate views based on the template whatever you want:
void main() {
final View mainView = new View()..addToDocument();
ScrollViewTemplate(parent: mainView);
}
##Pros and Cons
###Pros
* The user interface can be defined easily in a similar manner to HTML and XML pages.
* MVC/MVP and data-binding for improving the separation of view, model and controller.
* Performance is as good as expressing in Dart.
* Easy to debug since the generated Dart code is easy to understand.
###Cons
* It has to be compiled to Dart in advance.
##Notes to Contributors
###Create Addons
Rikulo is easy to extend. The simplest way to enhance Rikulo is to [create a new repository](https://help.github.com/articles/create-a-repo) and add your own great widgets and libraries to it.
###Fork Rikulo UXL
If you'd like to contribute back to the core, you can [fork this repository](https://help.github.com/articles/fork-a-repo) and send us a pull request, when it is ready.
Please be aware that one of Rikulo's design goals is to keep the sphere of API as neat and consistency as possible. Strong enhancement always demands greater consensus.
If you are new to Git or GitHub, please read [this guide](https://help.github.com/) first.