Skip to content

Commit

Permalink
lanugage:docs: include generated docs on docs.daml.com (digital-asset…
Browse files Browse the repository at this point in the history
…#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
  • Loading branch information
Robin Krom authored Mar 10, 2020
1 parent 6f59832 commit 8fe497e
Show file tree
Hide file tree
Showing 8 changed files with 62 additions and 0 deletions.
11 changes: 11 additions & 0 deletions docs/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ("""
Expand Down Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions docs/source/app-dev/bindings-ts/daml-ledger.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.. Copyright (c) 2020 The DAML Authors. All rights reserved.
.. SPDX-License-Identifier: Apache-2.0
@daml/ledger
############

`@daml/ledger documentation <daml-ledger/index.html>`_

8 changes: 8 additions & 0 deletions docs/source/app-dev/bindings-ts/daml-react.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.. Copyright (c) 2020 The DAML Authors. All rights reserved.
.. SPDX-License-Identifier: Apache-2.0
@daml/react
###########

`@daml/react documentation <daml-react/index.html>`_

Empty file.
8 changes: 8 additions & 0 deletions docs/source/app-dev/bindings-ts/daml-types.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.. Copyright (c) 2020 The DAML Authors. All rights reserved.
.. SPDX-License-Identifier: Apache-2.0
@daml/types
###########

`@daml/types documentation <daml-types/index.html>`_

25 changes: 25 additions & 0 deletions docs/source/app-dev/bindings-ts/index.rst
Original file line number Diff line number Diff line change
@@ -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 <https://reactjs.org>`_ framework with the `@daml/react
<daml-react/index.html>`_ library. However, you can choose any Javascrip/Typescript based framework
and use the `@daml/ledger <daml-ledger/index.html>`_ library directly to connect and interact with a
DAML ledger via it's :ref:`HTTP JSON API <json-api>`.

The `@daml/types <daml-types/index.html>`_ library contains TypeScript data types corresponding to
primitive DAML data types, such as ``Party`` or ``Text``. It is used by the `@daml/react <daml-react/index.html>`_
and `@daml/ledger <daml-ledger/index.html>`_ libraries.

.. toctree::
:hidden:

daml-react
daml-ledger
daml-types

1 change: 1 addition & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions language-support/ts/typedoc.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 8fe497e

Please sign in to comment.