Skip to content

Cyber Fidget Guide Studio

Cyber Fidget Guide Studio is an interactive browser-based authoring tool for creating iFixit-style build and repair guides that integrate directly with an MkDocs-based documentation site.
It lets you organize steps, annotate images, and automatically generate Markdown that drops straight into your documentation build.


๐Ÿš€ Overview

The studio allows you to:

  • Organize an assembly or teardown guide into major steps (step1, step2, etc.) and minor steps (images within each folder).
  • Add annotations (pins, boxes, circles, arrows) on images to highlight features or actions.
  • Write descriptions, tools, and parts lists for each major step.
  • Generate and manage:
  • step.meta.json โ€“ metadata (title, description, tools, parts, pin counters)
  • *.annot.json โ€“ per-image annotation data
  • step.md โ€“ individual Markdown file for each step
  • guide.md โ€“ the full assembled guide
  • Preview annotations directly on your documentation site with live zoom, hover-to-swap thumbnails, and click-to-zoom images.

Everything is stored alongside your docs (e.g. docs/getting-started/assembly/stepN/), so the workflow is sustainable and version-controlled.


๐Ÿ—‚๏ธ Folder Structure

Typical structure of an assembly section:

docs/
โ””โ”€โ”€ getting-started/
    โ””โ”€โ”€ assembly/
        โ”œโ”€โ”€ step1/
        โ”‚   โ”œโ”€โ”€ step1.1.jpg
        โ”‚   โ”œโ”€โ”€ step1.1.annot.json
        โ”‚   โ”œโ”€โ”€ step1.md
        โ”‚   โ””โ”€โ”€ step.meta.json
        โ”œโ”€โ”€ step2/
        โ”‚   โ”œโ”€โ”€ step2.1.jpg
        โ”‚   โ”œโ”€โ”€ step2.2.jpg
        โ”‚   โ”œโ”€โ”€ step2.1.annot.json
        โ”‚   โ”œโ”€โ”€ step2.2.annot.json
        โ”‚   โ”œโ”€โ”€ step2.md
        โ”‚   โ””โ”€โ”€ step.meta.json
        โ””โ”€โ”€ guide.md

guide.md is automatically generated by the studioโ€™s โ€œBuild Full Guideโ€ button.


๐Ÿง  How It Works

The studio runs entirely client-side using the File System Access API: 1. You click โ€œPick Folderโ€ and select the top-level assembly/ directory.
- The tool remembers this folder in local storage. 2. It enumerates subfolders (step1, step2, โ€ฆ) as major steps, and the image files inside each as minor steps. 3. When you annotate or edit metadata, the tool writes JSON and Markdown directly into those folders. 4. The MkDocs site simply reads these files: - guide.js + multi.js render the galleries and annotation overlays. - guide.md references all images and metadata with correct relative paths.

You fully own the contentโ€”no cloud service or database required.


๐Ÿงฉ Major Features

Category Features
File Management Local file system integration (no uploads), remembers last folder, โ€œSave Allโ€ writes all JSON + metadata, optional overwrite toggle
Annotation Tools Pins, Boxes, Circles, Arrows โ€” all editable, draggable, copy/pasteable, undo/redo supported
Keyboard Shortcuts Quick tool switching (P, B, C, A), movement nudging, deletion, undo/redo
Inspector / Sidebar Live coordinate and size editors, pin numbering, per-object label editing
Metadata Editing Title, description (supports paragraphs + <br> via Shift+Enter), tools, parts
Cross-Image Pin Numbering Pin numbers tracked across the entire major step (step.meta.json keeps counter)
Multi-Image Step Gallery Hover thumbnails to swap main image, click main image to open full-size, auto-loads annotations for each image
Undo / Redo Ctrl+Z / Ctrl+Shift+Z or Ctrl+Y
Copy / Paste Ctrl+C / Ctrl+V to clone selected annotation
Delete Delete key removes selected annotation
Drag / Arrow Keys Mouse drag to move points, arrow keys nudge (Shift+Arrow for fine control)
Markdown Generation Creates step.md and full guide.md with proper relative paths, caption formatting, and paragraph support
Paragraph Formatting Single newline โ†’ <br>, double newline or --- line โ†’ new <p> block
Auto-Numbering Pins Step-wide numbering continues across thumbnails
Renumber Button โ€œRenumber pins (step-wide)โ€ reassigns sequential numbers across all images in a step
Responsive Layout Works in Chrome/Edge, mobile-friendly galleries, click-to-zoom large image view

โŒจ๏ธ Keyboard Shortcuts

Key Action
P Pin tool
B Box tool
C Circle tool
A Arrow tool
Enter Finish drawing current shape / blur active input
Shift + Enter Newline inside description textarea
Esc Cancel drawing or revert text edit
Ctrl + Z Undo
Ctrl + Shift + Z or Ctrl + Y Redo
Ctrl + C / Ctrl + V Copy / Paste selected annotation
Delete Delete selected annotation
Arrow Keys Nudge selected annotation
Shift + Arrow Keys Fine nudge (smaller step)

๐Ÿงญ Typical Workflow

  1. Prepare Images
  2. Place all photos for each major step in its own subfolder (step1, step2, or simply 1, 2, โ€ฆ).
  3. Name images consistently (step2.1.jpg, step2.2.jpg, or step1.jpg, step2.jpg, or simply 1.jpg, 2.jpg, etc.).

  4. Open the Studio

  5. Open cf-guide-studio.html in Chrome or Edge.
  6. Click โ€œPick Folderโ€ and choose the top-level assembly directory.

  7. Annotate Images

  8. Select a step โ†’ click an image โ†’ draw pins/boxes/arrows.
  9. Use the right sidebar to edit labels, colors, and metadata.
  10. Use Ctrl+S (or Save All) to persist *.annot.json.

  11. Edit Step Metadata

  12. Set a human-friendly title, write a multi-line description (Shift+Enter for line breaks), and list tools / parts.
  13. Optionally edit or renumber pins step-wide.

  14. Generate Step Markdown

  15. Click Generate step.md to create a Markdown file for that step.
    It embeds the gallery HTML and your formatted description.

  16. Build the Full Guide

  17. Click Build full guide.md to concatenate all step Markdown files into one page with correct relative image paths.

  18. Preview in MkDocs

  19. Run mkdocs serve and navigate to /getting-started/assembly/guide/.
    Youโ€™ll see interactive thumbnails and live annotations rendered by guide.js and multi.js.

  • multi.js
    Handles thumbnail hover and image swapping. Updates data-annot-src so the correct annotation JSON is fetched when images change.
  • guide.js
    Loads .annot.json files, draws SVG overlays, and updates dynamically when the main image changes.
    Missing annotation files simply render no overlay (no errors).

Click-to-Zoom: Each galleryโ€™s main image is wrapped in an <a class="cf-zoom"> anchor that opens the raw file in a new tab for detailed viewing.

Mobile: The gallery auto-scales with a right padding gutter to avoid edge-to-edge cropping.


๐Ÿ’ก Description Formatting

Input Output
Line 1 <Shift+Enter> Line 2 Line 1<br>Line 2
Line 1 <Shift+Enter><Shift+Enter> Line 2 Separate paragraphs (<p>)
Line with only --- Forces a new paragraph break

๐Ÿงฎ Step-Wide Pin Numbering & Auto-Save

๐Ÿ”ข Global Pin Numbers

Pins are now numbered across an entire major step, not per image.
This means you can have:

Minor Step Pins Numbers
step2.1.jpg Pin 1 1
step2.3.jpg Pin 2 2
step2.5.jpg Pin 3 3

The counter is stored in each step.meta.json as pinNext, so numbering resumes correctly when you add more pins later.

{
  "title": "Install Front Housing",
  "caption": "Align halves and fasten screws",
  "tools": ["Hex Key 2.5mm"],
  "parts": ["Socket Head Cap Screw #6-32"],
  "pinNext": 4
}

๐Ÿงท How It Works

  • Every time you drop a new pin, Studio assigns the next available number (pinNext) and automatically updates the counter in step.meta.json.
  • The number is stored inside each pinโ€™s data ("n": 2) and drawn consistently across all thumbnails.
  • Editing a pinโ€™s number in the Inspector updates its JSON immediately.

๐Ÿ” Renumber Pins Button

If youโ€™ve imported old *.annot.json files or want to reset numbering:

  1. Open the major step folder.
  2. Click Renumber pins (step-wide) in the top bar.
  3. Studio scans all images in the step, assigns sequential numbers starting from 1, and updates both the JSON files and pinNext.

Youโ€™ll see a console log such as:

Renumbered pins 1..12 across 5 image(s).

๐Ÿ’พ Auto-Save Behavior

To prevent โ€œlostโ€ numbering when switching images:

  • Studio now tracks a dirty flag.
  • When you switch thumbnails or steps, or press Ctrl + S, it writes the current imageโ€™s .annot.json automatically.
  • The Save All button also performs a quick auto-save of the active image first.
  • If you try to close the tab with unsaved edits, the browser shows a warning.
Action Shortcut Notes
Add Pin P then Click Uses next step-wide number
Edit Pin Number Select Pin โ†’ Inspector Change Pin # field
Renumber All Pins Button Sequentially re-indexes pins in this step
Auto-Save Ctrl + S or image change Writes current .annot.json
Undo / Redo Ctrl + Z / Ctrl + Y Works on pin edits too

โš™๏ธ JSON Compatibility

Old annotation files without the "n" field still work.
During render, Studio falls back to per-image numbering (1..N).
You can run Renumber pins once to migrate legacy steps.


  1. Annotate pins normally across thumbnails in a step.
  2. Use Ctrl + S or navigate to another image to auto-save.
  3. If numbers ever get inconsistent, click Renumber pins (step-wide).
  4. Continue numbering seamlessly from the last assigned pin.

๐Ÿ”„ Compatibility and Backward Safety

  • Existing steps with older *.annot.json (no pin numbers) still render correctly.
  • Old guides can be migrated using the Renumber pins (step-wide) button.
  • Missing JSON files cause no errorsโ€”just no overlay.
  • All generated Markdown remains standard HTML + Markdown, so even without JS, images display correctly.

๐Ÿงฐ Example Folder and Output

Example Folder:

assembly/
 โ”œโ”€โ”€ step1/
 โ”‚   โ”œโ”€โ”€ step1.1.jpg
 โ”‚   โ”œโ”€โ”€ step1.1.annot.json
 โ”‚   โ”œโ”€โ”€ step1.md
 โ”‚   โ””โ”€โ”€ step.meta.json
 โ”œโ”€โ”€ step2/
 โ”‚   โ”œโ”€โ”€ step2.1.jpg
 โ”‚   โ”œโ”€โ”€ step2.2.jpg
 โ”‚   โ”œโ”€โ”€ step2.1.annot.json
 โ”‚   โ”œโ”€โ”€ step2.2.annot.json
 โ”‚   โ”œโ”€โ”€ step2.md
 โ”‚   โ””โ”€โ”€ step.meta.json
 โ””โ”€โ”€ guide.md

Generated Markdown (excerpt):

## Step 2 โ€“ Assemble Housing

<p class="muted">1 โ€“ Align the halves<br>2 โ€“ Insert the screws</p>

<div class="cf-step-gallery" style="--cf-main-w: 640px; --cf-thumb-w: 64px;">
  <a class="cf-zoom" href="../step2/step2.1.jpg" target="_blank" rel="noopener">
    <img class="cf-main" src="../step2/step2.1.jpg" alt="Step main"
         data-annot-src="../step2/step2.1.annot.json">
  </a>
  <div class="cf-thumbs">
    <img src="../step2/step2.1.jpg" alt="step2.1.jpg">
    <img src="../step2/step2.2.jpg" alt="step2.2.jpg">
  </div>
</div>


๐Ÿง‘โ€๐Ÿ’ป Technical Notes

  • Pure HTML + JS โ€” no build process required.
  • Uses the File System Access API (requires Chrome/Edge).
  • JSON schemas are simple and human-readable; easy to version control.
  • Works with mkdocs-material or any MkDocs theme.
  • All annotations render via inline SVG; nothing external required.
  • Persistent local storage remembers your working folder between sessions.

  1. Set up structure โ€“ create assembly/stepN/ folders.
  2. Open studio โ€“ point it to assembly/.
  3. Annotate images โ€“ draw pins, boxes, etc.
  4. Write metadata โ€“ description, tools, parts.
  5. Generate step.md for each folder.
  6. Build guide.md once all steps are done.
  7. Serve with MkDocs โ€“ done.

๐Ÿง‘โ€๐Ÿซ Example Use Case

Scenario Outcome
Teaching a student to assemble the Cyber Fidget Step-by-step guide with clickable annotations
Showing machining or PCB assembly order Each step folder contains photos from each operation
Documenting a teardown Reverse the step order; same structure works
Open-source community repair guide Contributors can edit JSONs/Markdown directly and regenerate locally

โค๏ธ Credits & License

Developed by Sam Steele for the Cyber Fidget project.
Open for educational and maker use โ€” feel free to adapt it for your own MkDocs projects.
If you fork or improve it, please credit the original and share your enhancements!