Description

Diet filter plugin for TypeScript.

Package Information

Version~master (2015-Jan-18)
Repositoryhttps://github.com/f/diet-typescript
LicenseMIT
CopyrightCopyright © 2015 -, Fatih Kadir Akin
AuthorsFatih Kadir Akin, Martin Nowak
Registered byFatih Kadir Akın
Dependencies

vibe-d

Installation

To use this package, put the following dependency into your project's dependencies section:

dub.json
dub.sdl

Readme

DLang Vibe.d Diet Plugin for TypeScript

Screenshot

Compiles TypeScript in Diet templates to JavaScript and caches the result.

Usage

To register the plugin you have to import diet_typescript; in your application.

import vibe.d;
import diet_typescript;

//...

void hello(HTTPServerRequest req, HTTPServerResponse res)
{
    res.render!"typescript.dt"();
}

Now you can use the :typescript textfilter in your diet files.

doctype html
html
  head
    title Hello, TypeScript
  body
    :typescript
      class HelloWorld {
        constructor(id: number, name: string) {
           console.log("Hello world!");
        }
      }

      var typing = new TypeCheckDemo("hello", 1);

See example for a complete vibe.d app.

Available versions

~master