I thought it was better to create a MDX version of oxford paravia english-italian, since there’s no MDX of that dictionary, so I created that.
29/2/20: first release OxfordParavia.zip (17,7 MB)
29/3/20:
merged two parts into one mdx file (thanks to @hua)
included a css and an empty js in the mdx (thanks to @hua)
now it’s more human-readable, adding orange color to the phrase to be translated, thanks to css (thanks to @kwomnk)
removed padding between a phrase and another one, as it took up too much space and it made longer the entry definition
added blue color in css, for meaning and green for alternative forms of entries below the entry
Hello @hua . I and @kwomnk tried several times to include these CSS on both IT-EN and EN-IT parts, but they didn’t work on GoldenDict, but they did on Eudic, beacuse it can recognise the CSS according to the MDX filename.
Could you try to include them? Thanks OPCSS.7z (449 Byte)
Okay, let me explain how my fix works. MDX in nature is a collection of HTML files and in HTML files you will need to declare which css or js file you are going to use.
The issue with your file is, HTML codes don’t come with declarations, so goldendict does not know which css or js file it uses for the dict. I add declarations to the content of each entry, so problem solved. By the way, I have combined the two dicts. If you like separate files, you can do it following the method and screenshot I provide here. I also make a combined cover the two dicts, haha.
As for eudic, I guess it will automatically recognise and apply the css file with the same file name as MDX files.
I put my python code for processing here, which is easy to understand, for those who may need.
read1 = open('done.txt', 'r', encoding="utf8").readlines()
write1 = open('done_add.txt', 'w', encoding="utf8")
js_css = """<link rel="stylesheet" href="oxford_paravia_en22ita.css" type="text/css" ><script type="text/javascript" src="oxford_paravia_en22ita.js"></script>"""
for line in read1:
if '<div>' in line:
line = js_css + line
write1.write(line)
write1.close()
Wow! Thank you! That’s much better than I did! Next time I want to include a css in a mdx, I’ll use that python code!
Could you please explain how you combined two mdx/mdd files?
Thank you so much for the explanation. If I understand correctly, when creating a mdx, however the entries are sorted, the mdxeditor sorts alphabetically, so it’s not a problem when two dictionaries in txt format are merged into a one txt.