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

feat: Support Yomitan v3 schema (focusing on Jitendex) #389

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

shovel-kun
Copy link

@shovel-kun shovel-kun commented Jul 2, 2024

This PR tries to support the latest V3 dict schema provided by Yomitan, with a focus on rendering Jitendex's dictionary entries nicely (see pics).

This is my first time working with mobile dev and Dart/Flutter, so I appreciate your patience.

Changes:

  • Fixes Yomitan/Jitendex entries not rendering properly Incompatible with all new JMDict versions? #386 Yomitan Format #374
  • Jitendex entry word info are rendered as JidoujishoTags for nicer rendering
  • Compatible with older schemas (JMdict, Kanjidic, etc)
  • Rewrote structured_content.dart to more closely follow Yomitan's implementation (didn't have any clue on how to properly process nested children in tags other than divs that are in a list)

Known issues:

  • Custom listStyleType(aka bulletpoints) do not display, resulting in weird bugs.
    • Not sure how to implement, as flutter_html does not support these yet
  • Some cells in tables are off-centered
  • AnkiDroid and card creation broken
    • To be fixed
  • Images rendered out of bounds
    • Not sure how to fix, but a brief 5 min check of dicts gave me the conclusion that images are rare in dictionaries anyways

EDIT: Forgot screenshots
Screenshot_20240702_220320
Screenshot_20240702_220215

@shovel-kun
Copy link
Author

I did a lot of hacky things in 05dd4a1, but the text sent to AnkiDroid should be fairly readable for simple and complex HTML structures.

I've not used the Card Exporter feature before though, so let me know if anything breaks.

Screenshot_20240703_000901

@arianneorpilla
Copy link
Owner

Hi, firstly.

Thank you for your pull request. I think I've been vague for a long time but I'm working on a v3 rewrite of the app which more than addresses the change you want to make, and there have since been some changes in my life that have gotten in the way of that.

I will take a look at your pull request soon, but I want to say -- I appreciate it and I'm happy you're interested to contribute.

@shovel-kun
Copy link
Author

Hi, thanks for the update on what you're working on.

A complete rewrite must be quite a momentous effort though, looking at the code @_@.

Sorry to hear life is getting in the way, I can relate. Take your time with the PR. It was mostly for myself as a learning experience
(which is why it's in draft), so feel free to reject it if you feel like it's too much of a hassle. But if you're reviewing it, then I'd be happy to hear your thoughts on how to improve.

@ApolloFortyNine
Copy link

Hey all, would it be possible to take another look at this pr? Jitendex in my experience is by far the best free dictionary, and even often better than paid ones.

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

Successfully merging this pull request may close these issues.

4 participants