Comments (4)
It's much more likely that the problem is that you changed your computer and reinstalled the add-on.
Did you modify the config on your old computer?
Some background (the tldr is at the bottom):
Anki uses html in cards. In html you have different ways to apply styling.
E.g. if I want to make some text red and bold I could write style="font-weight: bold; color: red;"
directly into the source code of the field in a note. But you can also use "classes" which my add-on often does. This means in the source code in the note I only have class="bold_red"
. In a different (css) file I define just once how "bold_red" should look like. This has some advantages, e.g. it's quick and easy to change the styling of many notes and this avoids some of the problems I described in the quirks sections on ankiweb.
I think as a user you shouldn't have know about technical details such as classes, css etc. So my add-on tries to hide some of this complexity, e.g. you usually don't have to manually set a class name. So you likely also used classes and maybe without knowing it.
When you install the add-on, whenever you open your profile, and whenever you open and close the config of my add-on it writes the config values related to the styling of classes to the external css file.
But this is a one-way street: My add-on does not read the config from this external css file: Css files are only used to set the styling/appearance for html but my add-on needs additional info like which shortcuts to use etc.
You switched to the new computer. You re-installed my add-on from ankiweb. So on your new computer you get the default config and this default config is written into the external css file. If you had a custom config it's likely that some or most of your entries technically relied on classes. The class-names used in the old config are no longer in your new config and so the add-on can't save any styling to the external css files for the classes from the old config.
So when Anki displays a note or card on your new computer it detects a class and checks the css file but since it doesn't find any special settings for said class in the css file it doesn't modify the styling. So it's visually broken.
How to restore the old config: (Tldr):
- If your old computer still works it's easy: You can export your old config from your old computer from the config of my add-on by clicking the "More" button and then selecting "Export Button Config to json". Then import this file on the new computer with "More"->"Import Button Config to json". Then everything should work.
- If you have a backup of your add-on folder you could use your backup software to restore the whole add-on folder. It's tedious to copy over and reapply all user settings for each software you use. So all people I know just restore their whole user folder from their backup, e.g. on MacOS you'd just use your TimeMachine drive. All your add-ons are in your user folder so such a full restore also gives you back all your add-ons with your custom configurations.
- If you don't want to do a full restore of all user data you can just copy over one file: Exit/Close Anki on your new computer. Then you can copy over the file
1899278645/user_files/settings.pypickle
from your old computer's add-on folder to the same location on your new computer. How to find your add-on folder: https://docs.ankiweb.net/#/files?id=file-locations - If you don't have a backup it's more complicated: It is not enough to recreate the same styling options - the class names must also match and my add-on sometimes hide the class names so that it's less confusing to users. The downside is that in your situation you can't rely on the add-on config dialog to set the old class names. So you would need a workaround: You would have to export the styling to json, then edit the file with a text editor and then re-import it. This is quite complicated but I assumed that each user has a backup. You would have to check the html source code of your fields
from anki__editor__apply__font_color__background_color__custom_class__custom_style.
Does this solve your problem?
If you don't understand some parts of the prior post let me know which parts should be more clear.
from anki__editor__apply__font_color__background_color__custom_class__custom_style.
thank you for all the information! Unfortunately I just got my computer back and it was wiped completely. I unfortunately do not have any backups so from now on that's something that I am going to have to do.
It sounds like the last option you gave me can be possible? If you think it is possible and it can potentially help my situation would you mind elaborating on how I can do that. I am currently using a mac. Thank you again for the time you took to write that!
from anki__editor__apply__font_color__background_color__custom_class__custom_style.
I actually just fixed it. I had a picture of my old config settings and just copied them and somehow all the colors reappeared!
from anki__editor__apply__font_color__background_color__custom_class__custom_style.
Related Issues (20)
- ankiweb: raise minimum version required to 2.1.28 HOT 1
- Feature requests: Custom HTML wrapping HOT 1
- Sorting Entries
- 少了文件?
- Improvement in the backcolor category
- broken in 2.1.41 HOT 5
- 2.1.41+ night-mode css not applied in editor HOT 3
- Text Wrapping function malfunctions when wrapping string contains quotation marks. HOT 1
- 2.1.41+ wrong colors in editor and in actual card HOT 2
- Simplifying the context menu - just an idea.
- Selection of multiple lines not recognised when disabling entries in options
- Add option to disable the dialog asking to auto update templates HOT 1
- Feature Request: Placeholder for text under selection
- Changing font family?
- shorten the red box? HOT 2
- clear formatting: It doesn't work
- broken in 2.1.50 (Attribute error, ...) HOT 8
- Change "class" name on all previously produced cards. HOT 2
- css not loaded into the editor in 2.1.60 (and presumably .55+) HOT 6
- shortcuts don't apply the setting(class, style, ...) intended
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from anki__editor__apply__font_color__background_color__custom_class__custom_style.