Skip to content

Instantly share code, notes, and snippets.

@gavinmcfarland
Last active February 17, 2019 00:49
Show Gist options
  • Select an option

  • Save gavinmcfarland/4fc172fcf2141d791f185b2e053c88c0 to your computer and use it in GitHub Desktop.

Select an option

Save gavinmcfarland/4fc172fcf2141d791f185b2e053c88c0 to your computer and use it in GitHub Desktop.
Example using pHTML and Svelte
/** Example using phtml-markdown
https://github.com/phtmlorg/phtml-markdown **/
// svelt-preprocessor
const options = {
phtml ({ content, filename }) {
return phtmlMarkdown.process(content, { from: filename }).then(result => ({ code: result.html, map: null }));
}
}
// svelte
const processed = await svelte.preprocess(source, {
markup: ({ content }) => phtmlMarkdown.process(content).then(result => ({ code: result.html }))
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment