Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jayphelps/hector
A view markup language and implementation. No more template hell.
https://github.com/jayphelps/hector
Last synced: 21 days 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 (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2015-06-13T10:05:26.000Z (over 9 years ago)
- Last Synced: 2023-03-22T22:37:17.063Z (over 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 535 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Hector [![Build Status](https://travis-ci.org/jayphelps/hector.png)](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
```
![](https://ssl.google-analytics.com/__utm.gif?utmwv=5.3.8&utms=6&utmn=1180464769&utmhn=jayphelps.com&utmcs=UTF-8&utmsr=1366x768&utmvp=1366x331&utmsc=24-bit&utmul=en-us&utmje=1&utmfl=11.5%20r31&utmdt=Hector%20Github&utmhid=1114821283&utmr=0&utmp=%2Fhector&utmac=UA-33446752-1&utmcc=__utma%3D221278083.1685971992.1352361675.1354869083.1355292485.11%3B%2B__utmz%3D221278083.1352361675.1.1.utmcsr%3D&utmu=q~)