https://github.com/jayphelps/hector
A view markup language and implementation. No more template hell.
https://github.com/jayphelps/hector
Last synced: 6 months ago
JSON representation
A view markup language and implementation. No more template hell.
- Host: GitHub
- URL: https://github.com/jayphelps/hector
- Owner: jayphelps
- License: mit
- Created: 2012-12-03T07:31:47.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2015-06-13T10:05:26.000Z (about 10 years ago)
- Last Synced: 2024-10-19T17:58:32.870Z (9 months ago)
- Language: JavaScript
- Homepage:
- Size: 535 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Hector [](https://travis-ci.org/jayphelps/hector)
======
In progress.### Example
```groovy
// This is a valid comment
/* So is this */def LogoView tagName="img" src="logo.png";
def ButtonView tagName="span" className="button-view" {
// Optional content. If a `label` isn't provided,
// the will simply be empty.
b { $label?; }
}def TopBarView tagName="header" {
LogoView;
ButtonView {
label: "Click me";
}
}def ContentView style.width="960px" {
h1 { $heading; }
ButtonView {
label: "I am a button!";
}
<#if $items?>
ul {
<#each $items>
li { $name; }
}
}def HomePageView backgroundColor="red" {
TopBarView;
ContentView {
heading: "Welcome to the home page!";
items: ["first", "second", "third"];
}
}// Since we declared the previous views, they are reusable
def AboutPageView backgroundColor="green" {
TopBarView;
ContentView {
heading: "Now you are on the About page.";
}
}
```###### Output of a rendered HomePageView instance (JavaScript target)
```html
![]()
Welcome to the home page!
- first
- second
- third
```
