Markdown Reference

Evidence supports most markdown syntax. Below are some of the most common markdown features. For more details, check out Markdown Guide.

Text Paragraphs

This is a paragraph. It can be as long as you want.

Add line breaks by leaving a blank line between paragraphs.

Text Styles

**Bold** text is wrapped in double asterisks
_Italic_ text is wrapped in single asterisks
~~Strikethrough~~ text is wrapped in double tildes
`Inline code` is wrapped in backticks

Lists

- This is a unordered list
- It uses dashes
- To indicate items

1. This is an ordered list
1. It uses numbers to indicate order
1. The numbers you type don't matter, they will be automatically numbered

Headers

# H1 Header

## H2 Header

### H3 Header

#### H4 Header

##### H5 Header

###### H6 Header
[External link](https://google.com)

[Internal link](another/page/)

Images

![An online image](https://i.imgur.com/xyI27iZ.gif)

![An image stored in the project's static folder](/my-image.png)

Storing Images and Static Files

Evidence looks for images in the /static folder in the root of your project. Create it if it doesn't exist.

Code Fences

In Evidence, most code fences execute SQL queries and display the results in a table.

This code fence will execute a SQL query and display the results:

```sql orders
SELECT *
FROM needful_things.orders
WHERE category = 'Sinister Toys'
```

The exception is if you use one of the reserved language names, which will render the code in a code block.

```python
names = ["Alice", "Bob", "Charlie"]

for name in names:
    print("Hello, " + name)
```

```r
names <- c("Alice", "Bob", "Charlie")

for (name in names) {
    print(paste("Hello, ", name))
}
```

Tables

| Column 1 | Column 2 | Column 3 |
| -------- | -------- | -------- |
| Row 1    | Row 1    | Row 1    |
| Row 2    | Row 2    | Row 2    |

To display data in a table, use a Data Table instead.

Blockquotes

> This is a blockquote
>
> It can span multiple lines
>
> > And can be nested

Frontmatter

To attach metadata (e.g. a title) to your page, you can use Frontmatter. Note that frontmatter must appear as the first thing in your page; no content can come before it, or it won't be loaded properly.

Frontmatter is formatted like this:

---
title: Evidence Docs
---

You can put whatever data you would like here, and it uses a yaml syntax, but some properties are special:

Changes the name of the tab, the title displayed in the sidebar, adds a header to your page, and changes the breadcrumb for the page.
If true, the title will not show as a header on the page
Options:
Is used for search engines
Changes how your link shows up when shared on things like Slack, Facebook, Twitter, Discord, etc
Changes the title that appears in the embed; if this is not specified, but `title` is, then `title` is used (and vice versa)
Changes the body of the embed
Will appear in the embed if specified, but it is not required.
References SQL queries stored in the /queries directory.
Changes the visibility of the sidebar. 'show' results in a responsive sidebar, 'hide' results in a sidebar accessible via hamburger button and 'never' hides both - the sidebar and the hamburger button.
Changes the position of the page in the sidebar. When used in index.md pages, changes the position of their parent in the sidebar.
Options:
positive integer

Specify a query that returns a column named breadcrumb. The query can use ${params.my_param} to reference the URL parameters for the page.

E.g. breadcrumb: "select customer_name as breadcrumb from customers_table where customer_id = ${params.customer_id}"

Anything outside of these values won't do anything on their own, but they will be accessible as variables on the page.

Partials

./pages/index.md

{@partial "my-first-partial.md"}

And some content specific to this page.

./partials/my-first-partial.md

# This is my first partial

This is some content in the partial.

Evidence supports re-using chunks of Evidence markdown using Partials.

Partials are placed in the ./partials folder, and can be referenced in your markdown with {@partial "path/to/partial.md"} (do not include the /partial folder in the path).