Documentation

Learn how to create and host a documentation website.

Overview of documentation

dbt provides the option to render documentation as a website.

Press + to interact
Documentation home page
Documentation home page

The website includes useful features, such as compiled SQL:

Press + to interact
Documentation of a model's code
Documentation of a model's code

We can also give dbt descriptions for our models and tables:

Press + to interact
Documentation of a model's columns
Documentation of a model's columns

How to set up documentation

To set up documentation, we need to create some property files and run a series of commands to host our website.

Property files

When setting up documentation, it’s recommended to set up some descriptions in a property file.

Press + to interact
version: 2
models:
- name: orders
description: This table contains orders.
columns:
- name: order_id
description: This is the unique identifier of an order.
- name: customer_id
description: This is the unique identifier of a customer.
- name: customers
columns:
- name: product_id
description: This is the unique identifier of a product.
- name: order_status
description: The current status of an order.

Here, we set up a ...