Add basic support for AnkiConnect (WIP)#16
Closed
MarkoSagadin wants to merge 1 commit into
Closed
Conversation
This is a prototype implementation. In the current state the md2anki will: - Send processed cards to the Anki via 'addNote' API - Send images to the Anki via 'storeMediaFile' API - Display basic info when that is being done - Display error messages if any step fails This feature is far from done: - deck name and note type are currently hardcoded, they should be provided by the caller for each card/note. - error handling and validation are missing. - code style will probably need to be adjusted. There are several TODO comments that ask questions. Related: Mochitto#3
Collaborator
Author
|
I should add that I was testing the AnkiConnect functionality with this example markdown text. It works as expected, everything is sent over to the Anki. |
Owner
|
Integration of this PR:
|
Owner
|
Steps needed to implement the feature:
|
MarkoSagadin
added a commit
to MarkoSagadin/Markdown2Anki
that referenced
this pull request
Feb 16, 2025
This commit adds for uploading cards via AnkiConnect plugin. Generated cards are now by default uploaded to the Anki via the plugin. The accompanying images references in the cards are also uploaded via the plugin. The addition of the AnkiConnect support means that frontmatter block is mandatory, since some of the fields are required by the plugin to upload the cards to the correct Anki deck, to use the correct note type, etc. The mandatory formatter fields are: - deck_name - note_type_basic - note_type_cloze The tags field is optional. The generation of Anki cards in CSV format is now marked as a legacy feature, it is by default turned off. User can also change the default URL of the AnkiConnect server via the .ini config file. Future work: - The code currently skips when trying to upload a card duplicate. In the future there an update system could be implemented. This would support a usecase where users would like to fix the already uploaded card via the markdown input file. - Currently the users need to provide the images file to the md2anki config file. This is not really needed, as the information about the image location is in the input markdown document itself. So that could be removed and thus UX would be a bit better, since that would be one less config option to carry about. - Currently the images must be local, there is no support for providing URL image links. Support for that could be added. Related: Mochitto#16 Closes: Mochitto#3
MarkoSagadin
added a commit
to MarkoSagadin/Markdown2Anki
that referenced
this pull request
Feb 22, 2025
This commit adds support for uploading cards via AnkiConnect plugin. Generated cards are now by default uploaded to the Anki via the plugin. The accompanying images references in the cards are also uploaded via the plugin. The addition of the AnkiConnect support means that frontmatter block is mandatory, since some of the fields are required by the plugin to upload the cards to the correct Anki deck, to use the correct note type, etc. The mandatory formatter fields are: - deck_name - note_type_basic - note_type_cloze The tags field is optional. The generation of Anki cards in CSV format is now marked as a legacy feature, it is by default turned off. User can also change the default URL of the AnkiConnect server via the .ini config file. Future work: - The code currently skips when trying to upload a card duplicate. In the future there an update system could be implemented. This would support a usecase where users would like to fix the already uploaded card via the markdown input file. - Currently the users need to provide the images file to the md2anki config file. This is not really needed, as the information about the image location is in the input markdown document itself. So that could be removed and thus UX would be a bit better, since that would be one less config option to carry about. - Currently the images must be local, there is no support for providing URL image links. Support for that could be added. Related: Mochitto#16 Closes: Mochitto#3
Collaborator
Author
|
Closing this PR in favor of #29. |
MarkoSagadin
added a commit
to MarkoSagadin/Markdown2Anki
that referenced
this pull request
Mar 3, 2025
This commit adds support for uploading cards via AnkiConnect plugin. Generated cards are now by default uploaded to the Anki via the plugin. The accompanying images references in the cards are also uploaded via the plugin. The addition of the AnkiConnect support means that frontmatter block is mandatory, since some of the fields are required by the plugin to upload the cards to the correct Anki deck, to use the correct note type, etc. The mandatory formatter fields are: - deck_name - note_type_basic - note_type_cloze The tags field is optional. The generation of Anki cards in CSV format is now marked as a legacy feature, it is by default turned off. User can also change the default URL of the AnkiConnect server via the .ini config file. Future work: - The code currently skips when trying to upload a card duplicate. In the future there an update system could be implemented. This would support a usecase where users would like to fix the already uploaded card via the markdown input file. - Currently the users need to provide the images file to the md2anki config file. This is not really needed, as the information about the image location is in the input markdown document itself. So that could be removed and thus UX would be a bit better, since that would be one less config option to carry about. - Currently the images must be local, there is no support for providing URL image links. Support for that could be added. Related: Mochitto#16 Closes: Mochitto#3
MarkoSagadin
added a commit
to MarkoSagadin/Markdown2Anki
that referenced
this pull request
Mar 3, 2025
This commit adds support for uploading cards via AnkiConnect plugin. Generated cards are now by default uploaded to the Anki via the plugin. The accompanying images references in the cards are also uploaded via the plugin. The addition of the AnkiConnect support means that frontmatter block is mandatory, since some of the fields are required by the plugin to upload the cards to the correct Anki deck, to use the correct note type, etc. The mandatory formatter fields are: - deck_name - note_type_basic - note_type_cloze The tags field is optional. The generation of Anki cards in CSV format is now marked as a legacy feature, it is by default turned off. User can also change the default URL of the AnkiConnect server via the .ini config file. Future work: - The code currently skips when trying to upload a card duplicate. In the future there an update system could be implemented. This would support a usecase where users would like to fix the already uploaded card via the markdown input file. - Currently the users need to provide the images file to the md2anki config file. This is not really needed, as the information about the image location is in the input markdown document itself. So that could be removed and thus UX would be a bit better, since that would be one less config option to carry about. - Currently the images must be local, there is no support for providing URL image links. Support for that could be added. Related: Mochitto#16 Closes: Mochitto#3
MarkoSagadin
added a commit
to MarkoSagadin/Markdown2Anki
that referenced
this pull request
Mar 3, 2025
This commit adds support for uploading cards via AnkiConnect plugin. Generated cards are now by default uploaded to the Anki via the plugin. The accompanying images references in the cards are also uploaded via the plugin. The addition of the AnkiConnect support means that frontmatter block is mandatory, since some of the fields are required by the plugin to upload the cards to the correct Anki deck, to use the correct note type, etc. The mandatory formatter fields are: - deck_name - note_type_basic - note_type_cloze The tags field is optional. The generation of Anki cards in CSV format is now marked as a legacy feature, it is by default turned off. User can also change the default URL of the AnkiConnect server via the .ini config file. Future work: - The code currently skips when trying to upload a card duplicate. In the future there an update system could be implemented. This would support a usecase where users would like to fix the already uploaded card via the markdown input file. - Currently the users need to provide the images file to the md2anki config file. This is not really needed, as the information about the image location is in the input markdown document itself. So that could be removed and thus UX would be a bit better, since that would be one less config option to carry about. - Currently the images must be local, there is no support for providing URL image links. Support for that could be added. Related: Mochitto#16 Closes: Mochitto#3, Mochitto#21
MarkoSagadin
added a commit
to MarkoSagadin/Markdown2Anki
that referenced
this pull request
Mar 23, 2025
This commit adds support for uploading cards via AnkiConnect plugin. Generated cards are now by default uploaded to the Anki via the plugin. The accompanying images references in the cards are also uploaded via the plugin. The addition of the AnkiConnect support means that frontmatter block is mandatory, since some of the fields are required by the plugin to upload the cards to the correct Anki deck, to use the correct note type, etc. The mandatory formatter fields are: - deck_name - note_type_basic - note_type_cloze The tags field is optional. The generation of Anki cards in CSV format is now marked as a legacy feature, it is by default turned off. User can also change the default URL of the AnkiConnect server via the .ini config file. Future work: - The code currently skips when trying to upload a card duplicate. In the future there an update system could be implemented. This would support a usecase where users would like to fix the already uploaded card via the markdown input file. - Currently the users need to provide the images file to the md2anki config file. This is not really needed, as the information about the image location is in the input markdown document itself. So that could be removed and thus UX would be a bit better, since that would be one less config option to carry about. - Currently the images must be local, there is no support for providing URL image links. Support for that could be added. Related: Mochitto#16 Closes: Mochitto#3, Mochitto#21
MarkoSagadin
added a commit
to MarkoSagadin/Markdown2Anki
that referenced
this pull request
Mar 23, 2025
This commit adds support for uploading cards via AnkiConnect plugin. Generated cards are now by default uploaded to the Anki via the plugin. The accompanying images references in the cards are also uploaded via the plugin. The addition of the AnkiConnect support means that frontmatter block is mandatory, since some of the fields are required by the plugin to upload the cards to the correct Anki deck, to use the correct note type, etc. The mandatory formatter fields are: - deck_name - note_type_basic - note_type_cloze The tags field is optional. The generation of Anki cards in CSV format is now marked as a legacy feature, it is by default turned off. User can also change the default URL of the AnkiConnect server via the .ini config file. Future work: - The code currently skips when trying to upload a card duplicate. In the future there an update system could be implemented. This would support a usecase where users would like to fix the already uploaded card via the markdown input file. - Currently the users need to provide the images file to the md2anki config file. This is not really needed, as the information about the image location is in the input markdown document itself. So that could be removed and thus UX would be a bit better, since that would be one less config option to carry about. - Currently the images must be local, there is no support for providing URL image links. Support for that could be added. Related: Mochitto#16 Closes: Mochitto#3, Mochitto#21
MarkoSagadin
added a commit
to MarkoSagadin/Markdown2Anki
that referenced
this pull request
Dec 3, 2025
This commit adds support for uploading cards via AnkiConnect plugin. Generated cards are now by default uploaded to the Anki via the plugin. The accompanying images references in the cards are also uploaded via the plugin. The addition of the AnkiConnect support means that frontmatter block is mandatory, since some of the fields are required by the plugin to upload the cards to the correct Anki deck, to use the correct note type, etc. The mandatory formatter fields are: - deck_name - note_type_basic - note_type_cloze The tags field is optional. The generation of Anki cards in CSV format is now marked as a legacy feature, it is by default turned off. User can also change the default URL of the AnkiConnect server via the .ini config file. Future work: - The code currently skips when trying to upload a card duplicate. In the future there an update system could be implemented. This would support a usecase where users would like to fix the already uploaded card via the markdown input file. - Currently the users need to provide the images file to the md2anki config file. This is not really needed, as the information about the image location is in the input markdown document itself. So that could be removed and thus UX would be a bit better, since that would be one less config option to carry about. - Currently the images must be local, there is no support for providing URL image links. Support for that could be added. Related: Mochitto#16 Closes: Mochitto#3, Mochitto#21
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a prototype implementation.
In the current state the md2anki will:
This feature is far from done:
There are several TODO comments that ask questions.
Related: #3