GithubHelp home page GithubHelp logo

kleinerpirat / anki-css-injector Goto Github PK

View Code? Open in Web Editor NEW
7.0 7.0 2.0 142 KB

Allows you to style field content in Anki's editor.

Shell 18.97% Python 17.45% JavaScript 25.81% TypeScript 32.77% CSS 5.00%

anki-css-injector's People

Contributors

kleinerpirat avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

anki-css-injector's Issues

anki-editable `field` attribute is empty in Anki 2.1.55

It seems like the field attribute no longer works on the newest version of Anki.
For example, using the Anki webview addon, I get the following information:

<anki-editable contenteditable="true" class="svelte-18uwveo isLin nightMode night_mode" field="" ord="7" editor="svelte" pointversion="55" notetype="JP Mining Note" mid="1637704315966" style="--editor-shrink-max-width:250px; --editor-shrink-max-height:125px;">TEXT<br></anki-editable>

apply css from other addons, eg with custom hook or load multiple files

Your add-on is great. I'd like to have its functionality in other add-ons, e.g. Custom Styles (font color, background colour, classes). I can also imagine other add-ons (apart from the custom classes add-on or some syntax highlighting stuff) that want to style text in the editor.

At the moment each add-on would have to duplicate the code from your add-on and all these add-ons would have to be updated individually. This is not efficient.

It would be very useful (at least for me) if your add-on gathered css from various add-ons and applied it into the editor.

Maybe your add-on could load multiple files (either from the user data folder of your addon or the media folder) or maybe it could collect the css with a custom hook from other add-ons. The latter approach was used by lovac42' ReMemorize, see here.

Would you be interested in this and if so which approach would you accept?

Can't inject css into certain views

Hey @kleinerpirat,

I really love the idea of injecting css to customize anki. However, I couldn't get it to work following the guide provided. No matter what selectors I use, they have no effect. They don't even show up in the inspector. I tried editing both editor.css and field.css. I am using version 2.1.47. I disabled all other extensions.

What could cause my problem? Do you have any ideas?

Thanks in advance.

After updating to Qt6 I managed to inject to css into some views. But other views remain uneditable (e.g. the congrats "you learned all cards for today" menu). Is there a workaround?

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.