# MDX SDK

**URL:** <https://forum.freemdict.com/t/topic/29217>\
**Category:** 技术交流与词典编修\
**Tags:** mdx, opensource\
**Created:** [2024 年6 月 6 日 17:37 UTC](https://forum.freemdict.com/t/topic/29217 "2024-06-06T17:37:04Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon38366553](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/a/3da27b/32.png) [@anon38366553](https://forum.freemdict.com/u/anon38366553)\
**Post date:** [2024 年6 月 6 日 17:37 UTC](https://forum.freemdict.com/t/topic/29217/1 "2024-06-06T17:37:04Z")

</div>

i wanted to create a mdx SDK in c++ and i think this is the right place to ask.  
i dont know much about the mdict format, but i know that some people have done for reverse engineering in it, but the knowledge is too distributed, and it’d be better to collect everything into a single place.

that SDK proposal would help the future generations to have access to mdict dictionaries, preserving the format and the work of those who make dictionaries in that.

the mdx SDK would be able to:

- get information about dictionaries
- retrieve html
- get css  
and much more.  
please notice that this is different from mdict-utils for example, which aims to be a helper for those who want to **build** dictionaries, our SDK will instead enable programmers to develop more dictionary apps for a lot of platforms, by using our SDK they dont need to hold any previous knowledge about how the mdict format works, they can just read the API documentation and choose which functions to use.

Q. why c++?  
A. because it’s timeless, if the code gets to work today, it will work basically forever, as long as a standard is set. (C++23 for example)

Q. why is that important for programmers to have a mdict library?  
A. because then you can basically develop dictionary apps for the future platforms, or even some non-popular ones

Q. why care about preservation?  
A. because i think that the work of those who make mdx/mdict dictionaries must be valued and the next generations would benefit from it

what do you guys think about that proposal? and if you have any resources for me to study about the mdx/mdict format, please cite it down below

edit: in addtion to what was sent here in the comments, there’s a quite clear explanation for the mdict 2.0 format

> [writemdict/fileformat.md at master · zhansliu/writemdict · GitHub](https://github.com/zhansliu/writemdict/blob/master/fileformat.md)

that file contains all the necessary explanations from a “from scratch” implementation

2025 update:  
contributed to this project:

> **[GitHub - dictlab/mdict-cpp: \*.mdx/\*.mdd file interpreter cpp implementation](https://github.com/dictlab/mdict-cpp)**
>
> \*.mdx/\*.mdd file interpreter cpp implementation

now it’s actively maintained and i’ll keep working on it to provide a better API for developers.

i also made a mdict library for haskell because of my personal needs.

> **[mdict-hs](https://git.ajattix.org/hashirama/mdict-hs/)**
>
> a mdict library for haskell

---

<div class="post-metadata">

**Author:** ![Mandolin](https://forumcdn.freemdict.com/user_avatar/forum.freemdict.com/mandolin/32/4948_2.png) [@Mandolin](https://forum.freemdict.com/u/Mandolin)\
**Post date:** [2024 年6 月 7 日 03:13 UTC](https://forum.freemdict.com/t/topic/29217/2 "2024-06-07T03:13:19Z")

</div>

As far as I know, [mdict-utils](https://github.com/liuyug/mdict-utils) and Mdxbuilder are both compression tools. And MDX format is basically HTML, so maybe SDK for MDX is the same as SDK for HTML, with snippets libraries.

It will be great if someone could create a C++ version of mdict-utils, or an executable one like .exe file.

---

<div class="post-metadata">

**Author:** ![anon38366553](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/a/3da27b/32.png) [@anon38366553](https://forum.freemdict.com/u/anon38366553)\
**Post date:** [2024 年6 月 7 日 04:48 UTC](https://forum.freemdict.com/t/topic/29217/4 "2024-06-07T04:48:39Z")

</div>

as i said in the post, it’s more like a library, rather than a standalone program.  
the library would help other people to use mdx in their projects

---

<div class="post-metadata">

**Author:** ![mdictfan](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/m/a88e57/32.png) [@mdictfan](https://forum.freemdict.com/u/mdictfan)\
**Post date:** [2024 年6 月 7 日 04:53 UTC](https://forum.freemdict.com/t/topic/29217/5 "2024-06-07T04:53:13Z")

</div>

[https://bitbucket.org/xwang/mdict-analysis/src/master/](https://bitbucket.org/xwang/mdict-analysis/src/master/)

---

<div class="post-metadata">

**Author:** ![random](https://forumcdn.freemdict.com/user_avatar/forum.freemdict.com/random/32/19006_2.png) [@random](https://forum.freemdict.com/u/random)\
**Post date:** [2024 年6 月 7 日 07:07 UTC](https://forum.freemdict.com/t/topic/29217/6 "2024-06-07T07:07:25Z")

</div>

不知道有没有Dart版本的sdk

---

<div class="post-metadata">

**Author:** ![anon38366553](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/a/3da27b/32.png) [@anon38366553](https://forum.freemdict.com/u/anon38366553)\
**Post date:** [2024 年6 月 8 日 14:00 UTC](https://forum.freemdict.com/t/topic/29217/7 "2024-06-08T14:00:37Z")

</div>

thank you!

---

<div class="post-metadata">

**Author:** ![anon38366553](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/a/3da27b/32.png) [@anon38366553](https://forum.freemdict.com/u/anon38366553)\
**Post date:** [2025 年4 月 2 日 18:42 UTC](https://forum.freemdict.com/t/topic/29217/8 "2025-04-02T18:42:34Z")

</div>

i recently added a feature for high-level lookup in mdd files.

 ![image](https://forumcdn.freemdict.com/uploads/default/original/3X/2/b/2b5a165cc7b37a1326b5b14ee6585b6772b8aea6.jpeg)

was added in that [PR](https://github.com/dictlab/mdict-cpp/issues/13).

i’ll keep improving the MDD api because we often only see people working at the MDX part (in most projects)

---

<div class="post-metadata">

**Author:** ![anon38366553](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/a/3da27b/32.png) [@anon38366553](https://forum.freemdict.com/u/anon38366553)\
**Post date:** [2025 年4 月 2 日 18:47 UTC](https://forum.freemdict.com/t/topic/29217/9 "2025-04-02T18:47:13Z")

</div>

btw, there is a dart version but it’s not maintained.  
i will first get a pure java version of it working, then i’ll start the dart version.

but it shall be pure, because otherwise it will be a bloat code that wont be really helpful for developers.

---

<div class="post-metadata">

**Author:** ![anon38366553](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/a/3da27b/32.png) [@anon38366553](https://forum.freemdict.com/u/anon38366553)\
**Post date:** [2025 年4 月 13 日 03:07 UTC](https://forum.freemdict.com/t/topic/29217/10 "2025-04-13T03:07:25Z")

</div>

update: mdict-cpp is now very mature and stable, ready to be used in projects of people who want to make their own mdict viewers!

> **[GitHub - dictlab/mdict-cpp: \*.mdx/\*.mdd file interpreter cpp implementation](https://github.com/dictlab/mdict-cpp)**
>
> \*.mdx/\*.mdd file interpreter cpp implementation

---

<div class="post-metadata">

**Author:** ![anon38366553](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/a/3da27b/32.png) [@anon38366553](https://forum.freemdict.com/u/anon38366553)\
**Post date:** [2025 年4 月 15 日 20:27 UTC](https://forum.freemdict.com/t/topic/29217/11 "2025-04-15T20:27:29Z")

</div>

update: high-level functions for dealing with mdd data are coming soon!

 ![image](https://forumcdn.freemdict.com/uploads/default/original/3X/d/1/d1a88787e7799e7f41749bd970d5913bf99db5ff.jpeg)

gathering data from mdd will be much easier in the library now
