Using html in dbt docs

The problem I’m having

I’d like to be able to implement some html functionality within the generated dbt docs. I found this post on the dbt website, but couldn’t get much/any of the elements to work (I’m assuming it is restricted to dbt cloud?).

The context of why I’m trying to do this

I’m working on filling out a lot of our documentation, and I’m looking to add/utilize some functionality that would be helpful for our analysts that use the data daily, such as:

  • Wide table with a few rows as a data sample
    • Right now, if there are too many columns, the table extends past the About block in the docs
  • Include tabs with SQL queries that would help users with some simple EDA

What I’ve already tried

  • Directly including html tags → these get parsed directly as plain text

Hey @rmcilrai,

These are components for use in the docs.getdbt.com website (i.e. the documentation on how to develop with dbt), not the static dbt-docs project (the documentation about your database and models). We know it’s a confusing name overlap :persevere:

We removed a lot of raw HTML rendering around dbt Core v1.0, to avoid some XSS security issues: enabled marked sanitization by iknox-fa · Pull Request #227 · dbt-labs/dbt-docs · GitHub

Because of this, I don’t think there’s anything you can do to style tables etc outside of what’s exposed in markdown.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.