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

Collect HTML comment per pages to be usable as presenter note #83

Merged
merged 13 commits into from
Oct 10, 2018

Conversation

yhatt
Copy link
Member

@yhatt yhatt commented Oct 9, 2018

This PR will collect HTML comment per pages (except YAML for directives) and return to comments member in Marpit#render after rendered. It will expect to be used as presenter notes in integrated apps.

By this change, comments member is added to the result of Marpit.render(). It's a double-dimensional string array.

const md = `
<!-- theme: default -->

# Hello, world!

<!-- Comments (for presenter note) -->
<!--
To keep a compatibillity with general markdown document, we're using HTML
comments to be realize the presenter note of slide deck.
-->

---
<!-- backgroundColor: black -->

## Marpit framework

<!-- It would collect HTML comments except YAML for directives. -->
`
const marpit = new Marpit()
const { comments } = marpit.render(md)
console.log(comments)
[ [ 'Comments (for presenter note)',
    'To keep a compatibillity with general markdown document, we\'re using HTML\ncomments to be realize the presenter note of slide deck.' ],
  [ 'It would collect HTML comments except YAML for directives.' ] ]

Currently Marpit won't handle the parsed comments and treat as plain text(s). The integrated app can use comments as presenter note, and you can be post-processing by another markdown parser if you want any styling.

Closes #82.

ToDo

  • Update TypeScript definition
  • Update JSDoc
  • Update docs
  • Update CHANGELOG.md

@yhatt yhatt changed the title Collect HTML comment per pages and return with rendered result Collect HTML comment per pages to be usable as presenter note Oct 10, 2018
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.

1 participant