### Install Sample Plugin Source: https://github.com/kepano/defuddle/blob/main/tests/fixtures/content-patterns--heading-introduced-list.html Install the plugin using a package manager. This example shows the syntax for 'use'. ```lua use 'user/sample-plugin' ``` -------------------------------- ### Install and Run First Job Source: https://github.com/kepano/defuddle/blob/main/tests/expected/codeblocks--code-pre-nesting.md Install the SDK and execute a basic task. This is the starting point for using the SDK. ```bash npm install example-sdk ``` ```javascript const sdk = require('example-sdk'); const result = await sdk.run({ task: 'hello' }); console.log(result); ``` -------------------------------- ### Sample Plugin Configuration Source: https://github.com/kepano/defuddle/blob/main/tests/expected/content-patterns--heading-introduced-list.md Configure the sample-plugin by passing a table to the setup function. This example shows default values for logging and filetype settings. ```lua require('sample-plugin').setup({ logging = true, filetype = {}, }) ``` -------------------------------- ### Example Software Package Files Source: https://github.com/kepano/defuddle/blob/main/tests/expected/issues--280-texinfo-footnotes.md Illustrates the typical files found in a directory like /usr/local/man/man1 when installing software from source. ```text a2p.1 ctags.1 emacs.1 etags.1 h2ph.1 perl.1 s2p.1 ``` -------------------------------- ### Install Additional Packages Source: https://github.com/kepano/defuddle/blob/main/tests/expected/content-patterns--table-of-contents.md Install extra packages like 'vim' and 'openssh' into the system. ```shell apk add vim openssh ``` -------------------------------- ### Install and Run First Job with example-sdk Source: https://github.com/kepano/defuddle/blob/main/tests/fixtures/codeblocks--code-pre-nesting.html Install the package using npm and then use the SDK to run a 'hello' task. The result of the task execution is logged to the console. ```javascript npm install example-sdk const sdk = require('example-sdk'); const result = await sdk.run({ task: 'hello' }); console.log(result); ``` -------------------------------- ### Get Items API Call Source: https://github.com/kepano/defuddle/blob/main/tests/fixtures/issues--217-writerside-docs.html This example shows how to make a GET request to retrieve a list of items from the API. ```http GET https://api.example.com/items ``` ```javascript console.log(response.status) ``` -------------------------------- ### Install Base System Packages Source: https://github.com/kepano/defuddle/blob/main/tests/expected/content-patterns--table-of-contents.md Install the essential 'base-system' package group using the apk package manager. ```shell apk add base-system ``` -------------------------------- ### Install Dependencies and Build Project Source: https://github.com/kepano/defuddle/blob/main/README.md Run these commands in your terminal to install project dependencies and build the package. Requires Node.js and npm. ```bash npm install npm run build ``` -------------------------------- ### GET Request to retrieve items Source: https://github.com/kepano/defuddle/blob/main/tests/expected/issues--217-writerside-docs.md Use this method to retrieve a list of items from the API. The example shows a basic GET request and how to log the response status. ```http GET https://api.example.com/items > {% console.log(response.status) %} ``` -------------------------------- ### Install Defuddle Package Source: https://github.com/kepano/defuddle/blob/main/README.md Install the Defuddle package using npm for project integration. ```bash npm install defuddle ``` -------------------------------- ### Write Installer to USB Source: https://github.com/kepano/defuddle/blob/main/tests/expected/content-patterns--table-of-contents.md Write the installer ISO image to a USB storage device. Ensure the device is unmounted before execution. ```shell dd bs=4M conv=fsync oflag=direct status=progress if=installer.iso of=/dev/sdx ``` -------------------------------- ### Chroot into New System Source: https://github.com/kepano/defuddle/blob/main/tests/expected/content-patterns--table-of-contents.md Enter the newly installed system's environment to perform further configuration. ```shell chroot /mnt /bin/sh ``` -------------------------------- ### Obsidian Vault Structure Example Source: https://github.com/kepano/defuddle/blob/main/tests/fixtures/general--x.com-article-2026-02-13.html This example illustrates a typical directory structure for an Obsidian vault, categorizing notes and resources for effective knowledge management. ```markdown my-vault/ ├── 00_inbox/ # capture zone, zero friction ├── 01_thinking/ # your notes and synthesis │ └── notes/ # individual thinking notes ├── 02_reference/ # external knowledge │ ├── tools/ # tool documentation │ ├── approaches/ # methods and patterns │ └── sources/ # external knowledge ├── 03_creating/ # content in progress │ └── drafts/ ├── 04_published/ # finished work archive ├── 05_archive/ # inactive content ├── 06_system/ # templates and scripts ├── CLAUDE.md # teaches the ai your system └── attachments/ # images and files ``` -------------------------------- ### JSON Configuration Example Source: https://github.com/kepano/defuddle/blob/main/tests/expected/codeblocks--rehype-pretty-code.md A sample JSON object representing a social filesystem configuration. ```json { "title": "A Social Filesystem", "author": "Dan Abramov", "site": "Dan Abramov", "published": "" } ``` -------------------------------- ### Install Defuddle CLI Globally Source: https://github.com/kepano/defuddle/blob/main/README.md Install the defuddle command globally using npm for command-line access. ```bash npm install -g defuddle ``` -------------------------------- ### Project Status and Review Cadence Example Source: https://github.com/kepano/defuddle/blob/main/tests/fixtures/codeblocks--rehype-pretty-copy.html This snippet shows an example of YAML front matter used in project files to track status, review cycle, and dates. It includes comments explaining the fields. ```yaml tags: - Projects/Open # status: Open, Inbox, Hold, Dropped, Done area: next-act # life area the project belongs to review-cycle: 7 # days before the project is considered stale start-date: 2026-01-15 complete-date: ``` -------------------------------- ### Install DOM Implementation for Node.js Source: https://github.com/kepano/defuddle/blob/main/README.md When using Defuddle in a Node.js environment, install a DOM implementation like linkedom or jsdom. ```bash npm install linkedom ``` ```bash npm install jsdom ``` -------------------------------- ### Session Start Hook for Folder Structure Source: https://github.com/kepano/defuddle/blob/main/tests/expected/general--x.com-article-2026-02-13.md This JSON configuration defines a hook that runs a `tree` command upon session start to display the folder and file structure, excluding specified directories like '.git' and '.obsidian'. ```json { "hooks": { "SessionStart": [{ "hooks": [{ "type": "command", "command": "tree -L 3 -a -I '.git|.obsidian' --noreport" }] }] } } ``` -------------------------------- ### Load Keyboard Layout Source: https://github.com/kepano/defuddle/blob/main/tests/expected/content-patterns--table-of-contents.md Load a different keyboard layout. The default is 'us'. This example loads the 'dvorak' layout. ```shell loadkeys dvorak ``` -------------------------------- ### CLI: Output as Markdown Source: https://github.com/kepano/defuddle/blob/main/README.md Specify the `--markdown` flag to get the parsed content in Markdown format. ```bash npx defuddle parse page.html --markdown ``` -------------------------------- ### Verify Image Integrity Source: https://github.com/kepano/defuddle/blob/main/tests/expected/content-patterns--table-of-contents.md Use this command to verify the integrity of the downloaded installer image using its SHA256 checksum. ```shell sha256sum -c --ignore-missing sha256sums.txt ``` -------------------------------- ### Reboot System Source: https://github.com/kepano/defuddle/blob/main/tests/expected/content-patterns--table-of-contents.md Reboot the system after completing the installation. Ensure the installation media is removed. ```shell reboot ``` -------------------------------- ### Directory Structure Example Source: https://github.com/kepano/defuddle/blob/main/tests/expected/codeblocks--rehype-pretty-code.md Illustrates a typical directory structure for posts, including clock ID usage for collision avoidance. ```fish posts/ ├── 1221499500000000-c5.json ├── 1221499500000000-k3.json # clock id helps avoid global collisions └── 1221499500000001-k3.json # artificial +1 avoids local collisions ``` -------------------------------- ### Chroma Code Block Example Source: https://github.com/kepano/defuddle/blob/main/tests/expected/codeblocks--chroma-line-spans.md This is an example of a Chroma code block, often used for syntax highlighting. ```json { "title": "Chroma Code Block", "author": "", "site": "", "published": "" } ``` -------------------------------- ### Example Bit-Shift Analysis Source: https://github.com/kepano/defuddle/blob/main/tests/fixtures/footnotes--pulldown-cmark-footnote-definition.html Demonstrates a common simplification in bit-shift analysis where `x & ~0` is replaced by `x`. This is a simplification used in some contexts. ```Go x & ~0 ``` -------------------------------- ### Initialize Megamenu with Event Listeners Source: https://github.com/kepano/defuddle/blob/main/tests/fixtures/footnotes--maggieappleton.com-xanadu-patterns.html Sets up a megamenu component by attaching event listeners for click, keydown, focusout, and Astro's before-preparation event. Handles opening and closing the menu and managing ARIA attributes. ```javascript function c(){const t=document.querySelector(".popover-button"),e=document.getElementById("garden-dropdown");if(!t||!e)return;function n(){!t||!e|| (t.setAttribute("aria-expanded","false"),e.style.opacity="0",e.style.transform="rotateX(-15deg)",e.style.scale="0.95"),setTimeout(()=>{e.style.opacity==="0"&&e.classList.add("hidden")},250))}function u(){!e||!t|| (t.setAttribute("aria-expanded","true"),e.classList.remove("hidden"),e.offsetHeight,requestAnimationFrame(()=>{e.style.opacity="1",e.style.transform="rotateX(0deg)",e.style.scale="1"}))}t.setAttribute("aria-expanded","false"),e.classList.add("hidden"),e.style.opacity="0",e.style.transform="rotateX(-15deg)",e.style.scale="0.95";const o=t._megamenuHandlers; o&&(t.removeEventListener("click",o.click),document.removeEventListener("keydown",o.keydown),document.removeEventListener("focusout",o.focusout),document.removeEventListener("astro:before-preparation",o.beforePrep));const r=s=>{s.stopPropagation(),e.classList.contains("hidden")?u():n()},i=s=>{s.key==="Escape"&&!e.classList.contains("hidden")&&(n(),t.focus())},d=s=>{const a=s.relatedTarget;a&&e.contains(a)||!e.contains(a)&&!t.contains(a)&&n()}};t._megamenuHandlers={click:r,keydown:i,focusout:d,beforePrep:n},t.addEventListener("click",r),document.addEventListener("keydown",i),document.addEventListener("focusout",d),document.addEventListener("astro:before-preparation",n)}c();document.addEventListener("astro:page-load",c); ``` -------------------------------- ### Echo Hello World in Shell Source: https://github.com/kepano/defuddle/blob/main/tests/expected/code-blocks--hexo-br.md A simple shell command to print 'hello'. ```shell echo hello ``` -------------------------------- ### Install Wrangler CLI Source: https://github.com/kepano/defuddle/blob/main/website/README.md Install Wrangler, Cloudflare's CLI for Workers, globally using npm. This is a prerequisite for running Cloudflare Workers locally. ```bash npm install -g wrangler ``` -------------------------------- ### Go Struct and Method Example Source: https://github.com/kepano/defuddle/blob/main/tests/expected/codeblocks--chroma-line-spans.md Demonstrates a basic Go struct with a method. The method modifies the struct's state. ```go package main type Person struct { Name string Age int } func (p *Person) Sleep() int { p.Age += 1 return p.Age } ``` -------------------------------- ### Footnote Masking Example Source: https://github.com/kepano/defuddle/blob/main/tests/fixtures/footnotes--pulldown-cmark-footnote-definition.html Illustrates masking of the top bit, potentially with IR semantics that define wrapping or truncation behavior. This example shows `x & 0x7fff..ffff`. ```Go x & 0x7fff..ffff ``` -------------------------------- ### Create Disk Partitions Source: https://github.com/kepano/defuddle/blob/main/tests/expected/content-patterns--table-of-contents.md Create two partitions on the target disk: the first for EFI System Partition (ESP) and the second for the main pool. ```shell sgdisk -n1:1M:+512M -t1:EF00 $DISK sgdisk -n2:0:0 -t2:BF00 $DISK ``` -------------------------------- ### Temml Display Math Source: https://github.com/kepano/defuddle/blob/main/tests/fixtures/math--temml.html Example of display math rendering in Temml. ```temml E=mc^2 ```