Created
November 26, 2017 16:58
-
-
Save ullmark/36cdcb87ea7c2b771b2c36988aa41d56 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var options = { | |
styleguideProcessors: { | |
30: styleguide => { | |
const makeHtml = html => escapeHtml(` | |
<html> | |
<head> | |
<title></title> | |
<link rel="stylesheet" href="/static/entry.css" /> | |
<link rel="stylesheet" href="/styleguide_pseudo_styles.css" /> | |
<link rel="stylesheet" href="/styleguide_helper_elements.css" /> | |
</head> | |
<body> | |
${html} | |
</body> | |
</html> | |
`); | |
styleguide.sections.forEach(section => { | |
if (typeof section.markup !== 'string') { return; } | |
section.renderMarkup = `<iframe class="sg sg-iframe" srcdoc="${makeHtml(section.renderMarkup)}"></iframe>`; | |
section.modifiers.forEach(modifier => { | |
modifier.renderMarkup = `<iframe class="sg sg-iframe" srcdoc="${makeHtml(modifier.renderMarkup)}"></iframe>`; | |
}); | |
}); | |
} | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment