Giter Site home page Giter Site logo

Comments (8)

ijgnd avatar ijgnd commented on July 18, 2024 1

Thanks for your reply. When reading this keep my my coding skills in mind ...

Did you have some experience updating add-ons for 2.1.50? Did you need to provide both a qt5 and qt6 version?

I have updated most of my add-ons to qt6. So far I haven't run into or heard of major problems. It's been mostly boring work.

I adjusted my build script so that it generates a forms5 and forms6 folder and I adjusted all the imports with if qtmajor == 5 .. else .... In the custom styles add-on this meant just changing one line in the bin/compile.sh file.

The other part was adjusting to the new-style PyQt scoped enums. Apparently pyqt5 got support for this new enum style around PyQt 5.11 which was already used in Anki 2.1.15. So it was some one-time work and I don't have to maintain different branches of the add-on. I have some add-ons like my fairly popular Extended Tag Add_Edit Dialog uploaded to ankiweb some weeks ago for anki .15+ and so far I haven't gotten bug reports related to these new-style enums.

Apart from these two well known areas I only had two or three minor problems that were quick fixes.

For the custom styles add-on I've already made the needed changes to the gui so that it works in qt6 or qt5 (at least for me in linux and windows, see this branch so that only the code related to the editor needs to be adjusted.

Right now, I'm thinking it might even be wiser to rewrite the add-on from scratch, and simply make it compatible with the configurations of this add-on.

I agree that a full rewrite (i.e. removing my code and my config design) would improve this add-on. But this sounds pretty time-consuming and I very much prefer a mediocre but working add-on to none at all ... And I'm actually using this add-on a lot.

I think it should be much quicker to make minimal fixes so that in the editor wrapping with custom classes works again and that the custom css for the classes is loaded into the editor. I thought that by looking at the old code you could do a relatively quick fix for wrapping in the editor in this file and the webview of the editor here (where you can throw out most of the code that was related to the old rangy library) and treat the rest of the add-on as a blackbox?

The only thing making me anxious about this project is maintaining backwards compatibility.

I hope I don't miss anything. But as far as I see the add-on worked until .44. For .45-.49 I'd just show a message to update to .50. Since the old config is used people could downgrade to .44 or older.

from anki__editor__apply__font_color__background_color__custom_class__custom_style.

ijgnd avatar ijgnd commented on July 18, 2024

that's because of changes in the editor in 2.1.50. That's just one area where this add-on is broken in 2.1.50 due to the improvements in 2.1.50.

@hgiesel: If you think that the 2.1.50 editor is sufficiently stable I'd appreciate it if you could adopt the editor part of this add-on: the application of the classes around selected text and the way the css is injected into the fields. I would probably fail at the moment.

I made some simple preparations in a new branch yesterday if you are already on qt6: I switched all imports from "from PyQt5..." to "from aqt.qt import ..." and the build script now builds two forms files, see baba5fb

Thanks for your help and - in general - all your work on Anki itself to bring exact surrounding features into it.

from anki__editor__apply__font_color__background_color__custom_class__custom_style.

hgiesel avatar hgiesel commented on July 18, 2024

Yes, updating this add-on is on my to-do list for 2.1.50... The surrounding feature is already in Anki (though not exported), and I think a built-in "inject user template CSS" PR is only a few PRs away at this point, so maybe we'll be able to squeeze it in :)

from anki__editor__apply__font_color__background_color__custom_class__custom_style.

ijgnd avatar ijgnd commented on July 18, 2024

thanks @hgiesel. that's great news.

from anki__editor__apply__font_color__background_color__custom_class__custom_style.

ijgnd avatar ijgnd commented on July 18, 2024

@hgiesel: Just bumping this topic. Sorry for bothering you. I know that you usually update add-ons after a final release. But this time we have a much longer beta period than usual and you seem to already have moved on to the new fields window and I guess that having a fresh memory of the editor code you wrote makes it easier to update this add-on earlier.

And once more thanks for maintaining this add-on.

from anki__editor__apply__font_color__background_color__custom_class__custom_style.

hgiesel avatar hgiesel commented on July 18, 2024

No problem. I would never complain about somebody reminding me about my todos :)

The only thing making me anxious about this project is maintaining backwards compatibility. Right now, I'm thinking it might even be wiser to rewrite the add-on from scratch, and simply make it compatible with the configurations of this add-on.

Did you have some experience updating add-ons for 2.1.50? Did you need to provide both a qt5 and qt6 version?

from anki__editor__apply__font_color__background_color__custom_class__custom_style.

SnakeHit avatar SnakeHit commented on July 18, 2024

Need support for 2.1.50, Thanks for anki users

from anki__editor__apply__font_color__background_color__custom_class__custom_style.

ijgnd avatar ijgnd commented on July 18, 2024

@hgiesel : Would you also be interested in taking over my add-on remove linebreaks / do word wrap which seems to have some users? For 2.1.50 one 15 loc js function in this add-on (to get the selection and re-insert it) needs to be adjusted. It should only take you a moment whereas I'd would take much longer for me.

from anki__editor__apply__font_color__background_color__custom_class__custom_style.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.