Coder Social home page Coder Social logo

obsidian-awesome-flashcard's Introduction

Awesome Flashcard

Plugin to sync flashcards in your Obsidian notes to Anki.

Design philosophy

  • Single source of truth. Synchronizes flashcards only in one direction: from your Obsidian notes to Anki.
  • Simplicity matters. Only one simple way to define flashcard.
  • Stick to openness. Standard Markdown as flashcard format, Introduces zero private syntax.
  • Minimal footprint. Stores no private data on your notes. Does not affect your Anki learning progress.

Features

  • ♳ Synchronizes all flashcards in your vault to Anki, in one direction
  • ✍ Preserves Anki learning progress
  • ✒ Full Markdown syntax support: 🖼️image, 🎤audio, 🎞️video, 📟code block, 🔢LaTeX, 📋table...
  • 🎴 Supports defining deck names both vault-wide and file-wide
  • #️⃣ Supports defining tags both flashcard-wide and file-wide
  • ⚡ Decent speed for incremental scanning
  • 🔗 Quick link to corresponding Obsidian note

Flashcard example

In your Obsidian note:

---
A simple flashcard: Question in the front #flashcard
Answer in the back
---

will generate an Anki flashcard like this:

A simple flashcard: Question in the front
Answer in the back

see more examples in sample.md

One time setup

These steps only need to be done once.
After that ensuring Anki running would suffice to scan vault with the plugin.

  1. Start up Anki, and navigate to your desired profile.
  2. Ensure that you've installed AnkiConnect.
  3. Have Obsidian installed
  4. Search the 'Community plugins' list for this plugin
  5. Install the plugin.
  6. In Anki, navigate to Tools->Addons->AnkiConnect->Config, and change it to look like this, then restart Anki to apply the changes:
{
    "apiKey": null,
    "apiLogPath": null,
    "webBindAddress": "127.0.0.1",
    "webBindPort": 8765,
    "webCorsOrigin": "http://localhost",
    "webCorsOriginList": [
        "http://localhost",
        "app://obsidian.md"
    ]
}

How to use

Make sure Anki is running, on left sidebar's Ribbon there is an Anki icon like this:

Click it and the plugin will do the rest for you. Process is shown on Notice and in the Obsidian Developer Console

Synchronization mechanism clarified

To fulfill these goals:

  • One-way synchronization from your Obsidian notes to Anki, and not vice versa. Auto adds new, removes deleted and updates obsolete flashcards
  • Does not affect your own flashcards (which are not from your Obsidian notes)
  • Stores no private data on your notes.

The synchronization is designed as follows:

  • Flashcard's deck name and front text are combined to get a unique hash
  • Each flashcard from Obsidian is tagged with the hash to tell from your own flashcards
  • When scanning vault, it will diff flashcards in Obsidian (computed dynamically) and Anki based on unique hash, create decks and CRUD flashcards accordingly

obsidian-awesome-flashcard's People

Contributors

aidenlx avatar awesomedog avatar chrisgrieser avatar clemens-e avatar edo78 avatar fyears avatar gitmurf avatar henrebotha avatar kostapc avatar lishid avatar phibr0 avatar reorx avatar taurelas avatar tfthacker avatar tokuhirom avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

obsidian-awesome-flashcard's Issues

[FEATURE REQUEST] Add an ability to define delimiter

I have some issues in Preview Mode with ---.

Obsidian_rCrSrt8ySs

Answers render as heading, and I've no such problems with ___ that does the same delimiter. So I think it'd be nice to have an ability to choose one of these delimiters or totally change it to ___.

Discussion/Feature Request: Short card format

I just found this plugin and I'm really impressed with it because it's the first one really usable which doesn't clutter my markdown. Thanks!

I'm trying it currently and sometimes I think the --- might be a little too much if I have super short cards. For longer cards the --- syntax is perfect imo.

Here are two examples. Maybe there are others that make sense. Do you think it's worth thinking about a short format for this plugin?

Current syntax


Install program #flashcard
apt install python3



Remove program #flashcard
apt remove python3



Update repository / check which updates are available #flashcard
apt update



Update all programs #flashcard
apt upgrade



Remove a program and also remove all config files #flashcard
apt purge python3



Show info about the package python3 #flashcard
apt show python3



List all packages that start with python3 #flashcard
apt list python3*


Short format example 1

Install programm :: apt install python3 #flashcard

Remove program :: apt remove python3 #flashcard

Update repository / check which updates are available :: apt update #flashcard

Update all programs :: apt upgrade #flashcard

Remove a program and also remove all config files :: apt purge python3 #flashcard

Show info about the package python3 :: apt show python3 #flashcard

List all packages that start with python3 :: apt list python3* #flashcard

Short format example 2

(spacing is usually smaller in Obsidian compared to Github)

  • Install program #flashcard

    • apt install python3
  • Remove program #flashcard

    • apt remove python3
  • Update repository / check which updates are available #flashcard

    • apt update
  • Update all programs #flashcard

    • apt upgrade
  • Remove a program and also remove all config files #flashcard

    • apt purge python3
  • Show info about the package python3 #flashcard

    • apt show python3
  • List all packages that start with python3 #flashcard

    • apt list python3*

Problem with --- delimiter

At the moment triple dash delimiter breaks in edit mode,
when you use example card

text and triple dash on next line
---

is detected as header

Screenshot 2023-05-02 at 10 48 40

Any chances, to add option to specify delimiter?

Besides header problem, triple dashes doesn't look good in custom themes with changed typography, e.g. two cards one after another:

Screenshot 2023-05-02 at 10 53 38

Updating a note in Obsidian causes the original note to be deleted and a new note to be created

Hi, thanks for this cool plugin. I'm planning to develop something similar, so I am gathering ideas from existing Anki plugins.
For me, your plugin's peculiarity is "Minimal footprint", i.e., unlike other plugins, this plugin doesn't store private data on the notes (such as e.g. a note id).
But I think this design goal causes the kind of behavior that I wrote in the title of this issue, which sometimes may be quite bothering. E.g. this would cause the learning progress to be lost for a note in which I want to correct a typo.

Is what I've written correct? Or did I misunderstand how this plugin works and actually there is not this kind of problem?

Audio is muted on Flashcards

Hi! I don't know if I set up properly my flashcards. I used in the past the Obsidian_to_Anki plugin, but since it stopped syncing with my Anki, I'm trying to convert my obsidian notes to a syntax supported by Awesome flashcards.

This is how the flashcards are in Obsidian
01

This is how the flashcards are shown in Anki
02

The audio files are in my vault and worked in Anki previously. How can I fix this?

Proper latex support

Thanks a lot for this amazing plugin and I like the simplicity of the plugin.

The only one thing I need is to support latex in the desktop Anki app. Even in Ankidroid, the latex doesn't render properly. For example, \frac{1}{|G|} will be rendered as 1|G| in the phone.

Could you improve the latex support?

Feature Request: Auto tag folder structure

It would be nice to have the possibility to learn based on folder structure. So a folder translates into tag/s

Example

.
├── code
│   ├── C-Sharp
│   ├── Python
│   │   ├── Django
│   │   └── Flask
│   └── TypeScript
└── software
    ├── Visual Studio Code
    └── vim

A flashcard in a markdown file that is located at code/Python/Flask would either have

option 1

code, Python and Flask tags (3)

option 2

code/Python/Flask tag (1)

Imo option 2 makes more sense because the folder names separately could appear elsewhere in a different context.

Afaik right now you'd have to add a tag for each page in frontmatter with its own name, which is a little bit redundant.

For example.

Networking/IP/v4.md

needs

---
tags:
  - Networking
  - IP
---

frontmatter so that you can learn for either Networking or IP

Feature Request: Allow spaces in tags

I tend to add tags like this in Obsidian and other yaml based tools

tags:
  - Plugins
  - "Spaced Repetition"
  - Obsidian

the Spaced Repetition tag will be separated as two tags for Anki when exporting with awesome-flashcards. It would be cool to allow tags that have spaces.

Bug: HTML issue when two HTML elements are added beside each other

If in Obsidian I have:

![](video.webm)
![](audio.mp3)

This will result in the following in Anki:

<video controls="" autoplay="true" src="12345.webm"><br>
<audio controls="" autoplay="true" src="12345.mp3"><p></p></audio></video>

As you can see the audio tag is actually inside the video tag. The result of this is that the video renders correctly, but the audio doesn't render at all.

The same happens with two audios in a row, two videos etc., so I'm guessing this is a general issue with having two consecutive lines in Obsidian with two things that will be converted to HTML tags in Anki. Adding a line break to the markdown in Obsidian doesn't help unfortunately.

How to assign new deck?

all Flash card in vault come to one deck in Anki. How to seperate Deck for multiple purpose

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.