Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@pbutlewski/storybook-html
Advanced tools
A Storybook addon that extracts and displays compiled syntax-highlighted HTML
This addon for Storybook adds a tab that displays the compiled HTML for each story. It uses highlight.js for syntax highlighting.
With NPM:
npm i --save-dev @whitespace/storybook-addon-html
With Yarn:
yarn add -D @whitespace/storybook-addon-html
// .storybook/main.js
module.exports = {
// ...
addons: [
'@whitespace/storybook-addon-html',
// ...
],
};
The HTML is formatted with Prettier. You can override the Prettier config
(except parser
and plugins
) by providing an object following the
Prettier API override format in the
html
parameter:
// .storybook/preview.js
export const parameters = {
// ...
html: {
prettier: {
tabWidth: 4,
useTabs: false,
htmlWhitespaceSensitivity: 'strict',
},
},
};
You can override the wrapper element selector used to grab the component HTML.
export const parameters = {
html: {
root: '#my-custom-wrapper', // default: #root
},
};
When using Web Components, the HTML will contain empty comments, i.e. <!---->
.
If you want to remove these, use the removeEmptyComments
parameter:
export const parameters = {
html: {
removeEmptyComments: true, // default: false
},
};
You can override the showLineNumbers
and wrapLines
settings for the syntax
highlighter by using the highlighter
parameter:
export const parameters = {
html: {
highlighter: {
showLineNumbers: true, // default: false
wrapLines: false, // default: true
},
},
};
As of version 4.0.0 all frameworks are supported per default 🎉
FAQs
A Storybook addon that extracts and displays compiled syntax-highlighted HTML
The npm package @pbutlewski/storybook-html receives a total of 1,264 weekly downloads. As such, @pbutlewski/storybook-html popularity was classified as popular.
We found that @pbutlewski/storybook-html demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.