anki-connect icon indicating copy to clipboard operation
anki-connect copied to clipboard

Ability to create custom note types.

Open burtonator opened this issue 7 years ago • 5 comments

I'd like the ability to add custom note types.

With Polar I want the ability to add new fields like Author, URL, screenshot, so that when I sync over notes they have extended metadata.

Right now I can only use the pre-existing note types ...

burtonator avatar Nov 07 '18 22:11 burtonator

AnkiConnect was built as something to be used alongside Anki, so the idea is that the user sets up their deck there, and then your application allows the user to specify how they want the fields populated. So yes, you can already use custom note types. If you want to customize models in some way, I wouldn't mind a pull request with that behavior.

FooSoft avatar Nov 09 '18 01:11 FooSoft

I too would be interested in this and might have the time to work on it.

Main issue would be to choose a proposed format for how to create the new models while and ensure as much flexibility as possible. I tried to choose the names to be as verbose as possible. Card templates can be 1-n. Fields also 1-n (Though not sure about the single field use case? Maybe 2-n?)

{
    "action": "createNewModel",
    "version": 6,
    "params": {
        "modelName": "newModelName",
        "inOrderFields": ["Field1", "Field2", "Field3"], 
        "cardTemplates": [
            {
                "Front": "Front htm {{Field1}}l",
                "Back": "Back html  {{Field2}}",
                "Css": "Optional CSS and default to builtin css",
            }
        ]
    }
}

Let me know what you think anyway

c-okelly avatar Feb 22 '19 12:02 c-okelly

@FooSoft I think this issue can probably be closed!

c-okelly avatar May 04 '19 08:05 c-okelly

Certain names(Date, Text, Note...) in inOrderFields are translated to other language if Anki is not in English. How to prevent that?

crimx avatar Jun 02 '20 07:06 crimx

I think this is a bug since the field names in card template are not translated.

crimx avatar Jun 02 '20 08:06 crimx