Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
html-merge-cmd
Advanced tools
This package provides a command-line tool for minimal static sites, using HTML Merge.
Updates are done in-place - there is no second output directory.
The specification aims to be so simple that you could implement this easily yourself, if you have access to an HTML parser and basic CSS selectors.
If you have a directory organised like this:
index.html
contact.html
blog/index.html
blog/post-01.html
Running html-merge
on/in this directory will merge each page into its parent page, in-place. HTML files without the appropriate merge-attributes are left untouched.
This should be installed globally:
npm install -g html-merge
And used like this, with an optional target directory:
html-merge <dir>
You annotate elements using the merge-replace
attribute, which contains a CSS selector:
<title merge-replace="head title">New Title!</title>
<div id="main" merge-replace="#main">New body!</div>
The tool takes the closest parent (index.html
):
<!DOCTYPE html>
<html>
<head>
<title>Old title</title>
</head>
<body>
<div id="nav">(common content)</div>
<div id="main">Old body</div>
</body>
</html>
And merges your changes into it (in-place):
<!DOCTYPE html>
<html>
<head>
<title merge-replace="head title">New Title!</title>
</head>
<body>
<div id="nav">(common content)</div>
<div id="main" merge-replace="#main">New body!</div>
</body>
</html>
Since everything without merge-replace=
is ignored, this is equivalent to our original input.
FAQs
Merge HTML documents, using CSS selectors
We found that html-merge-cmd 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.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.