Improve developer documentation

This commit is contained in:
Jordan Wages 2026-07-07 01:31:52 -05:00
commit ab7b83abbb
48 changed files with 679 additions and 576 deletions

View file

@ -2,9 +2,9 @@
<html>
<head>
<meta charset="utf-8">
<title>This is the HOMEPAGE. | CapyKit Documentation </title>
<title>CapyKit Documentation | CapyKit Documentation </title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="title" content="This is the HOMEPAGE. | CapyKit Documentation ">
<meta name="title" content="CapyKit Documentation | CapyKit Documentation ">
<link rel="icon" href="favicon.ico">
@ -71,13 +71,58 @@
</div>
<article data-uid="">
<h1 id="this-is-the-homepage">This is the <strong>HOMEPAGE</strong>.</h1>
<h1 id="capykit-documentation">CapyKit Documentation</h1>
<p>Refer to <a href="http://daringfireball.net/projects/markdown/">Markdown</a> for how to write markdown files.</p>
<h2 id="quick-start-notes">Quick Start Notes:</h2>
<ol>
<li>Add images to the <em>images</em> folder if the file is referencing an image.</li>
</ol>
<p>CapyKit is a small .NET utility library for the code you end up writing repeatedly: collection helpers, string and enum extensions, JSON serialization, gzip compression, password hashing, random token generation, simple key validation, distance calculations, and lightweight event reporting.</p>
<p>The library targets .NET 8 and keeps its public surface intentionally direct. Most features are static helpers or extension methods, so consuming projects can adopt one piece at a time without taking on a framework or application model.</p>
<h2 id="start-here">Start Here</h2>
<ul>
<li><a href="introduction.html">Introduction</a> explains what CapyKit includes and how the namespaces are organized.</li>
<li><a href="getting-started.html">Getting Started</a> shows installation, imports, and common usage examples.</li>
<li><a href="api/toc.html">API Reference</a> contains the generated DocFX reference for every public type and member.</li>
</ul>
<h2 id="common-tasks">Common Tasks</h2>
<h3 id="work-with-strings-and-collections">Work with strings and collections</h3>
<p>Use <code>CapyKit.Extensions</code> for small quality-of-life helpers such as null fallback values, pagination, inverted filtering, left outer joins, enum display names, and property copying.</p>
<pre><code class="lang-csharp">using CapyKit.Extensions;
var displayName = user.Name.IfNullOrWhiteSpace(&quot;Guest&quot;);
var page = users.Page(pageNumber: 2, pageSize: 25);
</code></pre>
<h3 id="serialize-compress-and-restore-values">Serialize, compress, and restore values</h3>
<p>Use <code>CapyKit.Helpers.SerializationHelper</code> and <code>CapyKit.Helpers.CompressionHelper</code> when you need straightforward JSON serialization or gzip compression around serializable values.</p>
<pre><code class="lang-csharp">using CapyKit.Helpers;
var payload = SerializationHelper.SerializeToString(order);
var compressed = CompressionHelper.CompressToString(order);
var restored = CompressionHelper.Decompress&lt;Order&gt;(compressed);
</code></pre>
<h3 id="hash-passwords-and-generate-tokens">Hash passwords and generate tokens</h3>
<p>Use <code>SecurityHelper</code> for PBKDF2 password hashes, salts, and random values backed by .NET cryptographic random number generation.</p>
<pre><code class="lang-csharp">using CapyKit;
using CapyKit.Helpers;
Password password = SecurityHelper.Pbkdf2(&quot;correct horse battery staple&quot;);
bool matches = SecurityHelper.CompareHashedPassword(
password,
&quot;correct horse battery staple&quot;,
password.Salt,
Password.Pbkdf2Algorithm);
</code></pre>
<h3 id="listen-to-capykit-events">Listen to CapyKit events</h3>
<p>CapyKit reports warnings and errors through <code>CapyEventReporter</code> instead of choosing a logging framework for you. Subscribe at the level your application cares about and route events into your own logging pipeline.</p>
<pre><code class="lang-csharp">using CapyKit;
CapyEventReporter.Subscribe(
e =&gt; logger.LogWarning(&quot;{Method}: {Message}&quot;, e.MethodName, e.Message),
EventLevel.Warning);
</code></pre>
<h2 id="build-the-docs-locally">Build The Docs Locally</h2>
<p>The documentation is generated with DocFX from the Markdown files in this folder and the XML comments in the <code>CapyKit</code> project.</p>
<pre><code class="lang-bash">dotnet tool install -g docfx
docfx Docs/docfx.json --serve
</code></pre>
<p>DocFX writes the generated site to <code>Docs/_site</code>.</p>
</article>