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

[Feature] Support markdown with metadata #3527

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

grgprarup
Copy link
Contributor

@grgprarup grgprarup commented Nov 16, 2023

Pull Request Description

This PR makes changes to the markdown plugin to support metadata in markdown. Also, adds example templates, CSS, and unit tests.

Added:

  • Supports markdown files with metadata
  • Two types of metadata
    • Default (in frontmatter format)
    • Inline (in yaml or yml code block), specific to the slide
  • Templates example (<project_base>/templates)
    • templates/cover-template.html
    • templates/title-content-template.html
    • templates/titile-image-template.html
  • Markdown example for test (<project_base>/test)
    • test/metadata-markdown.md
  • CSS example (<project_base>/css/theme/source)
    • css/theme/source/metadata.css
  • Used libraries/packages
    • front-matter - to parse default metadata
    • js-yaml - to load inline metadata
    • mustache - template system

Modified:

  • Markdown Plugin (<project_base>/plugin/markdown/plugin.js)
    • Functions added
      • parseFrontMatter - to separate default metadata and the rest of the content
      • separateInlineMetadataAndMarkdown - to separate inline metadata and the rest of the content of each slide
      • renderTemplate - to render content with a template
  • Unit test added (<project_base>/test/test-markdown.html)

Related Issue:

Screenshots:

  • Cover slide [cover-template]
    image
  • Title Content slide [title-content-template]
    image
  • Title Image slide [title-image-template]
    image

Checklist:

  • Code follows the project's coding style and best practices
  • Code has been reviewed by team members
  • Documentation has been updated to reflect the changes

Discussion

I am sorry to mention you but I need your thoughts on this.
CC @hakimel

@grgprarup grgprarup marked this pull request as ready for review November 16, 2023 09:02
@QuinnyPig
Copy link

@hakimel I just spent a fair bit of time looking for exactly this functionality; is there a reason not to merge this that'll blow up in my face if I use it? Alternately, is there a better answer that might be lurking around somewhere in the codebase? "Having a series of slide templates that I can grab and populate with content" is kinda the dream here.

@individual-it
Copy link
Contributor

@QuinnyPig we have pulled the functionality into an own plugin. Have a look at https://github.com/JankariTech/revealjs-awesoMD

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.

None yet

3 participants