<commit_before>Template.ts
===========

Simple, code based, template engine for TypeScript.

Create your templates in the `Template` module:

```typescript
module Template {
  
  export function layout(...content:string[]):string {
    return article(
      header(
        h1("My Page")
      ),
      section({ id:"main_content", cls:"content-area" },
        content.join('')
      ),
      footer(
        p("&copy; me!")
      )
    );
  }

  export function home():string {
    return layout(
      h2("Home Page"),
      p("My homepage conent! ")
    );
  }
}
```

Then, you can use it elsewhere (like, for example, a `Backbone.View`):

```typescript
module App.Views {
  
  class HomeView extends Backbone.View {
    render() {
      this.$el.html( Template.home() );
      return this;
    }
  }
}
```

Or if you want to, you can nest your templates in submodules:

```typescript
module Template.AppViews {
  
  export function listView(id:string = "my_list", attrs?:any={}): string {
    attrs.id = id;
    attrs.cls = 'list-view';
    return ul(attrs);
  }

  export function listItem(label:string, attrs?:any={}):string {
    atts.cls = 'list-item'
    return li(attrs,
      div({ cls:'label' }, label)
    );
  }

}
```<commit_msg>Updated ReadMe code blocks to javascript type until github adds a typescript syntax highlighter.<commit_after>Template.ts
===========

Simple, code based, template engine for TypeScript.

Create your templates in the `Template` module:

```javascript
module Template {
  
  export function layout(...content:string[]):string {
    return article(
      header(
        h1("My Page")
      ),
      section({ id:"main_content", cls:"content-area" },
        content.join('')
      ),
      footer(
        p("&copy; me!")
      )
    );
  }

  export function home():string {
    return layout(
      h2("Home Page"),
      p("My homepage conent! ")
    );
  }
}
```

Then, you can use it elsewhere (like, for example, a `Backbone.View`):

```javascript
module App.Views {
  
  class HomeView extends Backbone.View {
    render() {
      this.$el.html( Template.home() );
      return this;
    }
  }
}
```

Or if you want to, you can nest your templates in submodules:

```javascript
module Template.AppViews {
  
  export function listView(id:string = "my_list", attrs?:any={}): string {
    attrs.id = id;
    attrs.cls = 'list-view';
    return ul(attrs);
  }

  export function listItem(label:string, attrs?:any={}):string {
    atts.cls = 'list-item'
    return li(attrs,
      div({ cls:'label' }, label)
    );
  }

}
```
{'fraction_non_alphanumeric': 0.154294597745822, 'fraction_numerical': 0.001554605518849592, 'mean_word_length': 2.757664233576642, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7400429', 'n_tokens_mistral': 836, 'n_tokens_neox': 816, 'n_words': 221}