Ignore yaml frontmatter & display dataview content in slides

Use case or problem

  • create slides using yaml in the slide md file
  • show content from dataview and dataviewjs queries in slides

Proposed solution

  • recognise if the first section is yaml and don’t display
    • could do this by ignoring the first ‘slide’ if the file begins with three dashes, as this is considered yaml
    • or recognise the yaml format with name : item
    • or require 4 hyphens between slides so 3 hyphens is recognised as yaml and ignored
    • or require something like #yaml at the beginning of the yaml section
  • render dataview content in the slide, which shows in preview but not in the slide currently

Current workaround (optional)

  • none known

Related feature requests (optional)

4 Likes

Here is a small css snippet that can be used to hide the YAML frontmatter, as a workaround until it is fixed in the Slides plugin:

section.present > .frontmatter,
section.present .copy-code-button {
    display: none;
}

It also hides copy buttons from code blocks.

1 Like

Thank you, that is a good work around for hiding the front matter. Now I just need the slides to show Dataview query data, some of which comes from the frontmatter itself.

You can comment out a YAML header with percent symbols so that it doesn’t appear at all during a presentation.

%%---
key: value
key2: value2
key3: [one, two, three]
key4:
- four
- five
- six
---%%

Angel

Thank you for the tip.