daml/docs/README.md

75 lines
2.7 KiB
Markdown
Raw Normal View History

# Daml Documentation
2019-04-04 11:33:38 +03:00
This directory contains all of the documentation that gets published to docs.daml.com.
## Writing documentation
The docs are written in [reStructuredText](http://docutils.sourceforge.net/rst.html), built using [Sphinx](http://www.sphinx-doc.org/en/master/).
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.
Check closing quotes (#7528) * Missing closing quote in docs CHANGELOG_BEGIN CHANGELOG_END * add Bash script to check missing quotes in docs CHANGELOG_BEGIN CHANGELOG_END * add whitelist * fix comment * add CI job CHANGELOG_BEGIN CHANGELOG_END * add CI job to azure pipeline * use devenv in azure-pipelines.yml Co-authored-by: Gary Verhaegen <gary.verhaegen@digitalasset.com> * remove unnecessary yml * fix quotes in Bifunctor.daml * add check to BUILD.bazel with extended whitelist * refactor: call bash script from BUILD.bazel * Revert "use devenv in azure-pipelines.yml" This reverts commit 28ab2c70fb64b80f8fabfb21696b4d7b565b215d. * Revert "add CI job to azure pipeline" This reverts commit 0eaa5188fe1cc3582600a59fb41697afb61f68f4. * filter whitelist in output too * Update docs/scripts/check-closing-quotes.sh.whitelist Co-authored-by: Bernhard Elsner <40762178+bame-da@users.noreply.github.com> * fix Bifunctor.daml quotes * Update docs/scripts/check-closing-quotes.sh.whitelist Co-authored-by: Bernhard Elsner <40762178+bame-da@users.noreply.github.com> * use ~ instead of ` for section titles * rename to allowlist * revert Bifunctor quote changes back to 3 backticks * fix filename * Remove line breaks in quotes (#7550) * remove line breaks in quotes CHANGELOG_BEGIN CHANGELOG_END * remove line breaks in quotes CHANGELOG_BEGIN CHANGELOG_END * README: avoid line breaks * merge rename * revert: use triple backticks in Bifunctor Co-authored-by: Gary Verhaegen <gary.verhaegen@digitalasset.com> Co-authored-by: Bernhard Elsner <40762178+bame-da@users.noreply.github.com>
2020-10-02 15:53:10 +03:00
- Don't insert line-breaks inside inline literals. Building preview will treat this as an error.
2019-04-04 11:33:38 +03:00
### 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
2019-04-04 11:33:38 +03:00
- 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`.
2019-04-04 11:33:38 +03:00
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.
2019-04-04 11:33:38 +03:00
### Style conventions
For terminology and other style questions, follow the [main DA documentation style guide](https://docs.google.com/document/d/1dwE45gyxWXqlr4VTq9mJVnmSyBQ8V30ItucWBbCbViQ/edit).
A few pieces of RST guidance:
2019-04-10 11:27:37 +03:00
If youre not familiar, its really worth reading the [primer](http://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html) for the basic syntax (emphasis, code text, lists, tables, images, comments, etc).
2019-04-04 11:33:38 +03:00
- 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.
2019-04-04 11:33:38 +03:00
## Testing code in docs
TBD