daml/docs
Moritz Kiefer 29ac82ae1c
Make hijacked docs links update the location hash (#4535)
If you click on a section title, we hijack the link to animate
it. However, we did not update the location hash. This makes it quite
annoying to copy links to a specific section.

This PR sets the jquery animate callback to update the hash as
well. I’ve also included a small fix for the link on the section title
which previously produced an error in the JS console since "#" is not
a valid jquery selector.

changelog_begin
changelog_end
2020-02-17 10:32:25 +01:00
..
configs daml2ts : Explain DAML/TypeScript mappings (#4196) 2020-01-27 12:25:13 -05:00
scripts update copyright notices to 2020 (#3939) 2020-01-02 21:21:13 +01:00
source json-api: add live-data boundary marker to WS contract streams (#4465) 2020-02-14 10:41:41 -05:00
theme Make hijacked docs links update the location hash (#4535) 2020-02-17 10:32:25 +01:00
.gitignore Full documentation for the new assistant (#740) 2019-05-13 16:33:59 +00:00
BUILD.bazel docs cron: more reliable checksums (#4102) 2020-01-20 16:21:34 +01:00
error.html update copyright notices to 2020 (#3939) 2020-01-02 21:21:13 +01:00
README.md JSON API documentation update (#4173) 2020-01-23 14:54:12 -05:00
redirect_template.html update copyright notices to 2020 (#3939) 2020-01-02 21:21:13 +01:00
redirects.map add redirect for getting started guide (#4451) 2020-02-10 13:30:27 +01:00

DAML SDK documentation

This directory contains all of the documentation that gets published to docs.daml.com.

Writing documentation

The docs are written in reStructuredText, built using Sphinx.

To edit documentation:

  • Same as code: find the file, edit it on a branch, make a PR.

  • For new files, best to copy existing ones, to get the formatting right.

    Don't forget you need to add your file to the toctree in /docs/source/index.rst and /docs/configs/pdf/index.rst.

  • Make sure you preview before you push.

Generated documentation

Not all of our docs are in rst files: some get generated. They are:

  • the ledger API proto docs
  • the DAML standard library reference
  • the Java bindings reference

To edit those docs, edit the content inside the code source.

Previewing

To preview the full docs, as deployed to docs.daml.com, run scripts/preview.sh.

To live-preview the docs, run scripts/live-preview.sh. The script accepts two flags:

  • --pdf includes the PDF documentation
  • --gen includes the generated documentation

Note that neither PDF, nor generated docs will benefit from live updates. To update generated docs or PDF docs, quit the preview script with CTRL+C and start it again.

Style conventions

For terminology and other style questions, follow the main DA documentation style guide.

A few pieces of RST guidance:

If youre not familiar, its really worth reading the primer for the basic syntax (emphasis, code text, lists, tables, images, comments, etc).

  • Keep paragraphs all on the same line (no newlines/line breaks).

  • Heading underlines in this hierarchical order:

    ######
    ******
    ======
    ------
    ^^^^^^
    """"""
    
  • For internal links, use the doc directive where you can.

  • For bullet points (unordered lists), use - (dashes).

  • For code blocks, use the literalinclude directive if you can: it's best to source code from files that we test whether they compile.

How the docs get built

The docs get built as part of the main daml repo CI, to make sure we don't break any links or do anything else that would cause Sphinx warnings.

Publishing docs

Documentation is published automatically whenever a release is made public on Github. Note that there is a delay so you might have to wait up to an hour until the docs are published after making a release public.

Testing code in docs

TBD