How fengdh/mdict-js works
Project type and purpose
• mdict-js is an open-source, client-side JavaScript library and demo application for parsing and rendering MDict dictionary files (mdx/mdd) entirely in the browser.
• Its purpose is to load local mdx/mdd files, parse headers and indices, decompress/encrypt data blocks, and render definitions and embedded resources without any server-side processing.
File structure
• Top-level HTML demos: mdict.html (main dictionary UI), profiler.html (performance profiling).
• Core modules (pure JS files):
• mdict-parser.js / mdict-parser-legacy.js – handle file I/O, header and index parsing
• mdict-renderer.js – converts parsed data into DOM or HTML snippets
• lzo-wrapper.js / minilzo-decompress.js / speex.js – decompression routines (LZO, Speex audio)
• ripemd128.js – decryption of keyword indices
• murmurhash3.js – hashing support
• mdict-common.js – shared utilities
• profile.js – performance measurement
• Configuration and loaders: conf.js (settings), require.js (AMD module loader), bluebird (Promise support).
• No backend code or database: all browser-side.
README for additional insights
• Emphasizes pure-JS, no native dependencies, asynchronous Promise-based API, support for compression/encryption, on-demand block loading, low memory usage.
• Lists features and TODOs around plugin/extension points (stylesheets, caching, scoped CSS, Node.js module).