-
Notifications
You must be signed in to change notification settings - Fork 104
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
Pass arbitrary DjVu text annotations to frontend #909
Pass arbitrary DjVu text annotations to frontend #909
Conversation
d8fab33
to
85120d4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm for a rebase
Btw, in principle the coding style of the project is with 4 spaces instead of tabs, but I suppose we should just keep this file in tabs. But part of me wonders if we should migrate "organically". ;-) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is much clearer btw, thanks!
@Frenzie Thanks for the props! I put a Doxygen-style comment header on |
Strange that |
The project is mainly Lua. We don't really have any formal C conventions. However, if it doesn't matter for Doxygen then it might be best to stick closer to the luadoc style for project-wide consistency, in this case with an
It's not related to this PR. It's some issue with the Docker Clang container I made, but I can't reproduce it locally (in the exact same Docker container) and the CircleCI SSH login didn't work for me yesterday. I have no idea why it's failing. |
Partially addresses koreader/koreader#2943. This just transparently translates the annotation tree into a Lua table. The frontend needs to be prepared to handle this more flexible structure. Fortunately, almost all DjVu files in practice adhere to the rigid `page -> line -> word` hierarchy, so this patch should transparently work without any noticeable difference in practice.
The code in `djvu.c` contains a lot of repetition and magic numbers/strings. This makes an inital attempt at factoring some of that into reusable, self-documenting units. The `lua_settable_djvu_anno` is then refactored to use these new definitions.
85120d4
to
bfc172e
Compare
Pushed change to comment. Doxygen accepts |
Mainly for the switch to the C BB by default on Kobo/Kindle/PB But also includes: CI tweaks: koreader/koreader-base#907 koreader/koreader-base#911 DjVu tweaks: koreader/koreader-base#909 SDL2 tweaks: koreader/koreader-base#910
Mainly for the switch to the C BB by default on Kobo/Kindle/PB But also includes: CI tweaks: koreader/koreader-base#907 koreader/koreader-base#911 DjVu tweaks: koreader/koreader-base#909 SDL2 tweaks: koreader/koreader-base#910
Mainly for the switch to the C BB by default on Kobo/Kindle/PB But also includes: CI tweaks: koreader/koreader-base#907 koreader/koreader-base#911 DjVu tweaks: koreader/koreader-base#909 SDL2 tweaks: koreader/koreader-base#910
Overview
Partially addresses koreader/koreader#2943.
This just transparently translates the annotation tree into a Lua table. The frontend needs to be prepared to handle this more flexible structure. Fortunately, almost all DjVu files in practice adhere to the rigid
page -> line -> word
hierarchy, so this patch should transparently work without any noticeable difference in practice.Comments
The final product here is my original implementation, which departs from the prevailing style of
djvu.c
, so I made an attempt at orthogonalizing style choices into the second commit.Currently,
djvu.c
has a lot of magic numbers and repeated code, so my goal was to give these understandable names and make them reusable. Arguably, this should be it's own pull request, and be carried out file-wide, but I figured that the comparison here might help review, so am including it.