Skip to content

Commit

Permalink
Merge branch 'master' into feat_996
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/gui/flashcard-review-view.tsx
  • Loading branch information
4Source committed Sep 23, 2024
2 parents 18906cf + 12b3651 commit a3b2b9c
Show file tree
Hide file tree
Showing 284 changed files with 11,279 additions and 7,585 deletions.
22 changes: 0 additions & 22 deletions .eslintrc.json

This file was deleted.

33 changes: 0 additions & 33 deletions .github/workflows/e2e.yml

This file was deleted.

34 changes: 13 additions & 21 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,21 @@
name: Lint and Test
name: Lint PR

on:
pull_request:
branches: [master]
pull_request_target:
types:
- opened
- edited
- synchronize
- reopened

env:
COREPACK_ENABLE_STRICT: 0
permissions:
pull-requests: read

jobs:
lint_and_test:
lint_pr:
runs-on: ubuntu-latest

steps:
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: "20"

- uses: actions/checkout@v3

- name: Install Dependencies
run: npm install -g pnpm && pnpm install

- name: Lint
run: pnpm lint

- name: Test
run: pnpm test
- uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
id: extract-release-notes
uses: ffurrer2/extract-release-notes@v1
with:
changelog_file: docs/changelog.md
changelog_file: docs/docs/changelog.md

- name: Create Release
id: create-release
Expand Down
29 changes: 29 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Lint and Test Code

on:
pull_request:
branches: [master]

env:
COREPACK_ENABLE_STRICT: 0

jobs:
lint_and_test_code:
runs-on: ubuntu-latest

steps:
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: "20"

- uses: actions/checkout@v3

- name: Install Dependencies
run: npm install -g pnpm && pnpm install

- name: Lint
run: pnpm lint

- name: Test
run: pnpm test
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,15 @@ build

# testing
coverage
tests/e2e/vault/
tests/vaults/*/.obsidian

# mkdocs
site/
venv/
.venv/
docs/docs/en/media/~*
docs/vaults/*/.obsidian
.obsidian/plugins/obsidian-spaced-repetition-beta/*

# env
env.sh
2 changes: 1 addition & 1 deletion .npmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
use-node-version=20.1.0
use-node-version=20.17.0
6 changes: 2 additions & 4 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
build
coverage
node_modules
.yarn
.pnp.cjs
.pnp.loader.mjs
pnpm-lock.yaml
tests/e2e/vault/
docs/vaults/
tests/vaults/
2 changes: 1 addition & 1 deletion CHANGELOG.md
2 changes: 1 addition & 1 deletion CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ representative at an online or offline event.

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
st3v3n.mw@gmail.com.
mail@stephenmwangi.com.
All complaints will be reviewed and investigated promptly and fairly.

All community leaders are obligated to respect the privacy and security of the
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
8 changes: 0 additions & 8 deletions Makefile

This file was deleted.

6 changes: 1 addition & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Fight the forgetting curve & note aging by reviewing flashcards & notes using sp
- Check the [roadmap](https://github.com/st3v3nmw/obsidian-spaced-repetition/projects/3/) for upcoming features & fixes.
- Raise an issue [here](https://github.com/st3v3nmw/obsidian-spaced-repetition/issues/) if you have a feature request or a bug report.
- Visit the [discussions](https://github.com/st3v3nmw/obsidian-spaced-repetition/discussions/) section for Q&A help, feedback, and general discussion.
- The plugin has been translated into _Arabic / العربية, Chinese (Simplified) / 简体中文, Chinese (Traditional) / 繁體中文, Czech / čeština, German / Deutsch, Italian / Italiano, Korean / 한국어, Japanese / 日本語, Polish / Polski, Portuguese (Brazil) / Português do Brasil, Spanish / Español, and Russian / русский_ by the Obsidian community 😄.
- The plugin has been translated into _Arabic, Chinese, Czech, French, German, Italian, Korean, Japanese, Polish, Portuguese, Spanish, Russian, and Turkish_ by the Obsidian community 😄.
- To help translate this plugin to your language, check the [translation guide here](https://www.stephenmwangi.com/obsidian-spaced-repetition/contributing/#translating_1).

## Features
Expand All @@ -35,8 +35,4 @@ Fight the forgetting curve & note aging by reviewing flashcards & notes using sp

Check the [docs](https://www.stephenmwangi.com/obsidian-spaced-repetition/) for more details.

## Supported By

<a href='https://ko-fi.com/M4M44DEN6' target='_blank'><img height='36' style='border:0px;height:36px;' src='https://cdn.ko-fi.com/cdn/kofi3.png?v=2' border='0' alt='Buy Me a Coffee at ko-fi.com' /></a>

<a href="https://jb.gg/OpenSourceSupport" target="_blank"><img src="https://resources.jetbrains.com/storage/products/company/brand/logos/jb_beam.png" height='128' style='border:0px;height:128px;' alt="JetBrains Logo (Main) logo."></a>
36 changes: 36 additions & 0 deletions docs/changelog.md → docs/docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,44 @@ All notable changes to this project will be documented in this file. Dates are d

Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

#### Unreleased

Extended card title functionality partly as described in issue [`#851`](https://github.com/st3v3nmw/obsidian-spaced-repetition/issues/851)

#### [1.12.7](https://github.com/st3v3nmw/obsidian-spaced-repetition/compare/1.12.6...1.12.7)

- fix: parsing code blocks & custom separators [`#1081`](https://github.com/st3v3nmw/obsidian-spaced-repetition/pull/1081)
- chore: remove e2e testing [`#1083`](https://github.com/st3v3nmw/obsidian-spaced-repetition/pull/1083)
- update french translation [`#1082`](https://github.com/st3v3nmw/obsidian-spaced-repetition/pull/1082)
- French translation [`#1080`](https://github.com/st3v3nmw/obsidian-spaced-repetition/pull/1080)
- chore: update dependencies, linting, & tests [`#1056`](https://github.com/st3v3nmw/obsidian-spaced-repetition/pull/1056)
- Added options to show/hide (1) ribbon icon, (2) status bar, (3) file menu options [`#1066`](https://github.com/st3v3nmw/obsidian-spaced-repetition/pull/1066)
- Translate to Turkish [`#1078`](https://github.com/st3v3nmw/obsidian-spaced-repetition/pull/1078)
- fix: parsing code blocks & custom separators (#1081) [`#1072`](https://github.com/st3v3nmw/obsidian-spaced-repetition/issues/1072) [`#1077`](https://github.com/st3v3nmw/obsidian-spaced-repetition/issues/1077)
- chore: update dependencies, linting, & tests (#1056) [`#548`](https://github.com/st3v3nmw/obsidian-spaced-repetition/issues/548) [`#1000`](https://github.com/st3v3nmw/obsidian-spaced-repetition/issues/1000)

#### [1.12.6](https://github.com/st3v3nmw/obsidian-spaced-repetition/compare/1.12.5...1.12.6)

> 15 September 2024
- Bump version to v1.12.6 [`#1071`](https://github.com/st3v3nmw/obsidian-spaced-repetition/pull/1071)
- Bug 1041 bad transclusion render (format & lint) [`#1062`](https://github.com/st3v3nmw/obsidian-spaced-repetition/pull/1062)
- Fixed [`#1061`](https://github.com/st3v3nmw/obsidian-spaced-repetition/pull/1061)
- Fixed docs references for: Major reworking of the documentation [`#1051`](https://github.com/st3v3nmw/obsidian-spaced-repetition/pull/1051)
- feat: refactor code to support diff methods of storing the scheduling info, and diff SR algorithms [`#1006`](https://github.com/st3v3nmw/obsidian-spaced-repetition/pull/1006)
- Added new option allowing for multiline cards with empty lines [`#1012`](https://github.com/st3v3nmw/obsidian-spaced-repetition/pull/1012)
- fix: arrows in note review panel don't move [`#962`](https://github.com/st3v3nmw/obsidian-spaced-repetition/pull/962)
- [FIX] isEqualOrSubPath function [`#1048`](https://github.com/st3v3nmw/obsidian-spaced-repetition/pull/1048)
- Major reworking of the documentation [`#1032`](https://github.com/st3v3nmw/obsidian-spaced-repetition/pull/1032)
- fix: add language switcher to docs [`#1043`](https://github.com/st3v3nmw/obsidian-spaced-repetition/pull/1043)
- [FEAT] Split the long list of options into categories within a tab control [`#1021`](https://github.com/st3v3nmw/obsidian-spaced-repetition/pull/1021)
- feat: refactor code to support diff methods of storing the scheduling info, and diff SR algorithms (#1006) [`#548`](https://github.com/st3v3nmw/obsidian-spaced-repetition/issues/548) [`#1000`](https://github.com/st3v3nmw/obsidian-spaced-repetition/issues/1000)

#### [1.12.5](https://github.com/st3v3nmw/obsidian-spaced-repetition/compare/1.12.4...1.12.5)

> 1 August 2024
- Bump version to v1.12.5 [`#1031`](https://github.com/st3v3nmw/obsidian-spaced-repetition/pull/1031)
- Support RTL flashcards specified by frontmatter "direction" attribute [`#935`](https://github.com/st3v3nmw/obsidian-spaced-repetition/pull/935)
- FEAT-990 Mobile landscape mode and functional size sliders [`#998`](https://github.com/st3v3nmw/obsidian-spaced-repetition/pull/998)
- [FIX] Cards missing when horizontal rule present in document [`#970`](https://github.com/st3v3nmw/obsidian-spaced-repetition/pull/970)
Expand Down
61 changes: 61 additions & 0 deletions docs/docs/en/algorithms.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Learning Algorithms

A learning algorithm is a formula that determines when a note or flashcard should next be reviewed.

| Algorithm | Status |
| --------------------------------------------------- | ----------- |
| [SM-2-OSR](#sm-2-osr) | Implemented |
| [FSRS](#fsrs) | Planned |
| [User Defined Intervals](#user-specified-intervals) | Planned |

## SM-2-OSR

- The `SM-2-OSR` algorithm is a variant of [Anki's algorithm](https://faqs.ankiweb.net/what-spaced-repetition-algorithm.html) which is based on the [SM-2 algorithm](https://www.supermemo.com/en/archives1990-2015/english/ol/sm2).
- It supports ternary reviews i.e. a concept is either hard, good, or easy at the time of review.
- initial ease is weighted (using max_link_factor) depending on the average ease of linked notes, note importance, and the base ease.
- Anki also applies a small amount of random “fuzz” to prevent cards that were introduced at the same time and given the same ratings from sticking together and always coming up for review on the same day."
- The algorithm is essentially the same for both notes and flashcards - apart from the PageRanks

### Algorithm Details

!!! warning

Note that this hasn't been updated in a while,
please see the [code](https://github.com/st3v3nmw/obsidian-spaced-repetition/blob/master/src/algorithms/osr/srs-algorithm-osr.ts).

- `if link_count > 0: initial_ease = (1 - link_contribution) * base_ease + link_contribution * average_ease` - `link_contribution = max_link_factor * min(1.0, log(link_count + 0.5) / log(64))` (cater for uncertainty)
- The importance of the different concepts/notes is determined using the PageRank algorithm (not all notes are created equal xD)
- On most occasions, the most fundamental concepts/notes have higher importance
- If the user reviews a concept/note as:
- easy, the ease increases by `20` and the interval changes to `old_interval * new_ease / 100 * 1.3` (the 1.3 is the easy bonus)
- good, the ease remains unchanged and the interval changes to `old_interval * old_ease / 100`
- hard, the ease decreases by `20` and the interval changes to `old_interval * 0.5`
- The `0.5` can be modified in settings
- `minimum ease = 130`
- For `8` or more days:
- `interval += random_choice({-fuzz, 0, +fuzz})`
- where `fuzz = ceil(0.05 * interval)`
- [Anki docs](https://faqs.ankiweb.net/what-spaced-repetition-algorithm.html):
> "[...] Anki also applies a small amount of random “fuzz” to prevent cards that were introduced at the same time and given the same ratings from sticking together and always coming up for review on the same day."
- The scheduling information is stored in the YAML front matter

---

## FSRS

The algorithm is detailed at:
[fsrs4anki](https://github.com/open-spaced-repetition/fsrs4anki/wiki)

Incorporation of the FSRS algorithm into this plugin has not yet occurred. For progress see:
[ [FEAT] sm-2 is outdated, can you please replace it with the fsrs algorithm? #748 ](https://github.com/st3v3nmw/obsidian-spaced-repetition/issues/748)

---

## User Specified Intervals

This is the simplest "algorithm" possible. There are fixed intervals configured by the user for each of the possible review outcomes.

For example, `hard` might be configured for an interval of 1 day.

Implementation of this technique has not yet occurred. For progress see:
[ [FEAT] user defined "Easy, Good, Hard" values instead of or in addition to the algorithm defined one. #741 ](https://github.com/st3v3nmw/obsidian-spaced-repetition/issues/741)
Loading

0 comments on commit a3b2b9c

Please sign in to comment.