# Sync lessons with Obsidian

Write your lessons in [Obsidian](https://obsidian.md), the free notes app that keeps everything as
plain text files in a folder on your computer, which it calls a vault. The Chalkenso plugin keeps the
courses you pick in your vault, one note per lesson, and syncs them both ways when you say so.
Feedback arrives next to each lesson as a checklist.

There are two ways to work on courses in Obsidian:

- **The plugin** (this page): your edits go into Chalkenso when you upload them. It suits writing and
  fixing lessons yourself.
- **[Claude Code in your vault](/docs/obsidian)**: Claude works on the lessons with you, and every
  change comes back to Chalkenso as a draft you review.

Use one or the other in a vault, not both.

## 1. Install the plugin

1. Download [the plugin](https://github.com/bostjan-cigan/chalkenso-obsidian/releases/latest/download/chalkenso-plugin.zip) (`chalkenso-plugin.zip`).
2. In Obsidian, open **Settings → Community plugins** and turn on community plugins if they're off.
   The folder icon next to **Installed plugins** opens your vault's plugins folder
   (`.obsidian/plugins`, which is hidden).
3. Unzip the download there. You get a `chalkenso` folder:

   ```
   Your vault/
   └── .obsidian/plugins/chalkenso/
       ├── main.js
       ├── manifest.json
       └── styles.css
   ```

4. Back in Obsidian, reload the list under **Installed plugins** and turn on **Chalkenso**.

## 2. Connect it

1. In Chalkenso, open [Settings → Tokens](https://chalkenso.com/admin/api-tokens). Name a token after the device
   ("Obsidian — MacBook") and create it. Copy it: it's shown only once.
2. In Obsidian, open **Settings → Chalkenso**:
   - **Server URL**: `https://chalkenso.com`
   - **Organisations → Add your organisation**: paste the token and click **Add**.

A token works in the organisation it was made in and acts as you: the plugin can do what your account
can there. In several organisations? Switch to each one in Chalkenso, make a token there and add it as
another organisation. Each gets its own folder.

## 3. Pick what to sync

Under **What to sync**, Settings → Chalkenso lists every course version and group your account can
reach. Tick the ones you want in this vault and click **Save**. Each gets its own folder in
`Chalkenso/<your organisation>/` and downloads right away.

## Working with it

- **Sync** (from the command palette, or right-click a folder) uploads your edits, downloads the
  changes made in Chalkenso and pulls the feedback.
- **The dots in the file explorer** show each note's state: green synced, orange edited since the last
  sync, grey not in Chalkenso yet, red a conflict.
- **Show changes in current note** shows what an upload would change, before you send it.
- **A note's `status`** decides what learners see: `published` publishes it when you upload, `draft`
  changes only the draft.
- **Your own properties** (objectives, prerequisites, anything else) stay in the vault and never sync.

## Feedback in the vault

Every sync writes one feedback note per lesson into the folder's `_feedback/`: the open learner
feedback and instructor notes, the lesson's improvement with its plan, and what's done.

- Tick an open item when it's answered, with your answer after **Reply:**. The learner sees it.
- Write the improvement's plan under its **Plan** heading. It's sent with every sync.
- Tick the improvement when the lesson is fixed. It closes in Chalkenso once the lesson itself is
  uploaded.

## When a lesson changed on both sides

Nothing is overwritten. Chalkenso's copy goes to `_conflicts/` and the note gets a red dot. Merge what
you need from the copy, then run **Resolve conflict: keep my version**, or **use server version** to
take Chalkenso's.

## Updating the plugin

Download it again and unzip it over the old `chalkenso` folder, then reload Obsidian. Your settings and
tokens stay: they're in that folder's `data.json`, which the zip doesn't have.

## When something goes wrong

Notices say what happened, for example "Can't reach …" or "Not authorized (401)". **Show recent sync
problems** lists every problem with its time and note. A 401 usually means the token was revoked: make
a new one in Settings → Tokens and paste it in place of the old one.

## More

The plugin's [README](https://github.com/bostjan-cigan/chalkenso-obsidian#readme) has every command, the folder layout, read-only
folders, group curricula and the sync API. The plugin is open source, under the MIT license.
