Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
JCZuurmond committed Jun 17, 2024
1 parent 37f7a76 commit d1e2d93
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
13 changes: 11 additions & 2 deletions docs/dashboards.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,17 @@ entities.

Markdown files are used to define text widgets that can populate a dashboard.

The configuration file is written in YAML, and is structured in a way that is easy to read and
write.
The configuration is defined at the top of the file in YAML enclosed by two horizontal rules marked with dashes (---):

``` yaml
---
order: -1
height: 5
---
# Churn dashboard

Welcome to our churn dashboard! Let me show you around ...
```

[[back to top](#dashboards-as-code)]

Expand Down
5 changes: 3 additions & 2 deletions tests/unit/test_dashboards.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,10 @@ def test_markdown_handler_parses_attribute_from_header(tmp_path, attribute):
assert str(header[attribute]) == "10"


def test_markdown_handler_splits_header(tmp_path):
@pytest.mark.parametrize("horizontal_rule", ["---", "--------"])
def test_markdown_handler_splits_header(tmp_path, horizontal_rule):
path = tmp_path / "widget.md"
path.write_text("---\norder: 10\n---\n# Description")
path.write_text(f"{horizontal_rule}\norder: 10\n{horizontal_rule}\n# Description")
handler = MarkdownHandler(path)

header, content = handler.split()
Expand Down

0 comments on commit d1e2d93

Please sign in to comment.