Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: the first yaml code block as frontmatter #1186

Merged
merged 5 commits into from
Nov 16, 2023
Merged

Conversation

mskelton
Copy link
Contributor

@mskelton mskelton commented Nov 9, 2023

Fixes #854

This adds support for configuring slide frontmatter using an alternative <v-config> syntax to make it easier for Prettier users to change settings per slide rather than the typical frontmatter approach.

---
layout: cover
---

Can now be written like this:

---

<v-config>
layout: cover
</v-config>

This doesn't change the existing method of using per-slide frontmatter, that's still supported without any changes.

@antfu
Copy link
Member

antfu commented Nov 9, 2023

Maybe

---

```yml
layout: cover
```

So it works better with syntax highlight

@mskelton mskelton changed the title Support configuring slides using v-config Support configuring slides using yaml code block Nov 9, 2023
@mskelton
Copy link
Contributor Author

mskelton commented Nov 9, 2023

Great idea. Updated the PR to detect if it's the first code block immediately after the slide break and is yml or yaml.

@antfu antfu changed the title Support configuring slides using yaml code block feat: support configuring slides using yaml code block Nov 16, 2023
@antfu antfu changed the title feat: support configuring slides using yaml code block feat: the first yaml code block as frontmatter Nov 16, 2023
@antfu antfu merged commit 9c29726 into slidevjs:main Nov 16, 2023
8 checks passed
antfu added a commit to slidevjs/docs that referenced this pull request Nov 16, 2023
@mskelton mskelton deleted the v-config branch November 16, 2023 13:21
openscript pushed a commit to openscript/slidev that referenced this pull request Jan 28, 2024
Co-authored-by: Anthony Fu <anthonyfu117@hotmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

VSCode - format slides.md - break the build
2 participants