127 lines
6.5 KiB
HTML
127 lines
6.5 KiB
HTML
<!DOCTYPE html>
|
|
<html><head>
|
|
<meta charset="utf-8">
|
|
<title>wsdiff | Home</title>
|
|
<meta name="description" content="">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<meta name="mobile-web-app-capable" content="yes">
|
|
<meta name="color-scheme" content="dark light">
|
|
<meta name="fediverse:creator" content="@jaseg@chaos.social">
|
|
<link rel="stylesheet" href="/style.css">
|
|
|
|
<link rel="preload" href="/fonts/roboto_slab/RobotoSlab-VariableFont_wght.ttf" as="font" type="font/ttf" crossorigin />
|
|
<link rel="preload" href="/fonts/nyght-serif-main/fonts/WEB/NyghtSerif-Regular.woff2" as="font" type="font/woff2" crossorigin />
|
|
<link rel="preload" href="/fonts/nyght-serif-main/fonts/WEB/NyghtSerif-Bold.woff2" as="font" type="font/woff2" crossorigin />
|
|
<link rel="preload" href="/fonts/nyght-serif-main/fonts/WEB/NyghtSerif-BoldItalic.woff2" as="font" type="font/woff2" crossorigin />
|
|
</head>
|
|
<body><nav>
|
|
<div class="internal">
|
|
|
|
<a href="/" title="Home">Home</a>
|
|
<a href="/blog/" title="Blog">Blog</a>
|
|
<a href="/projects/" title="Projects">Projects</a>
|
|
<a href="/about/" title="About">About</a>
|
|
</div>
|
|
<div class="search">
|
|
<div id="search"></div>
|
|
</div>
|
|
<div class="external">
|
|
<a rel="me" href="https://git.jaseg.de/" title="cgit">cgit</a>
|
|
<a rel="me" href="https://github.com/jaseg" title="Github">Github</a>
|
|
<a rel="me" href="https://gitlab.com/neinseg" title="Gitlab">Gitlab</a>
|
|
<a rel="me" href="https://chaos.social/@jaseg" title="Mastodon">Mastodon</a>
|
|
</span>
|
|
</nav>
|
|
|
|
<header>
|
|
<h1>wsdiff</h1>
|
|
<ul class="breadcrumbs">
|
|
<li><a href="/">jaseg.de</a></li>
|
|
<li><a href="/projects/">Projects</a></li><li><a href="/projects/wsdiff/">wsdiff</a></li>
|
|
</ul>
|
|
|
|
</header>
|
|
<main data-pagefind-body>
|
|
<div class="links">
|
|
<a href="https://git.jaseg.de/wsdiff.git">Sources</a>
|
|
<a href="https://github.com/jaseg/wsdiff/issues">Issues</a>
|
|
<a href="https://pypi.org/project/wsdiff">PyPI</a>
|
|
</div>
|
|
<div class="document">
|
|
|
|
|
|
<p>wsdiff is a python script that produces a diff of two files or directories as a single, self-contained HTML file. The
|
|
resulting diff works without Javascript and will automatically switch between inline and side-by-side formats depending
|
|
on available screen space.</p>
|
|
<div class="section" id="installation">
|
|
<h2>Installation</h2>
|
|
<pre class="code sh literal-block">
|
|
<span class="lineno"></span><span class="line">$<span class="w"> </span>pip<span class="w"> </span>install<span class="w"> </span>wsdiff
|
|
</span></pre>
|
|
</div>
|
|
<div class="section" id="usage">
|
|
<h2>Usage</h2>
|
|
<pre class="literal-block">
|
|
<span class="lineno"></span><span class="line">usage: wsdiff [-h] [-b] [-s SYNTAX_CSS] [-l LEXER] [-L] [-t PAGETITLE]</span>
|
|
<span class="lineno"></span><span class="line"> [-o OUTPUT] [--header] [--content]</span>
|
|
<span class="lineno"></span><span class="line"> [old] [new]</span>
|
|
<span class="lineno"></span><span class="line"></span>
|
|
<span class="lineno"></span><span class="line">Given two source files or directories this application creates an html page</span>
|
|
<span class="lineno"></span><span class="line">that highlights the differences between the two.</span>
|
|
<span class="lineno"></span><span class="line"></span>
|
|
<span class="lineno"></span><span class="line">positional arguments:</span>
|
|
<span class="lineno"></span><span class="line"> old source file or directory to compare ("before" file)</span>
|
|
<span class="lineno"></span><span class="line"> new source file or directory to compare ("after" file)</span>
|
|
<span class="lineno"></span><span class="line"></span>
|
|
<span class="lineno"></span><span class="line">options:</span>
|
|
<span class="lineno"></span><span class="line"> -h, --help show this help message and exit</span>
|
|
<span class="lineno"></span><span class="line"> -b, --open Open output file in a browser</span>
|
|
<span class="lineno"></span><span class="line"> -s SYNTAX_CSS, --syntax-css SYNTAX_CSS</span>
|
|
<span class="lineno"></span><span class="line"> Path to custom Pygments CSS file for code syntax</span>
|
|
<span class="lineno"></span><span class="line"> highlighting</span>
|
|
<span class="lineno"></span><span class="line"> -l LEXER, --lexer LEXER</span>
|
|
<span class="lineno"></span><span class="line"> Manually select pygments lexer (default: guess from</span>
|
|
<span class="lineno"></span><span class="line"> filename, use -L to list available lexers.)</span>
|
|
<span class="lineno"></span><span class="line"> -L, --list-lexers List available lexers for -l/--lexer</span>
|
|
<span class="lineno"></span><span class="line"> -t PAGETITLE, --pagetitle PAGETITLE</span>
|
|
<span class="lineno"></span><span class="line"> Override page title of output HTML file</span>
|
|
<span class="lineno"></span><span class="line"> -o OUTPUT, --output OUTPUT</span>
|
|
<span class="lineno"></span><span class="line"> Name of output file (default: stdout)</span>
|
|
<span class="lineno"></span><span class="line"> --header Only output HTML header with stylesheets and stuff,</span>
|
|
<span class="lineno"></span><span class="line"> and no diff</span>
|
|
<span class="lineno"></span><span class="line"> --content Only output HTML content, without header
|
|
</span></pre>
|
|
</div>
|
|
<div class="section" id="example-output">
|
|
<h2>Example Output</h2>
|
|
<img alt="latest.png" src="latest.png" />
|
|
</div>
|
|
</div>
|
|
</main><footer>
|
|
Copyright © 2026 Jan Sebastian Götte
|
|
/ <a href="/about/">About</a>
|
|
/ <a href="/imprint/">Imprint</a>
|
|
</footer>
|
|
<script type="text/javascript" src="/pagefind/pagefind-ui.js" defer></script>
|
|
<script>
|
|
window.addEventListener('DOMContentLoaded', (event) => {
|
|
new PagefindUI({element: "#search", showSubResults: true});
|
|
});
|
|
</script>
|
|
<script type="speculationrules">
|
|
{
|
|
"prerender": [
|
|
{
|
|
"source": "document",
|
|
"where": {
|
|
"and": [
|
|
{"href_matches": "/*"}
|
|
]
|
|
},
|
|
"eagerness": "moderate"
|
|
}
|
|
]
|
|
}
|
|
</script>
|
|
</body>
|
|
</html>
|