Security News
PyPI’s New Archival Feature Closes a Major Security Gap
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
rehype-document
Advanced tools
Wrap a document around HTML with rehype.
npm:
npm install rehype-document
var unified = require('unified');
var parse = require('remark-parse');
var mutate = require('remark-rehype');
var stringify = require('rehype-stringify');
var document = require('rehype-document');
process.stdin
.pipe(unified())
.use(parse)
.use(mutate)
.use(document, {title: 'Hi!'})
.use(stringify)
.on('error', console.log)
.pipe(process.stdout);
When the following is given on stdin(4):
## Hello world!
This is **my** document.
Yields the following on stdout(4):
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Hi!</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<h2>Hello world!</h2>
<p>This is <strong>my</strong> document.</p>
</body>
</html>
rehype.use(document[, options])
options
title
(string
, default: name of file, if any)
— Text to use as title;language
(string
, default: 'en'
)
— Natural language of document (BCP 47);responsive
(boolean
, default: true
)
— Whether to insert a meta[viewport]
;doctype
(string
, default: '5'
)
— Doctype to use;css
(string
or Array.<string>
, default: []
)
— Stylesheets to include in head
;js
(string
or Array.<string>
, default: []
)
— Scripts to include at end of body
.FAQs
rehype plugin to wrap a document around a fragment
The npm package rehype-document receives a total of 4,311 weekly downloads. As such, rehype-document popularity was classified as popular.
We found that rehype-document demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers 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.
Security News
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
Research
Security News
Malicious npm package postcss-optimizer delivers BeaverTail malware, targeting developer systems; similarities to past campaigns suggest a North Korean connection.
Security News
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.