-
Notifications
You must be signed in to change notification settings - Fork 240
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
New DSL plugin #492
New DSL plugin #492
Conversation
457ff80
to
0d410e5
Compare
I checked several dicts and it looks pretty well, awesome job! Although, I found these 2 cases that didn't work as expected (see the files HERE):
![]() ![]()
![]() IMPORTANT. I think we need to convert [/m] to UPDATED: Do you have Goldendict for Windows installed? Can you check how they render those DSLs? |
Thanks. Also looks like |
GoldenDict crashes when I add a directory that only contains |
The same goes for |
I will ask dictionary creators about this on a forum. But the best way to know this — is to compile DSL into LSD and open in Lingvo program on WIndows.
I am clueless, because I have no problems in Goldendict mobile app. Should we try DSL compiler ourselves? Unfortunately, I won't have Windows machine till the end of summer. |
If this plugin is as good as the master branch or better, I can merge it and figure out the details later. |
What do the tests report? Does this module produce identical results? |
Most of tests in |
The easiest way is to convert small glossaries, look at their output in browser, and then add them to tests. |
8aecea0
to
990c067
Compare
I think this plugin will almost never produce the same HTML codes as the current one, because of the reasons I explained (we don't mess with openings and closings) but it's probably better in most cases. |
Question: what do lines starting with
|
We also transform the whole entry text rather parsing one line at a time which makes no sense to me. |
I agree.
DSL is exactly the opposite. Only what is DSL parser allows — only this formatting is allowed. In case of any mistake, parser returns error and doesn't compile a dictionary.
I think that probably we need to add |
Confirmed that GoldenDict does add a newline as well. Now we add a Can you also confirm this fixes #491? I have seen many examples that this PR fixes existing issues with the old code. |
The script crashes while converting |
|
1b4da4c
to
b2bee47
Compare
Fixed. |
I am driving today and tomorrow and I will be free to test tomorrow. You wrote this code, therefore I have a question, whether you have thought about adding unit testing of the new DSL plugin? Testing "DSl-to-tabfile" is too unstable (test files change and tests fail each time formatting changes). I really liked the tests that @ratijas |
I am looking at the resulting HTML. I am wondering, why you don't use CSS styles instead of inline |
That is CSS. |
OK, I didn't know that! That would be great, but it's not that critical. |
Actually for slob it's not going to make a huge difference because of compression. Only makes sense to me to optimize if the output is not compressable. |
BMP file is disappeared (see sample dir). |
What dictionary app are you testing with? Are you sure it works with master? |
I used this |
Oh okay. That's a bug in html dir plugin. |
@soshial Can you please start testing this branch?
Note that we don't care about unclosed or mismatched tags (due to user error), as long as it looks right in browser. Since both HTML and DSL are permissive, and any browser or HTML rendering engine should be able to handle these problems better than us.
@ratijas I would appreciate if you can take a look at the code as well.
This design was inspired to me by this video from Rob Pike several years ago, which also inspired me to write repassgen.