daml/docs
Moritz Kiefer adb1f0e716
Split up docs postprocessing & release in split-release (#12176)
* Split up docs postprocessing & release in split-release

Follow up to #12172

The buld in the separate assembly should now only have to run the
sphinx-build step and then merge it with the non sphinx sources and
run lualatex on the pdf sources with the pdf fonts which is hopefully
simple enough that we can easily replicate it.

changelog_begin
changelog_end

* .

changelog_begin
changelog_end

* .

changelog_begin
changelog_end
2021-12-17 11:22:16 +01:00
..
configs Refactor docs build (#12172) 2021-12-16 15:37:21 +00:00
scripts [DPP-771][Error codes] Add readme.md and supplement docs with a concrete error handling example. (#11990) 2021-12-08 13:09:21 +01:00
source Get rid of deprecated components (#12167) 2021-12-16 16:55:19 +00:00
theme Fix a docs display issue with Safari and Firefox (#12035) 2021-12-13 13:25:00 +01:00
.gitignore [DPP-762][Self-service error codes] Automate generation of inventory of error categories. #11879 2021-11-26 10:22:14 +01:00
BUILD.bazel Split up docs postprocessing & release in split-release (#12176) 2021-12-17 11:22:16 +01:00
daml-intro-7.yaml Turn package name & version warnings into an error (#11859) 2021-11-26 18:46:33 +00:00
error.html update copyright notices for 2021 (#8257) 2021-01-01 19:49:51 +01:00
README.md [Self-service error codes] Small fixes for docs/scripts/live-preview.sh (#11856) 2021-11-24 19:23:06 +01:00
redirect_template.html update copyright notices for 2021 (#8257) 2021-01-01 19:49:51 +01:00
redirects.map move e2e testing to app-dev (#10479) 2021-08-05 11:28:46 +02:00

Daml 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.

  • Don't insert line-breaks inside inline literals. Building preview will treat this as an error.

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,
  • error codes inventory.

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