From 8fe497ea5d1e7d532bef2086579ea87a910567e4 Mon Sep 17 00:00:00 2001 From: Robin Krom Date: Tue, 10 Mar 2020 18:46:54 +0100 Subject: [PATCH] lanugage:docs: include generated docs on docs.daml.com (#4924) This includes the generated docs for the typescipt libraries daml-react, daml-ledger and daml-types in the documentation presented on docs.daml.com. Next step is to create better readmes in this libraries. CHANGELOG_BEGIN CHANGELOG_END --- docs/BUILD.bazel | 11 ++++++++ .../app-dev/bindings-ts/daml-ledger.rst | 8 ++++++ .../source/app-dev/bindings-ts/daml-react.rst | 8 ++++++ .../app-dev/bindings-ts/daml-react/test | 0 .../source/app-dev/bindings-ts/daml-types.rst | 8 ++++++ docs/source/app-dev/bindings-ts/index.rst | 25 +++++++++++++++++++ docs/source/index.rst | 1 + language-support/ts/typedoc.bzl | 1 + 8 files changed, 62 insertions(+) create mode 100644 docs/source/app-dev/bindings-ts/daml-ledger.rst create mode 100644 docs/source/app-dev/bindings-ts/daml-react.rst create mode 100644 docs/source/app-dev/bindings-ts/daml-react/test create mode 100644 docs/source/app-dev/bindings-ts/daml-types.rst create mode 100644 docs/source/app-dev/bindings-ts/index.rst diff --git a/docs/BUILD.bazel b/docs/BUILD.bazel index 7239c5290000..4605d61bc940 100644 --- a/docs/BUILD.bazel +++ b/docs/BUILD.bazel @@ -345,6 +345,9 @@ genrule( "//compiler/damlc:daml-base-rst-docs", "//compiler/damlc:daml-base-hoogle-docs", "//language-support/java:javadoc", + "//language-support/ts/daml-react:docs", + "//language-support/ts/daml-ledger:docs", + "//language-support/ts/daml-types:docs", ], outs = ["html-only.tar.gz"], cmd = (""" @@ -377,6 +380,14 @@ genrule( # Remove JAR metadata rm -r html/app-dev/bindings-java/javadocs/META-INF + # Copy generated documentation for typescript libraries + mkdir -p html/app-dev/bindings-ts/daml-react + mkdir -p html/app-dev/bindings-ts/daml-ledger + mkdir -p html/app-dev/bindings-ts/daml-types + tar -xzf ../$(location //language-support/ts/daml-react:docs) --strip-components 1 -C html/app-dev/bindings-ts/daml-react/ + tar -xzf ../$(location //language-support/ts/daml-ledger:docs) --strip-components 1 -C html/app-dev/bindings-ts/daml-ledger/ + tar -xzf ../$(location //language-support/ts/daml-types:docs) --strip-components 1 -C html/app-dev/bindings-ts/daml-types/ + # Copy in hoogle DB mkdir -p html/hoogle_db cp -rL ../$(location //compiler/damlc:daml-base-hoogle-docs) html/hoogle_db/base.txt diff --git a/docs/source/app-dev/bindings-ts/daml-ledger.rst b/docs/source/app-dev/bindings-ts/daml-ledger.rst new file mode 100644 index 000000000000..d2ff193d83cf --- /dev/null +++ b/docs/source/app-dev/bindings-ts/daml-ledger.rst @@ -0,0 +1,8 @@ +.. Copyright (c) 2020 The DAML Authors. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 + +@daml/ledger +############ + +`@daml/ledger documentation `_ + diff --git a/docs/source/app-dev/bindings-ts/daml-react.rst b/docs/source/app-dev/bindings-ts/daml-react.rst new file mode 100644 index 000000000000..7f4c862eca84 --- /dev/null +++ b/docs/source/app-dev/bindings-ts/daml-react.rst @@ -0,0 +1,8 @@ +.. Copyright (c) 2020 The DAML Authors. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 + +@daml/react +########### + +`@daml/react documentation `_ + diff --git a/docs/source/app-dev/bindings-ts/daml-react/test b/docs/source/app-dev/bindings-ts/daml-react/test new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/docs/source/app-dev/bindings-ts/daml-types.rst b/docs/source/app-dev/bindings-ts/daml-types.rst new file mode 100644 index 000000000000..cd28eefaa738 --- /dev/null +++ b/docs/source/app-dev/bindings-ts/daml-types.rst @@ -0,0 +1,8 @@ +.. Copyright (c) 2020 The DAML Authors. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 + +@daml/types +########### + +`@daml/types documentation `_ + diff --git a/docs/source/app-dev/bindings-ts/index.rst b/docs/source/app-dev/bindings-ts/index.rst new file mode 100644 index 000000000000..2a64026a3337 --- /dev/null +++ b/docs/source/app-dev/bindings-ts/index.rst @@ -0,0 +1,25 @@ +.. Copyright (c) 2020 The DAML Authors. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 + +TypeScript bindings +################### + +.. _typescript: + +The DAML TypeScript bindings are the recommended way to build a frontend for a DAML application. We +provide an integration for the `React `_ framework with the `@daml/react +`_ library. However, you can choose any Javascrip/Typescript based framework +and use the `@daml/ledger `_ library directly to connect and interact with a +DAML ledger via it's :ref:`HTTP JSON API `. + +The `@daml/types `_ library contains TypeScript data types corresponding to +primitive DAML data types, such as ``Party`` or ``Text``. It is used by the `@daml/react `_ +and `@daml/ledger `_ libraries. + +.. toctree:: + :hidden: + + daml-react + daml-ledger + daml-types + diff --git a/docs/source/index.rst b/docs/source/index.rst index f74526614270..28a934816277 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -43,6 +43,7 @@ DAML SDK documentation app-dev/app-arch app-dev/authentication app-dev/ledger-api + app-dev/bindings-ts/index app-dev/bindings-java/index app-dev/bindings-scala/index app-dev/bindings-js diff --git a/language-support/ts/typedoc.bzl b/language-support/ts/typedoc.bzl index 33a0377637ce..bcd87ff758b1 100644 --- a/language-support/ts/typedoc.bzl +++ b/language-support/ts/typedoc.bzl @@ -17,4 +17,5 @@ def ts_docs(pkg_name): $(location @language_support_ts_deps//typedoc/bin:typedoc) --out docs --ignoreCompilerErrors --readme README.md $(SRCS) tar czf $@ docs """, + visibility = ["//visibility:public"], ) if not is_windows else None