Files
insertr/AGENTS.md
Joakim b7998a4b3c feat: Implement HTML-first style preservation system
- Add StyleContext class for extracting and applying HTML attributes/styles
- Enhance MarkdownConverter with style-aware conversion methods
- Switch backend storage from markdown to HTML with 'html' content type
- Update editor workflow to preserve CSS classes, IDs, and attributes
- Maintain markdown editing UX while storing HTML for style preservation
- Support complex attributes like rel, data-*, aria-*, etc.

This enables editing styled content like <a class="fancy" rel="me">text</a>
while preserving all styling attributes through the markdown editing process.
2025-09-19 16:03:05 +02:00

1.0 KiB

AGENTS.md - Developer Guide for Insertr

Build/Test Commands

  • just dev - Full-stack development (recommended)
  • just build - Build entire project (Go binary + JS library)
  • just build-lib - Build JS library only

For running and testing our application read our justfile.

Code Style Guidelines

Go (Backend)

  • Use standard Go formatting (gofmt)
  • Package imports: stdlib → third-party → internal
  • Error handling: always check and handle errors
  • Naming: camelCase for local vars, PascalCase for exported
  • Comments: package-level comments, exported functions documented

JavaScript (Frontend)

  • ES6+ modules, no CommonJS
  • camelCase for variables/functions, PascalCase for classes
  • Use const/let, avoid var
  • Prefer template literals over string concatenation
  • Export classes/functions explicitly, avoid default exports when multiple exports exist

Database

  • Use sqlc for Go database code generation
  • SQL files in db/queries/, schemas in db/{sqlite,postgresql}/schema.sql
  • Run just sqlc after schema changes