Skip to content

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
@grgprarup grgprarup force-pushed the support-metadata-markdown branch from 4b4415d to 75b44c1 Compare December 11, 2023 08:34
@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

@dude-at-RA
Copy link

@quinnypig have you looked into using Pandoc with reveal? With YAML frontmatter in your markdown, you can do a LOT of templating. You can even bring your own RevealJS targeting CSS pretty easily too.

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.

4 participants