digitalpalidictionary / dpd-db

12 stars 7 forks source link

generate mdd assets file: folder exporter\goldendict\css + icon + javascript #26

Closed windwerfer closed 3 months ago

windwerfer commented 3 months ago

hello, here a possible way to create a .mdd asset file. it adds all files and folders from a given folder recursively.

(i added 3 folders because i didnt want to mess up the folder structure.)

to link the css file css/dpd.css you would write at the moment, because i called get_all_files('exporter/goldendict/css/'). i do not know how you want to structure the mdd file so this is just a proof of concept. (or <img src='android-chrome-512x512.png'> )

for example if you put the css+icon folder into an assets folder and call get_all_files('exporter/goldendict/assets/'), than the path would be

i tested it in the dpd-exporter repository (it worked) and than copy pasted it her, because i still had the pickle data you send last time. i think it should work :-)

if it doesnt, please send me a pickle of the data_list: List[Dict] object that is passed to export_to_mdict() (maybe not the whole one, just a view mb are enough) for testing, and i will be able to troubleshoot.