Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do you know any javascript library to create mdx file? #11

Open
liuwenchao opened this issue Nov 20, 2022 · 1 comment
Open

Do you know any javascript library to create mdx file? #11

liuwenchao opened this issue Nov 20, 2022 · 1 comment

Comments

@liuwenchao
Copy link

mdict-js is a nice tool to read mdx file, do you happen to look into the possibility to pack txt files to create mdx file, like mdict-utils?

Thank you for any help and comment!

@liuwenchao
Copy link
Author

Example of desired solution:

dictionary = {"doe": "<b>doe</b> <i>n.</i> a deer, a female deer.",
              "ray": "<b>ray</b> <i>n.</i> a drop of golden sun.",
              "me": "<b>me</b> <i>pron.</i> a name I call myself.",
              "far": "<b>far</b> <i>adv.</i> a long, long way to run."}

writer = MDictWriter(dictionary, title="Example Dictionary", description="This is an example dictionary.")
outfile = open("dictionary.mdx", "wb")
writer.write(outfile)
outfile.close()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant