Markdown Converter
Agent skill for markdown-converter
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Sign in to like and favorite skills
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
BookmarkletIncludes is a reusable JavaScript/CSS library for creating bookmarklets. It provides a unified
BMS (Bookmarklet Suite) namespace with world-class UI components, sophisticated animations, and utilities to simplify bookmarklet creation and reduce file sizes.
The project includes a comprehensive components library (
components/ directory) with:
All components:
prefers-reduced-motion supportThe project follows a modular architecture with zero external dependencies:
JavaScript/bookmarklet-suite.js - Provides the BMS namespace with UI, DOM, and Utils modulesCSS/bookmarklet-suite.css - All styles use .bms- prefix for isolationJavaScript/*-refactored.js that depend on BMSBookmarklets/loaders/*.js that inject BMS and the bookmarklet scriptwindow.BMS = { config: {}, // Configuration options init(options), // Initialize BMS and inject CSS UI: { // UI Components createPanel(), // Draggable, resizable panels with tabs createModal(), // Modal dialogs showSpinner(), // Loading indicators updateStatus() // Status messages (auto-dismiss) }, DOM: { // DOM utilities select(), // querySelector wrapper selectAll(), // querySelectorAll wrapper setHTML() // Safe innerHTML (strips scripts) }, Utils: { // Utility functions generateId(), // Unique ID generation copyToClipboard(),// Clipboard operations throttle(), // Rate limiting debounce(), // Delayed execution parseEngagementCount() // Parse K/M/B notation } }
JavaScript/MyBookmarklet-refactored.js:BMS.runMyBookmarklet = async function() { if (!window.BMS) { alert("BMS not loaded"); return; } // Load required components try { await BMS.loadComponents([ 'core/panel/panel', 'data-display/table/table', 'interactive/animation-effects/animations' ]); } catch (error) { console.error('Failed to load components:', error); } // Use enhanced components if available if (BMS.UI.Components && BMS.UI.Components.Panel) { const panel = BMS.UI.Components.Panel.create({ title: '🚀 My Bookmarklet', content: 'Your content here', position: { top: 50, left: 50 }, size: { width: 600, height: 400 }, animation: true, theme: 'dark' }); if (BMS.UI.Animations) { BMS.UI.Animations.scale(panel, { duration: 400 }); } } else { // Fallback to basic panel BMS.UI.createPanel({ title: 'My Bookmarklet', content: 'Your content here' }); } }; BMS.runMyBookmarklet();
Bookmarklets/loaders/MyBookmarklet-loader.js (minified, single-line):javascript:(function(){const SUITE_URL='https://raw.githubusercontent.com/SOELexicon/BookmarkletIncludes/refs/heads/main/JavaScript/bookmarklet-suite.js';const SCRIPT_URL='https://raw.githubusercontent.com/SOELexicon/BookmarkletIncludes/refs/heads/main/JavaScript/MyBookmarklet-refactored.js';if(window.BMS){const script=document.createElement('script');script.src=SCRIPT_URL;document.body.appendChild(script);return;}const suiteScript=document.createElement('script');suiteScript.src=SUITE_URL;suiteScript.onload=()=>{BMS.init();const script=document.createElement('script');script.src=SCRIPT_URL;document.body.appendChild(script);};document.body.appendChild(suiteScript);})();
No build process required. Test bookmarklets by:
Open test HTML files directly in a browser:
test.html - General BMS component testingHtmlAnalyser-test.html - Framework detection testingJsonExtract-test.html - JSON-LD extraction testingTwitterMediaExtractor-test.html - Media extraction testingRun comprehensive tests via
JavaScript/test-bookmarklet.js which tests all BMS features
CRITICAL: Bookmarklets CANNOT run on websites with strict Content Security Policy headers.
GitHub.com is IMPOSSIBLE for bookmarklets because it blocks:
script-src github.githubassets.com only)unsafe-inline)unsafe-eval)Other sites where bookmarklets will NOT work:
script-src without unsafe-inlineSites where bookmarklets WILL work:
DO NOT test bookmarklets on GitHub.com - use the local HTML test files instead, or test on Twitter/Wikipedia.
Technical details: The loaders fetch JavaScript code and inject it as inline scripts using
script.textContent. This bypasses most CSP restrictions, but sites like GitHub explicitly block inline scripts. This is a fundamental browser security feature, not a bug.
bms- to avoid conflicts_makeDraggable)https://raw.githubusercontent.com/SOELexicon/BookmarkletIncludes/refs/heads/main/ as the base URLBMS.DOM.setHTML() instead of direct innerHTML to prevent script injectionawait BMS.loadComponents([...]) to load components dynamicallyComponents are loaded dynamically from GitHub:
// Load single component await BMS.loadComponent('core/panel/panel'); // Load multiple components await BMS.loadComponents([ 'core/panel/panel', 'data-display/table/table', 'interactive/animation-effects/animations' ]);
Components are cached after first load to improve performance.
Since this is a plain JavaScript/CSS project with no build system:
*-test.html file in a browserThe refactored approach significantly reduces bookmarklet sizes:
The shared BMS library (bookmarklet-suite.js) is cached after first load, making subsequent bookmarklet executions faster.