Implementing custom scheduler FSRS on a per-deck basis with ankihub syncing

Wondering if we could add a method of protecting code changes to card types. Specifically, I’m trying to:
1.) Implement Fsrs4anki (GitHub - open-spaced-repetition/fsrs4anki: A modern Anki custom scheduling based on free spaced repetition scheduler algorithm) on a per-deck basis, but it requires that the card front template include

to specify the deck.
2.) Create a new field just like “lecture notes”, but on the front template of the card. Essentially its purpose is to prompt me on the lecture specific portions/material that I feel is missing of a certain card.
I’m assuming that any of these changes will be wiped out with a sync to AnkiHub. I also know that you have a “Anking Note Types” addon, but unfortunately I can’t deploy my two use cases with that. Maybe it’s a feature request for that addon?

1 Like

@jakub.f , couldn’t we support this by specifying a special open/close comment (just like our own special template snippet) which, if present, would be appended back onto the template after we modify it?

@jakub.f and I talked about this at one point. Basically drawing a line at the bottom of the AnKing note types and anything below them would never be updated with the note types addon

Andrew’s thought would allow almost any customization to be made to the card template (which I’m a big fan of), but of course it all depends on time to implement.

1 Like

I think it would be good idea to specify a divider comment below which both add-ons don’t change any content of the card template.

The add-on would append the divider comment to all note types. So if you wanted to add some extra content to the template you could just add it below the divider comment.

This is easier than allowing custom sections to be added anywhere on a note type because if this were possible on an update to the template the add-ons would need to figure out where to put the custom sections on the new template and this would be hard when there are bigger changes between the old and the new template. For example if a custom section was between two fields on the old template and the fields don’t exist on the new template it would be hard to figure out where to place them.

I think this divider comment at the end of the note type would solve 1.).


Sounds good to me! Go ahead and do that whenever you have free time

Love this! Can’t wait for it.

1 Like

There is a new version of the add-on on AnkiWeb now, which adds this comment to all note types used by AnkiHub notes:

There is also new version of the AnKing note types add-on which retains this comment and the contents below it when resetting or updating note types.

This should make it possible to add content to AnkiHub notes (that won’t get removed) and to use them with Fsrs4anki!


Can confirm that this works with the fsrs scheduler. Thank you!

1 Like

Unfortunately, the protected fields are still getting reset. Not after every sync, but sometimes at random. Any thoughts on this?

@conwork @AnKingMed
We could make it so that fields of which the names start with “!” (or another prefix) don’t get removed when syncing with AnkiHub.

These fields should then also not get removed when updating the note types using the AnKing note types add-on.


This is for protecting entire fields that users have that are not related to the AnkiHub note types?

@AnKingMed Exactly

I like the idea. I wonder if we need to map out how exactly we want to support note types before we make this adjustment.

@andrew thoughts?