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

Output HTML per slide page as array by passing htmlAsArray env #119

Merged
merged 4 commits into from
Jan 18, 2019

Conversation

yhatt
Copy link
Member

@yhatt yhatt commented Jan 18, 2019

By passing htmlAsArray: true env when calling render(), Marpit would become to output HTML per slide page as array.

const markdown = `
# Page 1

---

# Page 2
`

const { html } = new Marpit().render(markdown, { htmlAsArray: true })

/*
[ '<section id="1">\n<h1>Page 1</h1>\n</section>\n',
  '<section id="2">\n<h1>Page 2</h1>\n</section>\n' ]
*/

Marpit initializer's container option is still working, so you have to render these HTMLs within <div class="marpit"> or customized element.

Resolve #112.

@yhatt yhatt merged commit a71116f into master Jan 18, 2019
@yhatt yhatt deleted the html-as-array branch January 18, 2019 23:44
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

1 participant