How iggredible/copy-formatter works
Project type and purpose
• This is a Chrome browser extension (“Copy Formatter”) that intercepts copy‐paste operations and applies user‐defined formatting templates (e.g., Markdown links).
• Key indicators: presence of manifest.json, background.js, src/views/popup, src/views/options, use of Chrome extension APIs, README describing a right-click/context-menu tool.
File structure
Top-level:
• manifest.json – extension metadata and permissions
• background.js – background script (event listeners, context menu registration)
• src/ – core logic modules (clipboard, formatters, menus, storage, defaultMenuItems)
• src/views/ – UI for popup (action and content) and options page
• package.json / package-lock.json – Node toolchain, build scripts, dependencies
Patterns & roles:
• background script = central event hub
• content script(s) (e.g., clipboard.js injected?)
• UI pages (popup.html/js, options.html/js)
• Storage module abstracts chrome.storage API
• Formatters define pluggable template functions
README for additional insights
• Describes workflow: select text → open context menu or keyboard shortcut → choose template → paste auto-formatted text
• Mentions “templates,” “clipboard,” “Obsidian markdown,” “Vimium integration”
Elements
• Blue for extension “core logic” modules
• Green for UI components
• Orange for Chrome APIs/external services