Skip to content

Commit

Permalink
update README
Browse files Browse the repository at this point in the history
  • Loading branch information
chronologos committed Jul 30, 2022
1 parent f3c5a48 commit da43462
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 20 deletions.
54 changes: 39 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,27 @@

## Getting started (Roam Depot)

- Anki must be running, with the AnkiConnect plugin installed and configured (see below), for the sync button to work. It works fastest if Anki is running in the foreground.
- Configuring AnkiConnect: Go to Anki -> Tools -> Addons -> Anki Connect -> Config and amend `webCorsOriginList` to include `https://roamresearch.com`
*Setup takes about five minutes and is totally worth it!*

1. Install the [AnkiConnect](https://ankiweb.net/shared/info/2055492159) plugin for Anki.
2. Configure AnkiConnect: Go to `Anki -> Tools -> Addons -> Anki Connect -> Config` and amend `webCorsOriginList` to include `https://roamresearch.com`
3. Create an Anki note type based on Cloze named `ClozeRoam`. It needs to have the fields `Text`, `Metadata`, `Extra` and `Title`. Upon syncing, notes will be created in a deck named `Max Infinity`, which has to exist.
- ![Example](note-deck-setup.png)
4. Modify the template for the note type to look something like this:

```html
<!-- front -->
<div class='roamtitle'>{{Title}}</div>
<div id="extra">{{Extra}}</div>
{{cloze:Text}}

<!-- back -->
<div class='roamtitle'>{{Title}}</div>
<div id="extra">{{Extra}}</div>
{{cloze:Text}}
```
5. Before clicking on the [Sync button](sync-button.png), Anki must be running. Sync is fastest if Anki is running in the foreground.
6. If cards don't sync, it's likely because Anki has been in the background for too long. Try syncing again after switching it to the foreground.

## Getting started (`roam/js` install)

Expand All @@ -20,19 +39,33 @@

## Recommended use

The recommended use is to create simple Q&A cards using the provided cloze functionality.
The recommended use is to create simple Q&A cards in Roam using the provided cloze functionality. For instance, you may be taking notes about an article or book you are reading. For each section of your notes in Roam, you could create a block for flashcards like so:

```text
- How to cook onion soup
- Onion soup is great...
- Onion Soup Recipe #[[srs/cloze-g]]
- Q: What is the cook time?
A: {c1:20 minutes}
- Q: How many onions should I use?
A: {c1: 2 per person.}
- Other tips:
- ...
```

## Examples
This will create two flashcards.

## Caveats and Limitations
- Don't edit the sync metadata on the Anki note.
- The Roam block UID is used to identify the corresponding note in Anki. Avoid taking actions which cause the block UID of a Roam block to change.
- You can't create a new note in Anki and sync it to Roam.
- There is no garbage collection for unused notes in Anki (yet).
- If the same uid is updated in both Roam and Anki, Roam will be taken as the source of truth.
- Changes to group tags and title tags do not cause a sync for clozes blocks underneath them. The actual cloze block must be updated.

## Advanced

### Single block clozes
If we have the following text in a Roam block with block id `f-123`:
```text
- "In [[C]], we can have {c2:indirect references} to variables are using {c1:[[pointers]]} #srs/cloze"
Expand All @@ -47,12 +80,11 @@ and Metadata = `f-123`.

- This assumes the default configuration of browser.js
- Note the modified cloze syntax, since Roam reserves `{{}}` and `::` for internal use.
- An Anki note type named `ClozeRoam` with fields `Text` and `Metadata` has to exist in a deck named `Max Infinity`.
- Please see [Anki docs](https://docs.ankiweb.net/templates/generation.html?highlight=cloze#cloze-templates) for more info on how a cloze note type needs to be configured (easiest is to clone the built-in Cloze note type).

Title tags provide context to

## Advanced: Group and Title Tags - Pull in more context!
### Group and Title Tags - Pull in more context!

*Title tags* provide context for any nested blocks. *Group tags* augment title tags by providing extra context for a block from the *closest* context-providing block. The default title tag is `#srs/cloze-t` and syncs to the `Title` field. The default group tag is `#srs/cloze-g` and syncs to the `Extra` field.

Expand Down Expand Up @@ -90,12 +122,4 @@ Extra: Adenosine antagonists
Specifically, group tags work in the following way:

1. Any child blocks (direct or indirect) under a block with a **group tag** is considered a cloze, unless there are no cloze marks `{c1:...}` on it.
2. Clozes generated from said child blocks automatically include context from the **closest parent** block.

## Caveats and Limitations
- Don't edit the sync metadata on the Anki note.
- The Roam block UID is used to identify the corresponding note in Anki. Avoid taking actions which cause the block UID of a Roam block to change.
- You can't create a new note in Anki and sync it to Roam.
- There is no garbage collection for unused notes in Anki (yet).
- If the same uid is updated in both Roam and Anki, Roam will be taken as the source of truth.
- Changes to group tags and title tags do not cause a sync for clozes blocks underneath them. The actual cloze block must be updated.
2. Clozes generated from said child blocks automatically include context from the **closest parent** block.
4 changes: 1 addition & 3 deletions extension.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit da43462

Please sign in to comment.