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

Front-matter variables? #387

Open
boldandbusted opened this issue Oct 7, 2024 · 2 comments
Open

Front-matter variables? #387

boldandbusted opened this issue Oct 7, 2024 · 2 comments
Labels
better-for-plugin It should be better as Marpit plugin

Comments

@boldandbusted
Copy link

Howdy. I'd like to use "front matter" variables in the Markdown, including in headings. Is this possible? I have made some attempts, but the heading doesn't interpret the {{ }}, it prints it literally.

I'm using this as the guide (referenced in the Marp docs): https://jekyllrb.com/docs/front-matter/#custom-variables

I'd like to do something like the following:

---
title: Making money - is it possible?
---

# Welcome to "{{ page.title }}"

# Here begins my presentation

## This is my slidedeck
## No one can make a slidedeck like I can
### I have very low hubris

Here, the first slide should contain this rendered text:

Making money - is it possible?

I hope this makes sense.

@yhatt
Copy link
Member

yhatt commented Oct 7, 2024

Front-matter variables are Jekyll specific feature. Marp has no feature to use variables because that feature is not defined in CommonMark. (Marpit has mentioned to Jekyll for describing how to define front-matter, but no meaning that is implemented all features)

You should use a plugin if you want to use: marp-team/marp#510

@yhatt yhatt added the better-for-plugin It should be better as Marpit plugin label Oct 7, 2024
@boldandbusted
Copy link
Author

Ah, I see. Thanks for the reply. I think referring to that Jekyll document implies that Marp implements all the features shown there. :) It might be useful to other readers to narrow the scope in the documentation. Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
better-for-plugin It should be better as Marpit plugin
Projects
None yet
Development

No branches or pull requests

2 participants