Add generated API docs for TypeScript rules

PiperOrigin-RevId: 195089105
diff --git a/BUILD.bazel b/BUILD.bazel
index acb3211..baf8715 100644
--- a/BUILD.bazel
+++ b/BUILD.bazel
@@ -37,3 +37,19 @@
     ]),
     visibility = ["//visibility:public"],
 )
+
+load("@io_bazel_skydoc//skylark:skylark.bzl", "skylark_doc")
+
+skylark_doc(
+    name = "docs",
+    srcs = [
+        "//internal:build_defs.bzl",
+        "//internal:ts_repositories.bzl",
+        "//internal:ts_config.bzl",
+        "//internal/devserver:ts_devserver.bzl",
+        "//internal/karma:ts_web_test.bzl",
+    ],
+    format = "html",
+    site_root = "/rules_typescript/api",
+    strip_prefix = "internal/",
+)
diff --git a/WORKSPACE b/WORKSPACE
index 23884f2..80c2a40 100644
--- a/WORKSPACE
+++ b/WORKSPACE
@@ -60,3 +60,30 @@
     url = "https://github.com/bazelbuild/bazel/releases/download/0.9.0/bazel-0.9.0-dist.zip",
     sha256 = "efb28fed4ffcfaee653e0657f6500fc4cbac61e32104f4208da385676e76312a",
 )
+
+#############################################
+# Dependencies for generating documentation #
+#############################################
+
+http_archive(
+    name = "io_bazel_rules_sass",
+    url = "https://github.com/bazelbuild/rules_sass/archive/0.0.3.zip",
+    strip_prefix = "rules_sass-0.0.3",
+    sha256 = "8fa98e7b48a5837c286a1ea254b5a5c592fced819ee9fe4fdd759768d97be868",
+)
+load("@io_bazel_rules_sass//sass:sass.bzl", "sass_repositories")
+sass_repositories()
+
+http_archive(
+    name = "bazel_skylib",
+    url = "https://github.com/bazelbuild/bazel-skylib/archive/0.3.1.zip",
+    strip_prefix = "bazel-skylib-0.3.1",
+)
+
+http_archive(
+    name = "io_bazel_skydoc",
+    url = "https://github.com/bazelbuild/skydoc/archive/0ef7695c9d70084946a3e99b89ad5a99ede79580.zip",
+    strip_prefix = "skydoc-0ef7695c9d70084946a3e99b89ad5a99ede79580",
+)
+load("@io_bazel_skydoc//skylark:skylark.bzl", "skydoc_repositories")
+skydoc_repositories()
diff --git a/defs.bzl b/defs.bzl
index 644d3c7..d5bfd61 100644
--- a/defs.bzl
+++ b/defs.bzl
@@ -28,3 +28,5 @@
 ts_devserver = _ts_devserver
 # TODO(alexeagle): make ts_web_test work in google3
 ts_web_test = _ts_web_test
+# DO NOT ADD MORE rules here unless they appear in the generated docsite.
+# Run yarn skydoc to re-generate the docsite.
diff --git a/docs/api/build_defs.html b/docs/api/build_defs.html
new file mode 100644
index 0000000..2290c91
--- /dev/null
+++ b/docs/api/build_defs.html
@@ -0,0 +1,262 @@
+
+
+<!--
+Documentation generated by Skydoc
+-->
+<!DOCTYPE html>
+<html>
+  <head>
+    <meta charset="utf-8">
+    <meta name="viewport" content="width=device-width initial-scale=1" />
+    <meta http-equiv="X-UA-Compatible" content="IE=edge">
+
+    <title>TypeScript compilation</title>
+
+    <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,600,700" type="text/css">
+    <link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
+    <link rel="stylesheet" href="https://code.getmdl.io/1.1.1/material.green-light_blue.min.css">
+    <script defer src="https://code.getmdl.io/1.1.1/material.min.js"></script>
+    <link rel="stylesheet" href="/rules_typescript/api/main.css">
+  </head>
+  <body>
+    <div class="mdl-layout mdl-js-layout mdl-layout--fixed-drawer
+      mdl-layout--fixed-header">
+      <header class="mdl-layout__header">
+        <div class="mdl-layout__header-row">
+          <span class="mdl-layout-title">TypeScript compilation</span>
+        </div>
+      </header>
+      <div class="mdl-layout__drawer">
+        <span class="mdl-layout-title">Bazel</span>
+        <nav class="drawer-nav">
+          <ul class="drawer-nav">
+            
+<li><a href="/rules_typescript/api/index.html">Overview</a></li>
+<li>
+  <a href="/rules_typescript/api/build_defs.html">TypeScript compilation</a>
+  <ul>
+    <li>
+      <a href="/rules_typescript/api/build_defs.html#ts_library">
+        ts_library
+      </a>
+    </li>
+  </ul>
+</li>
+<li>
+  <a href="/rules_typescript/api/ts_repositories.html">Install toolchain dependencies</a>
+  <ul>
+  </ul>
+</li>
+<li>
+  <a href="/rules_typescript/api/ts_config.html">Multiple tsconfig.json files</a>
+  <ul>
+    <li>
+      <a href="/rules_typescript/api/ts_config.html#ts_config">
+        ts_config
+      </a>
+    </li>
+  </ul>
+</li>
+<li>
+  <a href="/rules_typescript/api/devserver/ts_devserver.html">Simple development server</a>
+  <ul>
+    <li>
+      <a href="/rules_typescript/api/devserver/ts_devserver.html#ts_devserver">
+        ts_devserver
+      </a>
+    </li>
+  </ul>
+</li>
+<li>
+  <a href="/rules_typescript/api/karma/ts_web_test.html">Unit testing in Chrome</a>
+  <ul>
+    <li>
+      <a href="/rules_typescript/api/karma/ts_web_test.html#ts_web_test">
+        ts_web_test
+      </a>
+    </li>
+  </ul>
+</li>
+
+          </ul>
+        </nav>
+      </div>
+
+      <main class="mdl-layout__content">
+        <div class="page-content">
+          <h1>TypeScript compilation</h1>
+
+<nav class="toc">
+  <h2>Rules</h2>
+  <ul>
+    <li><a href="#ts_library">ts_library</a></li>
+  </ul>
+  <h2>Macros</h2>
+  <ul>
+    <li><a href="#tsc_wrapped_tsconfig">tsc_wrapped_tsconfig</a></li>
+  </ul>
+</nav>
+          <hr>
+
+          <h2 id="tsc_wrapped_tsconfig">tsc_wrapped_tsconfig</h2>
+
+          <pre>tsc_wrapped_tsconfig(<a href="#tsc_wrapped_tsconfig.ctx">ctx</a>, <a href="#tsc_wrapped_tsconfig.files">files</a>, <a href="#tsc_wrapped_tsconfig.srcs">srcs</a>, <a href="#tsc_wrapped_tsconfig.devmode_manifest">devmode_manifest</a>, <a href="#tsc_wrapped_tsconfig.jsx_factory">jsx_factory</a>)</pre>
+
+          <p>Produce a tsconfig.json that sets options required under Bazel.</p>
+
+
+          <h3 id="tsc_wrapped_tsconfig_args">Attributes</h3>
+
+<table class="params-table">
+  <colgroup>
+    <col class="col-param" />
+    <col class="col-description" />
+  </colgroup>
+  <tbody>
+    <tr id="tsc_wrapped_tsconfig.ctx">
+      <td><code>ctx</code></td>
+      <td>
+        <p><code>Unknown; Required</code></p>
+        
+      </td>
+    </tr>
+    <tr id="tsc_wrapped_tsconfig.files">
+      <td><code>files</code></td>
+      <td>
+        <p><code>Unknown; Required</code></p>
+        
+      </td>
+    </tr>
+    <tr id="tsc_wrapped_tsconfig.srcs">
+      <td><code>srcs</code></td>
+      <td>
+        <p><code>Unknown; Required</code></p>
+        
+      </td>
+    </tr>
+    <tr id="tsc_wrapped_tsconfig.devmode_manifest">
+      <td><code>devmode_manifest</code></td>
+      <td>
+        <p><code>Unknown; Optional</code></p>
+        
+      </td>
+    </tr>
+    <tr id="tsc_wrapped_tsconfig.jsx_factory">
+      <td><code>jsx_factory</code></td>
+      <td>
+        <p><code>Unknown; Optional</code></p>
+        
+      </td>
+    </tr>
+  </tbody>
+</table>
+          <hr>
+
+          <h2 id="ts_library">ts_library</h2>
+
+          <pre>ts_library(<a href="#ts_library.name">name</a>, <a href="#ts_library.srcs">srcs</a>, <a href="#ts_library.compiler">compiler</a>, <a href="#ts_library.internal_testing_type_check_dependencies">internal_testing_type_check_dependencies</a>, <a href="#ts_library.node_modules">node_modules</a>, <a href="#ts_library.supports_workers">supports_workers</a>, <a href="#ts_library.tsconfig">tsconfig</a>, <a href="#ts_library.tsickle_typed">tsickle_typed</a>)</pre>
+
+          <p><code>ts_library</code> type-checks and compiles a set of TypeScript sources to JavaScript.</p>
+<p>It produces declarations files (<code>.d.ts</code>) which are used for compiling downstream
+TypeScript dependencies and JavaScript for the browser and Closure compiler.</p>
+<p>The "devmode" output of <code>ts_library</code> is meant for <code>ts_web_test</code>, <code>ts_devserver</code>,
+and other rules which can provide a fast development round-trip at large scale.
+The intention is that the 50%ile dev round-trip should never exceed 2s, even for
+a very large project.</p>
+<p>The "prodmode" output of <code>ts_library</code> is written as <code>*.closure.js</code> because we
+originally created this to target the Closure Compiler. Any optimizing bundler
+can make use of this output to create highly optimized applications, but the
+development experience is much slower.</p>
+
+
+          <h3 id="ts_library_args">Attributes</h3>
+
+<table class="params-table">
+  <colgroup>
+    <col class="col-param" />
+    <col class="col-description" />
+  </colgroup>
+  <tbody>
+    <tr id="ts_library.name">
+      <td><code>name</code></td>
+      <td>
+        <p><code><a href="https://bazel.build/docs/build-ref.html#name">Name</a>; Required</code></p>
+        <p>A unique name for this rule.</p>
+      </td>
+    </tr>
+    <tr id="ts_library.srcs">
+      <td><code>srcs</code></td>
+      <td>
+        <p><code>List of <a href="https://bazel.build/docs/build-ref.html#labels">labels</a>; Required</code></p>
+        <p>The TypeScript source files to compile.</p>
+      </td>
+    </tr>
+    <tr id="ts_library.compiler">
+      <td><code>compiler</code></td>
+      <td>
+        <p><code><a href="https://bazel.build/docs/build-ref.html#labels">Label</a>; Optional; Default is //internal:tsc_wrapped_bin</code></p>
+        <p>Advanced users only.
+            Sets a different TypeScript compiler binary to use for this library.
+            For example, we use the vanilla TypeScript tsc.js for bootstrapping,
+            and Angular compilations can replace this with <code>ngc</code>.</p>
+      </td>
+    </tr>
+    <tr id="ts_library.internal_testing_type_check_dependencies">
+      <td><code>internal_testing_type_check_dependencies</code></td>
+      <td>
+        <p><code>Boolean; Optional; Default is False</code></p>
+        <p>Testing only, whether to type check inputs that aren't srcs.</p>
+      </td>
+    </tr>
+    <tr id="ts_library.node_modules">
+      <td><code>node_modules</code></td>
+      <td>
+        <p><code><a href="https://bazel.build/docs/build-ref.html#labels">Label</a>; Optional; Default is @//:node_modules</code></p>
+        
+      </td>
+    </tr>
+    <tr id="ts_library.supports_workers">
+      <td><code>supports_workers</code></td>
+      <td>
+        <p><code>Boolean; Optional; Default is True</code></p>
+        <p>Advanced users only.
+            Allows you to disable the Bazel Worker strategy for this library.
+            Typically used together with the "compiler" setting when using a
+            non-worker aware compiler binary.</p>
+      </td>
+    </tr>
+    <tr id="ts_library.tsconfig">
+      <td><code>tsconfig</code></td>
+      <td>
+        <p><code><a href="https://bazel.build/docs/build-ref.html#labels">Label</a>; Optional</code></p>
+        <p>A tsconfig.json file containing settings for TypeScript compilation.
+            Note that some properties in the tsconfig are governed by Bazel and will be
+            overridden, such as <code>target</code> and <code>module</code>.</p>
+      </td>
+    </tr>
+    <tr id="ts_library.tsickle_typed">
+      <td><code>tsickle_typed</code></td>
+      <td>
+        <p><code>Boolean; Optional; Default is True</code></p>
+        
+      </td>
+    </tr>
+  </tbody>
+</table>
+
+
+        </div>
+
+        <footer class="mdl-mini-footer">
+          <div class="mdl-mini-footer__left-section">
+            <div class="mdl-logo">Bazel</div>
+            <ul class="mdl-mini-footer__link-list">
+              <li><a href="https://bazel.build">Home</a></li>
+              <li><a href="https://github.com/bazelbuild">GitHub</a></li>
+            </ul>
+          </div>
+        </footer>
+      </main>
+    </div>
+  </body>
+</html>
diff --git a/docs/api/devserver/ts_devserver.html b/docs/api/devserver/ts_devserver.html
new file mode 100644
index 0000000..d375664
--- /dev/null
+++ b/docs/api/devserver/ts_devserver.html
@@ -0,0 +1,214 @@
+
+
+<!--
+Documentation generated by Skydoc
+-->
+<!DOCTYPE html>
+<html>
+  <head>
+    <meta charset="utf-8">
+    <meta name="viewport" content="width=device-width initial-scale=1" />
+    <meta http-equiv="X-UA-Compatible" content="IE=edge">
+
+    <title>Simple development server</title>
+
+    <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,600,700" type="text/css">
+    <link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
+    <link rel="stylesheet" href="https://code.getmdl.io/1.1.1/material.green-light_blue.min.css">
+    <script defer src="https://code.getmdl.io/1.1.1/material.min.js"></script>
+    <link rel="stylesheet" href="/rules_typescript/api/main.css">
+  </head>
+  <body>
+    <div class="mdl-layout mdl-js-layout mdl-layout--fixed-drawer
+      mdl-layout--fixed-header">
+      <header class="mdl-layout__header">
+        <div class="mdl-layout__header-row">
+          <span class="mdl-layout-title">Simple development server</span>
+        </div>
+      </header>
+      <div class="mdl-layout__drawer">
+        <span class="mdl-layout-title">Bazel</span>
+        <nav class="drawer-nav">
+          <ul class="drawer-nav">
+            
+<li><a href="/rules_typescript/api/index.html">Overview</a></li>
+<li>
+  <a href="/rules_typescript/api/build_defs.html">TypeScript compilation</a>
+  <ul>
+    <li>
+      <a href="/rules_typescript/api/build_defs.html#ts_library">
+        ts_library
+      </a>
+    </li>
+  </ul>
+</li>
+<li>
+  <a href="/rules_typescript/api/ts_repositories.html">Install toolchain dependencies</a>
+  <ul>
+  </ul>
+</li>
+<li>
+  <a href="/rules_typescript/api/ts_config.html">Multiple tsconfig.json files</a>
+  <ul>
+    <li>
+      <a href="/rules_typescript/api/ts_config.html#ts_config">
+        ts_config
+      </a>
+    </li>
+  </ul>
+</li>
+<li>
+  <a href="/rules_typescript/api/devserver/ts_devserver.html">Simple development server</a>
+  <ul>
+    <li>
+      <a href="/rules_typescript/api/devserver/ts_devserver.html#ts_devserver">
+        ts_devserver
+      </a>
+    </li>
+  </ul>
+</li>
+<li>
+  <a href="/rules_typescript/api/karma/ts_web_test.html">Unit testing in Chrome</a>
+  <ul>
+    <li>
+      <a href="/rules_typescript/api/karma/ts_web_test.html#ts_web_test">
+        ts_web_test
+      </a>
+    </li>
+  </ul>
+</li>
+
+          </ul>
+        </nav>
+      </div>
+
+      <main class="mdl-layout__content">
+        <div class="page-content">
+          <h1>Simple development server</h1>
+
+<nav class="toc">
+  <h2>Rules</h2>
+  <ul>
+    <li><a href="#ts_devserver">ts_devserver</a></li>
+  </ul>
+  <h2>Macros</h2>
+  <ul>
+    <li><a href="#ts_devserver_macro">ts_devserver_macro</a></li>
+  </ul>
+</nav>
+          <hr>
+
+          <h2 id="ts_devserver_macro">ts_devserver_macro</h2>
+
+          <pre>ts_devserver_macro(<a href="#ts_devserver_macro.tags">tags</a>)</pre>
+
+          <p>This macro re-exposes the <code>ts_devserver</code> rule with some extra tags so that
+it behaves correctly under ibazel.
+This is re-exported in <code>//:defs.bzl</code> as <code>ts_devserver</code> so if you load the rule
+from there, you actually get this macro.</p>
+
+
+          <h3 id="ts_devserver_macro_args">Attributes</h3>
+
+<table class="params-table">
+  <colgroup>
+    <col class="col-param" />
+    <col class="col-description" />
+  </colgroup>
+  <tbody>
+    <tr id="ts_devserver_macro.tags">
+      <td><code>tags</code></td>
+      <td>
+        <p><code>List of strings; Optional</code></p>
+        <p>standard Bazel tags, this macro adds a couple for ibazel</p>
+      </td>
+    </tr>
+  </tbody>
+</table>
+          <hr>
+
+          <h2 id="ts_devserver">ts_devserver</h2>
+
+          <pre>ts_devserver(<a href="#ts_devserver.name">name</a>, <a href="#ts_devserver.deps">deps</a>, <a href="#ts_devserver.data">data</a>, <a href="#ts_devserver.entry_module">entry_module</a>, <a href="#ts_devserver.scripts">scripts</a>, <a href="#ts_devserver.serving_path">serving_path</a>, <a href="#ts_devserver.static_files">static_files</a>)</pre>
+
+          <p>ts_devserver is a simple development server intended for a quick "getting started" experience.</p>
+<p>Additional documentation at <a href="https://github.com/alexeagle/angular-bazel-example/wiki/Running-a-devserver-under-Bazel">https://github.com/alexeagle/angular-bazel-example/wiki/Running-a-devserver-under-Bazel</a></p>
+
+
+          <h3 id="ts_devserver_args">Attributes</h3>
+
+<table class="params-table">
+  <colgroup>
+    <col class="col-param" />
+    <col class="col-description" />
+  </colgroup>
+  <tbody>
+    <tr id="ts_devserver.name">
+      <td><code>name</code></td>
+      <td>
+        <p><code><a href="https://bazel.build/docs/build-ref.html#name">Name</a>; Required</code></p>
+        <p>A unique name for this rule.</p>
+      </td>
+    </tr>
+    <tr id="ts_devserver.deps">
+      <td><code>deps</code></td>
+      <td>
+        <p><code>List of <a href="https://bazel.build/docs/build-ref.html#labels">labels</a>; Optional; Default is []</code></p>
+        <p>Targets that produce JavaScript, such as <code>ts_library</code></p>
+      </td>
+    </tr>
+    <tr id="ts_devserver.data">
+      <td><code>data</code></td>
+      <td>
+        <p><code>List of <a href="https://bazel.build/docs/build-ref.html#labels">labels</a>; Optional; Default is []</code></p>
+        <p>Runtime dependencies</p>
+      </td>
+    </tr>
+    <tr id="ts_devserver.entry_module">
+      <td><code>entry_module</code></td>
+      <td>
+        <p><code>String; Optional; Default is ''</code></p>
+        <p>The entry<em>module should be the AMD module name of the entry module such as `"<em>_main</em></em>/src/index"<code>ts_devserver concats the following snippet after the bundle to load the application:</code>require(["entry_module"]);`</p>
+      </td>
+    </tr>
+    <tr id="ts_devserver.scripts">
+      <td><code>scripts</code></td>
+      <td>
+        <p><code>List of <a href="https://bazel.build/docs/build-ref.html#labels">labels</a>; Optional; Default is []</code></p>
+        <p>User scripts to include in the JS bundle before the application sources</p>
+      </td>
+    </tr>
+    <tr id="ts_devserver.serving_path">
+      <td><code>serving_path</code></td>
+      <td>
+        <p><code>String; Optional; Default is ''</code></p>
+        <p>The path you can request from the client HTML which serves the JavaScript bundle.
+            If you don't specify one, the JavaScript can be loaded at /_/ts_scripts.js</p>
+      </td>
+    </tr>
+    <tr id="ts_devserver.static_files">
+      <td><code>static_files</code></td>
+      <td>
+        <p><code>List of <a href="https://bazel.build/docs/build-ref.html#labels">labels</a>; Optional; Default is []</code></p>
+        <p>Arbitrary files which to be served, such as index.html</p>
+      </td>
+    </tr>
+  </tbody>
+</table>
+
+
+        </div>
+
+        <footer class="mdl-mini-footer">
+          <div class="mdl-mini-footer__left-section">
+            <div class="mdl-logo">Bazel</div>
+            <ul class="mdl-mini-footer__link-list">
+              <li><a href="https://bazel.build">Home</a></li>
+              <li><a href="https://github.com/bazelbuild">GitHub</a></li>
+            </ul>
+          </div>
+        </footer>
+      </main>
+    </div>
+  </body>
+</html>
diff --git a/docs/api/index.html b/docs/api/index.html
new file mode 100644
index 0000000..006d0e8
--- /dev/null
+++ b/docs/api/index.html
@@ -0,0 +1,294 @@
+
+
+<!--
+Documentation generated by Skydoc
+-->
+<!DOCTYPE html>
+<html>
+  <head>
+    <meta charset="utf-8">
+    <meta name="viewport" content="width=device-width initial-scale=1" />
+    <meta http-equiv="X-UA-Compatible" content="IE=edge">
+
+    <title>Overview</title>
+
+    <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,600,700" type="text/css">
+    <link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
+    <link rel="stylesheet" href="https://code.getmdl.io/1.1.1/material.green-light_blue.min.css">
+    <script defer src="https://code.getmdl.io/1.1.1/material.min.js"></script>
+    <link rel="stylesheet" href="/rules_typescript/api/main.css">
+  </head>
+  <body>
+    <div class="mdl-layout mdl-js-layout mdl-layout--fixed-drawer
+      mdl-layout--fixed-header">
+      <header class="mdl-layout__header">
+        <div class="mdl-layout__header-row">
+          <span class="mdl-layout-title">Overview</span>
+        </div>
+      </header>
+      <div class="mdl-layout__drawer">
+        <span class="mdl-layout-title">Bazel</span>
+        <nav class="drawer-nav">
+          <ul class="drawer-nav">
+            
+<li><a href="/rules_typescript/api/index.html">Overview</a></li>
+<li>
+  <a href="/rules_typescript/api/build_defs.html">TypeScript compilation</a>
+  <ul>
+    <li>
+      <a href="/rules_typescript/api/build_defs.html#ts_library">
+        ts_library
+      </a>
+    </li>
+  </ul>
+</li>
+<li>
+  <a href="/rules_typescript/api/ts_repositories.html">Install toolchain dependencies</a>
+  <ul>
+  </ul>
+</li>
+<li>
+  <a href="/rules_typescript/api/ts_config.html">Multiple tsconfig.json files</a>
+  <ul>
+    <li>
+      <a href="/rules_typescript/api/ts_config.html#ts_config">
+        ts_config
+      </a>
+    </li>
+  </ul>
+</li>
+<li>
+  <a href="/rules_typescript/api/devserver/ts_devserver.html">Simple development server</a>
+  <ul>
+    <li>
+      <a href="/rules_typescript/api/devserver/ts_devserver.html#ts_devserver">
+        ts_devserver
+      </a>
+    </li>
+  </ul>
+</li>
+<li>
+  <a href="/rules_typescript/api/karma/ts_web_test.html">Unit testing in Chrome</a>
+  <ul>
+    <li>
+      <a href="/rules_typescript/api/karma/ts_web_test.html#ts_web_test">
+        ts_web_test
+      </a>
+    </li>
+  </ul>
+</li>
+
+          </ul>
+        </nav>
+      </div>
+
+      <main class="mdl-layout__content">
+        <div class="page-content">
+<h1>Overview</h1>
+
+
+<nav class="toc">
+  <h2>Rule sets</h2>
+  <ul>
+    <li><a href="#build_defs">TypeScript compilation</a></li>
+    <li><a href="#ts_repositories">Install toolchain dependencies</a></li>
+    <li><a href="#ts_config">Multiple tsconfig.json files</a></li>
+    <li><a href="#ts_devserver">Simple development server</a></li>
+    <li><a href="#ts_web_test">Unit testing in Chrome</a></li>
+  </ul>
+</nav>
+
+<h2><a href="/rules_typescript/api/build_defs.html" id="build_defs">TypeScript compilation</a></h2>
+
+<h3>Rules</h3>
+<table class="overview-table">
+  <colgroup>
+    <col class="col-name" />
+    <col class="col-description" />
+  </colgroup>
+  <tbody>
+    <tr>
+      <td>
+        <a href="/rules_typescript/api/build_defs.html#ts_library">
+          <code>ts_library</code>
+        </a>
+      </td>
+      <td>
+        <p><code>ts_library</code> type-checks and compiles a set of TypeScript sources to JavaScript.</p>
+
+      </td>
+    </tr>
+  </tbody>
+</table>
+<h3>Macros</h3>
+<table class="overview-table">
+  <colgroup>
+    <col class="col-name" />
+    <col class="col-description" />
+  </colgroup>
+  <tbody>
+    <tr>
+      <td>
+        <a href="/rules_typescript/api/build_defs.html#tsc_wrapped_tsconfig">
+          <code>tsc_wrapped_tsconfig</code>
+        </a>
+      </td>
+      <td>
+        <p>Produce a tsconfig.json that sets options required under Bazel.</p>
+
+      </td>
+    </tr>
+  </tbody>
+</table>
+<h2><a href="/rules_typescript/api/ts_repositories.html" id="ts_repositories">Install toolchain dependencies</a></h2>
+
+<h3>Macros</h3>
+<table class="overview-table">
+  <colgroup>
+    <col class="col-name" />
+    <col class="col-description" />
+  </colgroup>
+  <tbody>
+    <tr>
+      <td>
+        <a href="/rules_typescript/api/ts_repositories.html#ts_setup_workspace">
+          <code>ts_setup_workspace</code>
+        </a>
+      </td>
+      <td>
+        <p>This repository rule should be called from your WORKSPACE file.
+It creates some additional Bazel external repositories that are used internally
+by the TypeScript rules.</p>
+
+      </td>
+    </tr>
+  </tbody>
+</table>
+<h2><a href="/rules_typescript/api/ts_config.html" id="ts_config">Multiple tsconfig.json files</a></h2>
+
+<h3>Rules</h3>
+<table class="overview-table">
+  <colgroup>
+    <col class="col-name" />
+    <col class="col-description" />
+  </colgroup>
+  <tbody>
+    <tr>
+      <td>
+        <a href="/rules_typescript/api/ts_config.html#ts_config">
+          <code>ts_config</code>
+        </a>
+      </td>
+      <td>
+        <p>Allows a tsconfig.json file to extend another file.</p>
+
+      </td>
+    </tr>
+  </tbody>
+</table>
+<h2><a href="/rules_typescript/api/devserver/ts_devserver.html" id="ts_devserver">Simple development server</a></h2>
+
+<h3>Rules</h3>
+<table class="overview-table">
+  <colgroup>
+    <col class="col-name" />
+    <col class="col-description" />
+  </colgroup>
+  <tbody>
+    <tr>
+      <td>
+        <a href="/rules_typescript/api/devserver/ts_devserver.html#ts_devserver">
+          <code>ts_devserver</code>
+        </a>
+      </td>
+      <td>
+        <p>ts_devserver is a simple development server intended for a quick "getting started" experience.</p>
+
+      </td>
+    </tr>
+  </tbody>
+</table>
+<h3>Macros</h3>
+<table class="overview-table">
+  <colgroup>
+    <col class="col-name" />
+    <col class="col-description" />
+  </colgroup>
+  <tbody>
+    <tr>
+      <td>
+        <a href="/rules_typescript/api/devserver/ts_devserver.html#ts_devserver_macro">
+          <code>ts_devserver_macro</code>
+        </a>
+      </td>
+      <td>
+        <p>This macro re-exposes the <code>ts_devserver</code> rule with some extra tags so that
+it behaves correctly under ibazel.
+This is re-exported in <code>//:defs.bzl</code> as <code>ts_devserver</code> so if you load the rule
+from there, you actually get this macro.</p>
+
+      </td>
+    </tr>
+  </tbody>
+</table>
+<h2><a href="/rules_typescript/api/karma/ts_web_test.html" id="ts_web_test">Unit testing in Chrome</a></h2>
+
+<h3>Rules</h3>
+<table class="overview-table">
+  <colgroup>
+    <col class="col-name" />
+    <col class="col-description" />
+  </colgroup>
+  <tbody>
+    <tr>
+      <td>
+        <a href="/rules_typescript/api/karma/ts_web_test.html#ts_web_test">
+          <code>ts_web_test</code>
+        </a>
+      </td>
+      <td>
+        
+      </td>
+    </tr>
+  </tbody>
+</table>
+<h3>Macros</h3>
+<table class="overview-table">
+  <colgroup>
+    <col class="col-name" />
+    <col class="col-description" />
+  </colgroup>
+  <tbody>
+    <tr>
+      <td>
+        <a href="/rules_typescript/api/karma/ts_web_test.html#ts_web_test_macro">
+          <code>ts_web_test_macro</code>
+        </a>
+      </td>
+      <td>
+        <p>This macro re-exposes the <code>ts_web_test</code> rule with some extra tags so that
+it behaves correctly under ibazel.
+This is re-exported in <code>//:defs.bzl</code> as <code>ts_web_test</code> so if you load the rule
+from there, you actually get this macro.</p>
+
+      </td>
+    </tr>
+  </tbody>
+</table>
+
+
+        </div>
+
+        <footer class="mdl-mini-footer">
+          <div class="mdl-mini-footer__left-section">
+            <div class="mdl-logo">Bazel</div>
+            <ul class="mdl-mini-footer__link-list">
+              <li><a href="https://bazel.build">Home</a></li>
+              <li><a href="https://github.com/bazelbuild">GitHub</a></li>
+            </ul>
+          </div>
+        </footer>
+      </main>
+    </div>
+  </body>
+</html>
diff --git a/docs/api/karma/ts_web_test.html b/docs/api/karma/ts_web_test.html
new file mode 100644
index 0000000..2c1d5f0
--- /dev/null
+++ b/docs/api/karma/ts_web_test.html
@@ -0,0 +1,206 @@
+
+
+<!--
+Documentation generated by Skydoc
+-->
+<!DOCTYPE html>
+<html>
+  <head>
+    <meta charset="utf-8">
+    <meta name="viewport" content="width=device-width initial-scale=1" />
+    <meta http-equiv="X-UA-Compatible" content="IE=edge">
+
+    <title>Unit testing in Chrome</title>
+
+    <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,600,700" type="text/css">
+    <link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
+    <link rel="stylesheet" href="https://code.getmdl.io/1.1.1/material.green-light_blue.min.css">
+    <script defer src="https://code.getmdl.io/1.1.1/material.min.js"></script>
+    <link rel="stylesheet" href="/rules_typescript/api/main.css">
+  </head>
+  <body>
+    <div class="mdl-layout mdl-js-layout mdl-layout--fixed-drawer
+      mdl-layout--fixed-header">
+      <header class="mdl-layout__header">
+        <div class="mdl-layout__header-row">
+          <span class="mdl-layout-title">Unit testing in Chrome</span>
+        </div>
+      </header>
+      <div class="mdl-layout__drawer">
+        <span class="mdl-layout-title">Bazel</span>
+        <nav class="drawer-nav">
+          <ul class="drawer-nav">
+            
+<li><a href="/rules_typescript/api/index.html">Overview</a></li>
+<li>
+  <a href="/rules_typescript/api/build_defs.html">TypeScript compilation</a>
+  <ul>
+    <li>
+      <a href="/rules_typescript/api/build_defs.html#ts_library">
+        ts_library
+      </a>
+    </li>
+  </ul>
+</li>
+<li>
+  <a href="/rules_typescript/api/ts_repositories.html">Install toolchain dependencies</a>
+  <ul>
+  </ul>
+</li>
+<li>
+  <a href="/rules_typescript/api/ts_config.html">Multiple tsconfig.json files</a>
+  <ul>
+    <li>
+      <a href="/rules_typescript/api/ts_config.html#ts_config">
+        ts_config
+      </a>
+    </li>
+  </ul>
+</li>
+<li>
+  <a href="/rules_typescript/api/devserver/ts_devserver.html">Simple development server</a>
+  <ul>
+    <li>
+      <a href="/rules_typescript/api/devserver/ts_devserver.html#ts_devserver">
+        ts_devserver
+      </a>
+    </li>
+  </ul>
+</li>
+<li>
+  <a href="/rules_typescript/api/karma/ts_web_test.html">Unit testing in Chrome</a>
+  <ul>
+    <li>
+      <a href="/rules_typescript/api/karma/ts_web_test.html#ts_web_test">
+        ts_web_test
+      </a>
+    </li>
+  </ul>
+</li>
+
+          </ul>
+        </nav>
+      </div>
+
+      <main class="mdl-layout__content">
+        <div class="page-content">
+          <h1>Unit testing in Chrome</h1>
+
+<nav class="toc">
+  <h2>Rules</h2>
+  <ul>
+    <li><a href="#ts_web_test">ts_web_test</a></li>
+  </ul>
+  <h2>Macros</h2>
+  <ul>
+    <li><a href="#ts_web_test_macro">ts_web_test_macro</a></li>
+  </ul>
+</nav>
+          <hr>
+
+          <h2 id="ts_web_test_macro">ts_web_test_macro</h2>
+
+          <pre>ts_web_test_macro(<a href="#ts_web_test_macro.tags">tags</a>, <a href="#ts_web_test_macro.data">data</a>)</pre>
+
+          <p>This macro re-exposes the <code>ts_web_test</code> rule with some extra tags so that
+it behaves correctly under ibazel.
+This is re-exported in <code>//:defs.bzl</code> as <code>ts_web_test</code> so if you load the rule
+from there, you actually get this macro.</p>
+
+
+          <h3 id="ts_web_test_macro_args">Attributes</h3>
+
+<table class="params-table">
+  <colgroup>
+    <col class="col-param" />
+    <col class="col-description" />
+  </colgroup>
+  <tbody>
+    <tr id="ts_web_test_macro.tags">
+      <td><code>tags</code></td>
+      <td>
+        <p><code>List of strings; Optional</code></p>
+        <p>standard Bazel tags, this macro adds a couple for ibazel</p>
+      </td>
+    </tr>
+    <tr id="ts_web_test_macro.data">
+      <td><code>data</code></td>
+      <td>
+        <p><code>List of strings; Optional</code></p>
+        <p>runtime dependencies</p>
+      </td>
+    </tr>
+  </tbody>
+</table>
+          <hr>
+
+          <h2 id="ts_web_test">ts_web_test</h2>
+
+          <pre>ts_web_test(<a href="#ts_web_test.name">name</a>, <a href="#ts_web_test.deps">deps</a>, <a href="#ts_web_test.data">data</a>, <a href="#ts_web_test.srcs">srcs</a>, <a href="#ts_web_test.bootstrap">bootstrap</a>)</pre>
+
+          
+
+          <h3 id="ts_web_test_args">Attributes</h3>
+
+<table class="params-table">
+  <colgroup>
+    <col class="col-param" />
+    <col class="col-description" />
+  </colgroup>
+  <tbody>
+    <tr id="ts_web_test.name">
+      <td><code>name</code></td>
+      <td>
+        <p><code><a href="https://bazel.build/docs/build-ref.html#name">Name</a>; Required</code></p>
+        <p>A unique name for this rule.</p>
+      </td>
+    </tr>
+    <tr id="ts_web_test.deps">
+      <td><code>deps</code></td>
+      <td>
+        <p><code>List of <a href="https://bazel.build/docs/build-ref.html#labels">labels</a>; Optional; Default is []</code></p>
+        <p>Other targets which produce JavaScript such as <code>ts_library</code></p>
+      </td>
+    </tr>
+    <tr id="ts_web_test.data">
+      <td><code>data</code></td>
+      <td>
+        <p><code>List of <a href="https://bazel.build/docs/build-ref.html#labels">labels</a>; Optional; Default is []</code></p>
+        <p>Runtime dependencies</p>
+      </td>
+    </tr>
+    <tr id="ts_web_test.srcs">
+      <td><code>srcs</code></td>
+      <td>
+        <p><code>List of <a href="https://bazel.build/docs/build-ref.html#labels">labels</a>; Optional; Default is []</code></p>
+        <p>JavaScript source files</p>
+      </td>
+    </tr>
+    <tr id="ts_web_test.bootstrap">
+      <td><code>bootstrap</code></td>
+      <td>
+        <p><code>List of <a href="https://bazel.build/docs/build-ref.html#labels">labels</a>; Optional; Default is []</code></p>
+        <p>JavaScript files to include <em>before</em> the module loader (require.js).
+            For example, you can include Reflect,js for TypeScript decorator metadata reflection,
+            or UMD bundles for third-party libraries.</p>
+      </td>
+    </tr>
+  </tbody>
+</table>
+
+
+        </div>
+
+        <footer class="mdl-mini-footer">
+          <div class="mdl-mini-footer__left-section">
+            <div class="mdl-logo">Bazel</div>
+            <ul class="mdl-mini-footer__link-list">
+              <li><a href="https://bazel.build">Home</a></li>
+              <li><a href="https://github.com/bazelbuild">GitHub</a></li>
+            </ul>
+          </div>
+        </footer>
+      </main>
+    </div>
+  </body>
+</html>
diff --git a/docs/api/main.css b/docs/api/main.css
new file mode 100755
index 0000000..1b2ce72
--- /dev/null
+++ b/docs/api/main.css
@@ -0,0 +1,3 @@
+body{background-color:#fafafa}pre,code{font-family:'Liberation Mono', Consolas, Monaco, 'Andale Mono', monospace}pre{background-color:#eee;padding:20px;overflow-x:auto;word-wrap:normal}pre code{overflow-wrap:normal;white-space:pre}code{display:inline-block;font-size:90%;white-space:pre-wrap}.mdl-layout__drawer{background-color:#fff}.mdl-layout__drawer .mdl-layout-title{border-bottom:1px solid #e0e0e0;padding-left:24px}.drawer-nav ul{list-style:none;padding-left:0}.drawer-nav ul li{display:block;padding:0}.drawer-nav ul li ul li a{padding-left:44px;font-weight:400}.drawer-nav ul li a{display:block;flex-shrink:0;padding:15px 0 15px 22px;margin:0;font-weight:600;color:#757575;line-height:1em;text-decoration:none;cursor:pointer}.drawer-nav ul li a:active,.drawer-nav ul li a:hover{background-color:#f0f0f0}.drawer-nav ul li.active a{color:#4caf50;font-weight:500}h1.page-title{font-size:34px;font-weight:400;line-height:40px;margin-bottom:30px;color:#4caf50}p.lead{font-size:20px;line-height:32px}table{border-collapse:collapse;border-spacing:0;background-color:#fff;table-layout:auto}table thead th{background-color:#fafafa;border:1px solid #eee;color:#757575;padding:12px 12px 12px 24px;vertical-align:top}table tbody td{border:1px solid #eee;padding:12px 12px 12px 24px;vertical-align:top}table.params-table{width:100%}table.params-table col.col-param{width:25%}table.params-table col.col-description{width:75%}table.overview-table{width:100%}table.overview-table col.col-name{width:25%}table.overview-table col.col-description{width:75%}table.overview-table td p{margin:0}hr{margin-top:40px;margin-bottom:40px}nav.toc{border-left:5px solid #4caf50;padding-left:20px;margin-bottom:48px}nav.toc h1,nav.toc h2{font-size:15px;line-height:16px;padding-bottom:12px;margin-bottom:0;font-weight:400;color:#757575}nav.toc ul{list-style:none;margin-top:0;padding-left:0}nav.toc ul li{font-size:20px;line-height:40px}nav.toc ul li a{color:#4caf50}.page-content{margin-left:auto;margin-right:auto;padding-top:60px;padding-bottom:60px;width:760px}.page-content a{text-decoration:none}.page-content h1{font-size:34px;font-weight:400;line-height:40px;margin-bottom:30px;color:#4caf50}.page-content h2{font-size:24px;font-weight:400;line-height:32px;margin-bottom:30px;color:#4caf50}.page-content h3{font-size:20px;font-weight:400;line-height:32px;margin-bottom:30px;color:#4caf50}@media (max-width: 768px){.page-content{width:360px}}@media (min-width: 768px){.page-content{width:760px}}@media (min-width: 1476px){.page-content{width:1160px}}.mdl-mini-footer{padding-left:40px}
+
+/*# sourceMappingURL=main.css.map */
\ No newline at end of file
diff --git a/docs/api/ts_config.html b/docs/api/ts_config.html
new file mode 100644
index 0000000..a454867
--- /dev/null
+++ b/docs/api/ts_config.html
@@ -0,0 +1,155 @@
+
+
+<!--
+Documentation generated by Skydoc
+-->
+<!DOCTYPE html>
+<html>
+  <head>
+    <meta charset="utf-8">
+    <meta name="viewport" content="width=device-width initial-scale=1" />
+    <meta http-equiv="X-UA-Compatible" content="IE=edge">
+
+    <title>Multiple tsconfig.json files</title>
+
+    <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,600,700" type="text/css">
+    <link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
+    <link rel="stylesheet" href="https://code.getmdl.io/1.1.1/material.green-light_blue.min.css">
+    <script defer src="https://code.getmdl.io/1.1.1/material.min.js"></script>
+    <link rel="stylesheet" href="/rules_typescript/api/main.css">
+  </head>
+  <body>
+    <div class="mdl-layout mdl-js-layout mdl-layout--fixed-drawer
+      mdl-layout--fixed-header">
+      <header class="mdl-layout__header">
+        <div class="mdl-layout__header-row">
+          <span class="mdl-layout-title">Multiple tsconfig.json files</span>
+        </div>
+      </header>
+      <div class="mdl-layout__drawer">
+        <span class="mdl-layout-title">Bazel</span>
+        <nav class="drawer-nav">
+          <ul class="drawer-nav">
+            
+<li><a href="/rules_typescript/api/index.html">Overview</a></li>
+<li>
+  <a href="/rules_typescript/api/build_defs.html">TypeScript compilation</a>
+  <ul>
+    <li>
+      <a href="/rules_typescript/api/build_defs.html#ts_library">
+        ts_library
+      </a>
+    </li>
+  </ul>
+</li>
+<li>
+  <a href="/rules_typescript/api/ts_repositories.html">Install toolchain dependencies</a>
+  <ul>
+  </ul>
+</li>
+<li>
+  <a href="/rules_typescript/api/ts_config.html">Multiple tsconfig.json files</a>
+  <ul>
+    <li>
+      <a href="/rules_typescript/api/ts_config.html#ts_config">
+        ts_config
+      </a>
+    </li>
+  </ul>
+</li>
+<li>
+  <a href="/rules_typescript/api/devserver/ts_devserver.html">Simple development server</a>
+  <ul>
+    <li>
+      <a href="/rules_typescript/api/devserver/ts_devserver.html#ts_devserver">
+        ts_devserver
+      </a>
+    </li>
+  </ul>
+</li>
+<li>
+  <a href="/rules_typescript/api/karma/ts_web_test.html">Unit testing in Chrome</a>
+  <ul>
+    <li>
+      <a href="/rules_typescript/api/karma/ts_web_test.html#ts_web_test">
+        ts_web_test
+      </a>
+    </li>
+  </ul>
+</li>
+
+          </ul>
+        </nav>
+      </div>
+
+      <main class="mdl-layout__content">
+        <div class="page-content">
+          <h1>Multiple tsconfig.json files</h1>
+
+<nav class="toc">
+  <h2>Rules</h2>
+  <ul>
+    <li><a href="#ts_config">ts_config</a></li>
+  </ul>
+</nav>
+          <hr>
+
+          <h2 id="ts_config">ts_config</h2>
+
+          <pre>ts_config(<a href="#ts_config.name">name</a>, <a href="#ts_config.deps">deps</a>, <a href="#ts_config.src">src</a>)</pre>
+
+          <p>Allows a tsconfig.json file to extend another file.</p>
+<p>Normally, you just give a single <code>tsconfig.json</code> file as the tsconfig attribute
+of a <code>ts_library</code> rule. However, if your <code>tsconfig.json</code> uses the <code>extends</code>
+feature from TypeScript, then the Bazel implementation needs to know about that
+extended configuration file as well, to pass them both to the TypeScript compiler.</p>
+
+
+          <h3 id="ts_config_args">Attributes</h3>
+
+<table class="params-table">
+  <colgroup>
+    <col class="col-param" />
+    <col class="col-description" />
+  </colgroup>
+  <tbody>
+    <tr id="ts_config.name">
+      <td><code>name</code></td>
+      <td>
+        <p><code><a href="https://bazel.build/docs/build-ref.html#name">Name</a>; Required</code></p>
+        <p>A unique name for this rule.</p>
+      </td>
+    </tr>
+    <tr id="ts_config.deps">
+      <td><code>deps</code></td>
+      <td>
+        <p><code>List of <a href="https://bazel.build/docs/build-ref.html#labels">labels</a>; Required</code></p>
+        <p>Additional tsconfig.json files referenced via extends</p>
+      </td>
+    </tr>
+    <tr id="ts_config.src">
+      <td><code>src</code></td>
+      <td>
+        <p><code><a href="https://bazel.build/docs/build-ref.html#labels">Label</a>; Required</code></p>
+        <p>The tsconfig.json file passed to the TypeScript compiler</p>
+      </td>
+    </tr>
+  </tbody>
+</table>
+
+
+        </div>
+
+        <footer class="mdl-mini-footer">
+          <div class="mdl-mini-footer__left-section">
+            <div class="mdl-logo">Bazel</div>
+            <ul class="mdl-mini-footer__link-list">
+              <li><a href="https://bazel.build">Home</a></li>
+              <li><a href="https://github.com/bazelbuild">GitHub</a></li>
+            </ul>
+          </div>
+        </footer>
+      </main>
+    </div>
+  </body>
+</html>
diff --git a/docs/api/ts_repositories.html b/docs/api/ts_repositories.html
new file mode 100644
index 0000000..014bf33
--- /dev/null
+++ b/docs/api/ts_repositories.html
@@ -0,0 +1,122 @@
+
+
+<!--
+Documentation generated by Skydoc
+-->
+<!DOCTYPE html>
+<html>
+  <head>
+    <meta charset="utf-8">
+    <meta name="viewport" content="width=device-width initial-scale=1" />
+    <meta http-equiv="X-UA-Compatible" content="IE=edge">
+
+    <title>Install toolchain dependencies</title>
+
+    <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,600,700" type="text/css">
+    <link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
+    <link rel="stylesheet" href="https://code.getmdl.io/1.1.1/material.green-light_blue.min.css">
+    <script defer src="https://code.getmdl.io/1.1.1/material.min.js"></script>
+    <link rel="stylesheet" href="/rules_typescript/api/main.css">
+  </head>
+  <body>
+    <div class="mdl-layout mdl-js-layout mdl-layout--fixed-drawer
+      mdl-layout--fixed-header">
+      <header class="mdl-layout__header">
+        <div class="mdl-layout__header-row">
+          <span class="mdl-layout-title">Install toolchain dependencies</span>
+        </div>
+      </header>
+      <div class="mdl-layout__drawer">
+        <span class="mdl-layout-title">Bazel</span>
+        <nav class="drawer-nav">
+          <ul class="drawer-nav">
+            
+<li><a href="/rules_typescript/api/index.html">Overview</a></li>
+<li>
+  <a href="/rules_typescript/api/build_defs.html">TypeScript compilation</a>
+  <ul>
+    <li>
+      <a href="/rules_typescript/api/build_defs.html#ts_library">
+        ts_library
+      </a>
+    </li>
+  </ul>
+</li>
+<li>
+  <a href="/rules_typescript/api/ts_repositories.html">Install toolchain dependencies</a>
+  <ul>
+  </ul>
+</li>
+<li>
+  <a href="/rules_typescript/api/ts_config.html">Multiple tsconfig.json files</a>
+  <ul>
+    <li>
+      <a href="/rules_typescript/api/ts_config.html#ts_config">
+        ts_config
+      </a>
+    </li>
+  </ul>
+</li>
+<li>
+  <a href="/rules_typescript/api/devserver/ts_devserver.html">Simple development server</a>
+  <ul>
+    <li>
+      <a href="/rules_typescript/api/devserver/ts_devserver.html#ts_devserver">
+        ts_devserver
+      </a>
+    </li>
+  </ul>
+</li>
+<li>
+  <a href="/rules_typescript/api/karma/ts_web_test.html">Unit testing in Chrome</a>
+  <ul>
+    <li>
+      <a href="/rules_typescript/api/karma/ts_web_test.html#ts_web_test">
+        ts_web_test
+      </a>
+    </li>
+  </ul>
+</li>
+
+          </ul>
+        </nav>
+      </div>
+
+      <main class="mdl-layout__content">
+        <div class="page-content">
+          <h1>Install toolchain dependencies</h1>
+
+<nav class="toc">
+  <h2>Macros</h2>
+  <ul>
+    <li><a href="#ts_setup_workspace">ts_setup_workspace</a></li>
+  </ul>
+</nav>
+          <hr>
+
+          <h2 id="ts_setup_workspace">ts_setup_workspace</h2>
+
+          <pre>ts_setup_workspace()</pre>
+
+          <p>This repository rule should be called from your WORKSPACE file.
+It creates some additional Bazel external repositories that are used internally
+by the TypeScript rules.</p>
+
+
+
+
+        </div>
+
+        <footer class="mdl-mini-footer">
+          <div class="mdl-mini-footer__left-section">
+            <div class="mdl-logo">Bazel</div>
+            <ul class="mdl-mini-footer__link-list">
+              <li><a href="https://bazel.build">Home</a></li>
+              <li><a href="https://github.com/bazelbuild">GitHub</a></li>
+            </ul>
+          </div>
+        </footer>
+      </main>
+    </div>
+  </body>
+</html>
diff --git a/internal/BUILD.bazel b/internal/BUILD.bazel
index d2d76af..e17ec48 100644
--- a/internal/BUILD.bazel
+++ b/internal/BUILD.bazel
@@ -16,7 +16,11 @@
 
 package(default_visibility = ["//visibility:public"])
 
-exports_files(["worker_protocol.proto"])
+exports_files([
+    "worker_protocol.proto",
+    # Exported to be consumed for generating skydoc.
+    "build_defs.bzl", "ts_config.bzl", "ts_repositories.bzl",
+])
 
 load("//internal:build_defs.bzl", "ts_library")
 load("@build_bazel_rules_nodejs//:defs.bzl", "nodejs_binary", "jasmine_node_test")
diff --git a/internal/build_defs.bzl b/internal/build_defs.bzl
index 673cc50..359bd38 100644
--- a/internal/build_defs.bzl
+++ b/internal/build_defs.bzl
@@ -12,12 +12,11 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-"""TypeScript rules.
-"""
+"TypeScript compilation"
+
 # pylint: disable=unused-argument
 # pylint: disable=missing-docstring
 load(":common/compilation.bzl", "COMMON_ATTRIBUTES", "compile_ts", "ts_providers_dict_to_struct")
-load(":executables.bzl", "get_tsc")
 load(":common/tsconfig.bzl", "create_tsconfig")
 load(":ts_config.bzl", "TsConfigInfo")
 
@@ -158,27 +157,35 @@
 ts_library = rule(
     _ts_library_impl,
     attrs = dict(COMMON_ATTRIBUTES, **{
-        "srcs":
-            attr.label_list(
-                allow_files=FileType([
-                    ".ts",
-                    ".tsx",
-                ]),
-                mandatory=True,),
+        "srcs": attr.label_list(
+            doc = "The TypeScript source files to compile.",
+            allow_files = [".ts", ".tsx"],
+            mandatory = True),
 
         # TODO(alexeagle): reconcile with google3: ts_library rules should
         # be portable across internal/external, so we need this attribute
         # internally as well.
-        "tsconfig":
-            attr.label(allow_files = True, single_file = True),
-        "compiler":
-            attr.label(
-                default=get_tsc(),
-                single_file=False,
-                allow_files=True,
-                executable=True,
-                cfg="host"),
-        "supports_workers": attr.bool(default = True),
+        "tsconfig": attr.label(
+            doc = """A tsconfig.json file containing settings for TypeScript compilation.
+            Note that some properties in the tsconfig are governed by Bazel and will be
+            overridden, such as `target` and `module`.""",
+            allow_files = True, single_file = True),
+        "compiler": attr.label(
+            doc = """Intended for internal use only.
+            Sets a different TypeScript compiler binary to use for this library.
+            For example, we use the vanilla TypeScript tsc.js for bootstrapping,
+            and Angular compilations can replace this with `ngc`.""",
+            default = Label("//internal:tsc_wrapped_bin"),
+            single_file = False,
+            allow_files = True,
+            executable = True,
+            cfg = "host"),
+        "supports_workers": attr.bool(
+            doc = """Intended for internal use only.
+            Allows you to disable the Bazel Worker strategy for this library.
+            Typically used together with the "compiler" setting when using a
+            non-worker aware compiler binary.""",
+            default = True),
         "tsickle_typed": attr.bool(default = True),
         "internal_testing_type_check_dependencies": attr.bool(default = False, doc="Testing only, whether to type check inputs that aren't srcs."),
         "_tsc_wrapped_deps": attr.label(default = Label("@build_bazel_rules_typescript_tsc_wrapped_deps//:node_modules")),
@@ -191,3 +198,9 @@
         "tsconfig": "%{name}_tsconfig.json"
     }
 )
+"""
+`ts_library` type-checks and compiles a set of TypeScript sources to JavaScript.
+
+It produces declarations files (`.d.ts`) which are used for compiling downstream
+TypeScript targets and JavaScript for the browser and Closure compiler.
+"""
diff --git a/internal/devserver/BUILD b/internal/devserver/BUILD
index 34e9fc1..ed145a7 100644
--- a/internal/devserver/BUILD
+++ b/internal/devserver/BUILD
@@ -18,6 +18,11 @@
     "//third_party/bazel_rules/rules_typescript/internal:__subpackages__",
 ])
 
+exports_files([
+    # Exported to be consumed for generating skydoc.
+    "ts_devserver.bzl",
+])
+
 filegroup(
     name = "source_tree",
     srcs = [
diff --git a/internal/devserver/ts_devserver.bzl b/internal/devserver/ts_devserver.bzl
index 4cceb1a..ba60c33 100644
--- a/internal/devserver/ts_devserver.bzl
+++ b/internal/devserver/ts_devserver.bzl
@@ -12,10 +12,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-"""The ts_devserver rule brings up our "getting started" devserver.
-
-See the README.md.
-"""
+"Simple development server"
 
 load("@build_bazel_rules_nodejs//internal:node.bzl",
     "sources_aspect",
@@ -102,15 +99,27 @@
 ts_devserver = rule(
     implementation = _ts_devserver,
     attrs = {
-        "deps": attr.label_list(allow_files = True, aspects = [sources_aspect]),
-        "serving_path": attr.string(),
-        "data": attr.label_list(allow_files = True, cfg = "data"),
-        "static_files": attr.label_list(allow_files = True),
-        # User scripts for the devserver to concat before the source files
-        "scripts": attr.label_list(allow_files = True),
-        # The entry_module should be the AMD module name of the entry module such as "__main__/src/index"
-        # Devserver concats the following snippet after the bundle to load the application: require(["entry_module"]);
-        "entry_module": attr.string(),
+        "deps": attr.label_list(
+            doc = "Targets that produce JavaScript, such as `ts_library`",
+            allow_files = True, aspects = [sources_aspect]),
+        "serving_path": attr.string(
+            doc = """The path you can request from the client HTML which serves the JavaScript bundle.
+            If you don't specify one, the JavaScript can be loaded at /_/ts_scripts.js"""),
+        "data": attr.label_list(
+            doc = "Dependencies that can be require'd while the server is running",
+            allow_files = True, cfg = "data"),
+        "static_files": attr.label_list(
+            doc = """Arbitrary files which to be served, such as index.html.
+            They are served relative to the package where this rule is declared.""",
+            allow_files = True),
+        "scripts": attr.label_list(
+            doc = "User scripts to include in the JS bundle before the application sources",
+            allow_files = [".js"]),
+        "entry_module": attr.string(
+            doc = """The entry_module should be the AMD module name of the entry module such as `"__main__/src/index"`
+            ts_devserver concats the following snippet after the bundle to load the application:
+            `require(["entry_module"]);`
+            """),
         "_requirejs_script": attr.label(allow_files = True, single_file = True, default = Label("@build_bazel_rules_typescript_devserver_deps//:node_modules/requirejs/require.js")),
         "_devserver": attr.label(
             default = Label("//internal/devserver/main"),
@@ -124,8 +133,24 @@
     },
     executable = True,
 )
+"""ts_devserver is a simple development server intended for a quick "getting started" experience.
+
+Additional documentation at https://github.com/alexeagle/angular-bazel-example/wiki/Running-a-devserver-under-Bazel
+"""
 
 def ts_devserver_macro(tags = [], **kwargs):
+  """ibazel wrapper for `ts_devserver`
+
+  This macro re-exposes the `ts_devserver` rule with some extra tags so that
+  it behaves correctly under ibazel.
+
+  This is re-exported in `//:defs.bzl` as `ts_devserver` so if you load the rule
+  from there, you actually get this macro.
+
+  Args:
+    tags: standard Bazel tags, this macro adds a couple for ibazel
+    **kwargs: passed through to `ts_devserver`
+  """
   ts_devserver(
       # Users don't need to know that these tags are required to run under ibazel
       tags = tags + [
diff --git a/internal/executables.bzl b/internal/executables.bzl
deleted file mode 100644
index e83baa2..0000000
--- a/internal/executables.bzl
+++ /dev/null
@@ -1,19 +0,0 @@
-# Copyright 2017 The Bazel Authors. All rights reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#    http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-"""TypeScript compiler label.
-"""
-
-def get_tsc():
-  return Label("//internal:tsc_wrapped_bin")
diff --git a/internal/karma/BUILD.bazel b/internal/karma/BUILD.bazel
index 07e5c52..9d36fed 100644
--- a/internal/karma/BUILD.bazel
+++ b/internal/karma/BUILD.bazel
@@ -1,6 +1,11 @@
 package(default_visibility=["//visibility:public"])
 
-exports_files(["test-main.js", "karma.conf.js"])
+exports_files([
+    "test-main.js",
+    "karma.conf.js",
+    # Exported to be consumed for generating skydoc.
+    "ts_web_test.bzl",
+])
 
 load("@build_bazel_rules_typescript//:defs.bzl", "ts_library")
 
diff --git a/internal/karma/ts_web_test.bzl b/internal/karma/ts_web_test.bzl
index bf0d6ce..6efba84 100644
--- a/internal/karma/ts_web_test.bzl
+++ b/internal/karma/ts_web_test.bzl
@@ -11,7 +11,7 @@
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
-"""Implementation of the ts_web_test rule."""
+"Unit testing in Chrome"
 
 load("@build_bazel_rules_nodejs//internal:node.bzl",
     "sources_aspect",
@@ -128,15 +128,23 @@
     implementation = _ts_web_test_impl,
     test = True,
     attrs = {
-        "srcs": attr.label_list(allow_files = ["js"]),
+        "srcs": attr.label_list(
+            doc = "JavaScript source files",
+            allow_files = [".js"]),
         "deps": attr.label_list(
-          allow_files = True,
-          aspects = [sources_aspect],
+            doc = "Other targets which produce JavaScript such as `ts_library`",
+            allow_files = True,
+            aspects = [sources_aspect],
         ),
         "bootstrap": attr.label_list(
-            allow_files = True,
+            doc = """JavaScript files to include *before* the module loader (require.js).
+            For example, you can include Reflect,js for TypeScript decorator metadata reflection,
+            or UMD bundles for third-party libraries.""",
+            allow_files = [".js"],
         ),
-        "data": attr.label_list(cfg = "data"),
+        "data": attr.label_list(
+            doc = "Runtime dependencies",
+            cfg = "data"),
         "_karma": attr.label(
             default = Label("//internal/karma:karma_bin"),
             executable = True,
@@ -152,6 +160,20 @@
 # This macro exists only to modify the users rule definition a bit.
 # DO NOT add composition of additional rules here.
 def ts_web_test_macro(tags = [], data = [], **kwargs):
+  """ibazel wrapper for `ts_web_test`
+
+  This macro re-exposes the `ts_web_test` rule with some extra tags so that
+  it behaves correctly under ibazel.
+
+  This is re-exported in `//:defs.bzl` as `ts_web_test` so if you load the rule
+  from there, you actually get this macro.
+
+  Args:
+    tags: standard Bazel tags, this macro adds a couple for ibazel
+    data: runtime dependencies
+    **kwargs: passed through to `ts_web_test`
+  """
+
   ts_web_test(
       tags = tags + [
           # Users don't need to know that this tag is required to run under ibazel
diff --git a/internal/ts_config.bzl b/internal/ts_config.bzl
index bc0c9ec..95d5cbe 100644
--- a/internal/ts_config.bzl
+++ b/internal/ts_config.bzl
@@ -12,8 +12,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-"""The ts_config rule allows users to express tsconfig.json file groups.
-"""
+"tsconfig.json files using extends"
 
 TsConfigInfo = provider()
 
@@ -25,7 +24,18 @@
 ts_config = rule(
     implementation = _ts_config_impl,
     attrs = {
-      "src": attr.label(allow_files = True, single_file = True, mandatory = True),
-      "deps": attr.label_list(allow_files = True, mandatory = True),
+      "src": attr.label(
+          doc = """The tsconfig.json file passed to the TypeScript compiler""",
+          allow_single_file = True, mandatory = True),
+      "deps": attr.label_list(
+          doc = """Additional tsconfig.json files referenced via extends""",
+          allow_files = True, mandatory = True),
     },
 )
+"""Allows a tsconfig.json file to extend another file.
+
+Normally, you just give a single `tsconfig.json` file as the tsconfig attribute
+of a `ts_library` rule. However, if your `tsconfig.json` uses the `extends`
+feature from TypeScript, then the Bazel implementation needs to know about that
+extended configuration file as well, to pass them both to the TypeScript compiler.
+"""
diff --git a/internal/ts_repositories.bzl b/internal/ts_repositories.bzl
index 79d6c8e..ac89e7d 100644
--- a/internal/ts_repositories.bzl
+++ b/internal/ts_repositories.bzl
@@ -12,12 +12,16 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-"""The ts_setup_workspace rule installs build-time dependencies.
-"""
+"Install toolchain dependencies"
 
 load("@build_bazel_rules_nodejs//:defs.bzl", "yarn_install")
 
 def ts_setup_workspace():
+  """This repository rule should be called from your WORKSPACE file.
+
+  It creates some additional Bazel external repositories that are used internally
+  by the TypeScript rules.
+  """
   yarn_install(
       name = "build_bazel_rules_typescript_tsc_wrapped_deps",
       package_json = "@build_bazel_rules_typescript//internal:tsc_wrapped/package.json",
diff --git a/package.json b/package.json
index 41a0693..126920e 100644
--- a/package.json
+++ b/package.json
@@ -29,6 +29,7 @@
         "pretest": "webdriver-manager update && bazel build examples/app:all",
         "test": "concurrently \"bazel run examples/app:devserver\" protractor --kill-others --success first",
         "preskylint": "bazel build --noshow_progress @io_bazel//src/tools/skylark/java/com/google/devtools/skylark/skylint:Skylint",
-        "skylint": "find . -type f -name \"*.bzl\" ! -path \"*/node_modules/*\" | xargs $(bazel info bazel-bin)/external/io_bazel/src/tools/skylark/java/com/google/devtools/skylark/skylint/Skylint"
+        "skylint": "find . -type f -name \"*.bzl\" ! -path \"*/node_modules/*\" | xargs $(bazel info bazel-bin)/external/io_bazel/src/tools/skylark/java/com/google/devtools/skylark/skylint/Skylint",
+        "skydoc": "bazel build //:docs && unzip -o -d docs/api bazel-bin/docs-skydoc.zip"
     }
 }