Set documentation structure

The problem I’m having

I’m trying to find something to help me set a better fold structure for my dbt documentation.
We are working with a lot of sources and a bunch more are expected to be included.

The context of why I’m trying to do this

This is a image of our documentation tab:

I want to achieve a structure where my sources look like this:

├── Sources
│   ├── CFO
│   │   ├── CFO Source A
│   │   ├── CFO Source B
│   ├── CTO
│   │   ├── CTO Source A
│   │   ├── CFO Source B
│   ├── CHRO
│   │   ├── CHRO Source A
│   │   ├── CHRO Source B

├── Projects
│   ├── Business_Units
│   ├── CFO
│   ├── CHRO
│   ├── CTO
│   ├── dataplatform

So I’m looking for a structure in sources where the sources itself are inside folders from its systems
And I’m also tryng to not show the packages that I’m using in Projects folder.

Any help?

Hey @leonardo200467, you’ll want to create a <name>.yml file amongst your models, following the YAML structure available in the documentation here: Add sources to your DAG | dbt Developer Hub.

For example, here I have a sources.yml file in my project. Nested under the sources: configuration I have ‘superstore_playground’ which is one set of source objects, and ‘dummy_source_file’ which is another. Under each I can then define the db/schema etc that it points towards:

Once I execute dbt docs generate and dbt docs serve, the dbt Docs that are generate will show these split out like so:

image

In your scenario, your sources file should probably look something like the following, adding other names as necessary to continue splitting them out:

version: 2

sources:
  - name: cfo
    database: db_name
    schema: schema_name
    tables:
      - name: cfo_source_a
        description: desc
      - name: cfo_source_b
        description: desc

  - name: cto
    database: db_name
    schema: schema_name
    tables:
      - name: cto_source_a
        description: desc
      - name: cto_source_b
        description: desc

  - name: chro
    database: db_name
    schema: schema_name
    tables:
      - name: chro_source_a
        description: desc
      - name: chro_source_b
        description: desc

In order to hide the packages from your documentation, you can amend the dbt_project.yml file in order to add the following for specific objects (or groups of):

docs:
  show: false

Again see dbt documentation here: docs | dbt Developer Hub