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

mdx to slob: .ini file is not working #289

Closed
rhjdvsgsgks opened this issue Jan 17, 2021 · 22 comments
Closed

mdx to slob: .ini file is not working #289

rhjdvsgsgks opened this issue Jan 17, 2021 · 22 comments

Comments

@rhjdvsgsgks
Copy link

as the title said, css and audio will lost when converting mdict to slob, there is some error in logs while converting

[ERROR] unknown content type for xxx.mp3

and the dictionary seems like not showed correctly in aard2 (maybe caused by lost of css)
pic

ilius added a commit that referenced this issue Jan 17, 2021
@ilius ilius added the Bug label Jan 17, 2021
@ilius
Copy link
Owner

ilius commented Jan 17, 2021

Please try again.

@rhjdvsgsgks
Copy link
Author

audio file seems be inserted to slob (file size is significantly larger than before) and error log not showed when converting anymore, but css still not loaded.
this is what it should like if css(or something like that) successfully loaded
pic

and pronunciation will not be played when pressing pronunciation button, it will jump to a white page rather than play the audio, i don't know it's a bug of pyglossary or aard2

@ilius ilius changed the title css and audio will lost when convert mdict to slob mdx to slob: css and audio lost Jan 17, 2021
@ilius ilius pinned this issue Jun 7, 2021
@ilius ilius unpinned this issue Jun 7, 2021
@ilius
Copy link
Owner

ilius commented Jun 11, 2021

I can see the CSS when I test with Aard2 web application (browser) and colors seem to be working.
I don't think the issue comes from PyGlossary.

Can you also test with Aard2 web application?
https://github.com/itkach/aard2-web

@rhjdvsgsgks
Copy link
Author

still same

@ilius
Copy link
Owner

ilius commented Jun 11, 2021

Can you attach your mdx glossary?

@ilius ilius changed the title mdx to slob: css and audio lost mdx to slob: CSS is not working Jun 11, 2021
@rhjdvsgsgks
Copy link
Author

"the little dict" is too large that i can't upload it, but "word frequency" dict also have this problem, so i upload it as a alternative
1.tar.gz

@ilius
Copy link
Owner

ilius commented Jun 11, 2021

Oh I see!
The other files (css, js, png) are all simply ignored by PyGlossary!
They are supposed to be inside an .mdd file!
At least, that's what I have seen so far!

Where did you download this glossary from?
Are there more like it? (resource files in an archive with the mdx file)

@rhjdvsgsgks
Copy link
Author

i download these dict from a chinese forum (pdawiki), most of mdx download from that forum have similar structure, and this structure is recognized by a dictionary application which most used in china (欧路词典)

@ilius
Copy link
Owner

ilius commented Jun 12, 2021

Can you give me the list of file names inside several other glossaries like this?

@rhjdvsgsgks
Copy link
Author

The\ little\ dict/
├── cluk.png
├── clunkn.png
├── clus.png
├── config.ini
├── cuk.png
├── cus.png
├── d.png
├── fy.js
├── luk.png
├── lus.png
├── mw.png
├── ouk.png
├── ous.png
├── p.css
├── TLD.1.mdd
├── TLD.2.mdd
├── TLD.3.mdd
├── TLD.4.mdd
├── TLD.5.mdd
├── TLD.6.mdd
├── TLD.mdd
├── TLD.mdx
├── TLD.png
└── v.png

and here is the archive of it, but without mdx/mdd file (they are too large)
1.tar.gz

@ilius
Copy link
Owner

ilius commented Jun 12, 2021

I added a read-option named same_dir_data_files for this use case.
Please try again by adding command line flag --read-options same_dir_data_files=true

@rhjdvsgsgks
Copy link
Author


it works🎉

@rhjdvsgsgks
Copy link
Author

ini(text/plain) file should also be added to slob(some glossary will use it to store config), otherwise some page will still showed as a blank page.

@ilius
Copy link
Owner

ilius commented Jun 14, 2021

All files in that directory are added.
I'm not sure how .ini file is supposed to be displayed in html though.

@rhjdvsgsgks
Copy link
Author

config.ini will be loaded by

<script src="config.ini"></script>

then load fy.js, in it config will be checked by

if (!window.someconfig) {
	$("somediv").hide();
}

so, if config file not exist, all things will be hidden

@ilius
Copy link
Owner

ilius commented Jun 18, 2021

Please try to find a mdx glossary that you can upload.
I suggest https://mega.nz/

@rhjdvsgsgks
Copy link
Author

rhjdvsgsgks commented Jun 19, 2021

upload finished, will be expired in a week, please let me know if download finished.

@ilius
Copy link
Owner

ilius commented Jun 19, 2021

I downloaded.

@ilius
Copy link
Owner

ilius commented Jun 19, 2021

Please also upload config.ini and js files.

@rhjdvsgsgks
Copy link
Author

The\ little\ dict/
├── cluk.png
├── clunkn.png
├── clus.png
├── config.ini
├── cuk.png
├── cus.png
├── d.png
├── fy.js
├── luk.png
├── lus.png
├── mw.png
├── ouk.png
├── ous.png
├── p.css
├── TLD.1.mdd
├── TLD.2.mdd
├── TLD.3.mdd
├── TLD.4.mdd
├── TLD.5.mdd
├── TLD.6.mdd
├── TLD.mdd
├── TLD.mdx
├── TLD.png
└── v.png

and here is the archive of it, but without mdx/mdd file (they are too large)
1.tar.gz

already exist here

@ilius ilius reopened this Jun 19, 2021
@ilius ilius changed the title mdx to slob: CSS is not working mdx to slob: .ini file is not working Jun 19, 2021
@ilius ilius removed the Q&A label Jun 19, 2021
@ilius
Copy link
Owner

ilius commented Jun 19, 2021

I pushed a fix.
Please try again.

@rhjdvsgsgks
Copy link
Author

rhjdvsgsgks commented Jun 19, 2021

problem resolved

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

No branches or pull requests

2 participants