Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Daily Shaarli used as Anki cards #1373

Closed
immanuelfodor opened this issue Oct 26, 2019 · 4 comments
Closed

Daily Shaarli used as Anki cards #1373

immanuelfodor opened this issue Oct 26, 2019 · 4 comments
Labels
plugin bells and whistles question

Comments

@immanuelfodor
Copy link

immanuelfodor commented Oct 26, 2019

To be honest, I never put the Daily Shaarli a good use as I couldn't find the use case why would I want to see the links of today/previous day/etc when I'm using Shaarli as a note taking app.

This is why I wondered on creating a plugin that would add to today's links some older links that was added a week/month/year ago. It could work like Anki cards if I could see what I added before in these intervals to retain memory of information.

https://en.m.wikipedia.org/wiki/Anki_(software)

Anki is a free and open-source flashcard program that utilizes spaced repetition. Spaced repetition has been shown to increase rate of memorization.

When I checked the demo plugin and how the showDaily function works in index.php, I quickly realized that the plugin only receives the links of the filtered day prepared and adjusted, so I couldn't do my own link addition here.

Just in theory, could my idea work with the current plugin/database system? Before I start experimenting, I'd like to know if I could access all the links from a plugin's daily hook to make it work as described.

Ideally, it should be separate sections with its own subtitles that contains the additional links but I'd be happy even if I could mix today's links with the links posted on the same day a week/month/year ago.

@nodiscc
Copy link
Member

nodiscc commented Oct 27, 2019

I don't think it's possible, considering the way the daily page currently works. As you said

the plugin only receives the links of the filtered day prepared and adjusted

@nodiscc nodiscc added plugin bells and whistles question labels Oct 27, 2019
@nodiscc nodiscc changed the title Daily Shaalri used as Anki cards Daily Shaarli used as Anki cards Oct 27, 2019
@immanuelfodor
Copy link
Author

immanuelfodor commented Oct 27, 2019

If I'd add another hook after this line, would it be merged in a PR?
https://github.com/shaarli/Shaarli/blob/master/index.php#L424

I think of something like this:

/* Hook to modify the raw links that will eventually be displayed on the Daily Shaarli. */
$pluginManager->executeHooks('filter_raw_daily', $linksToDisplay, $LINKSDB, array('loggedin' => $loginManager->isLoggedIn()));

This way a new/my new plugin could add more links (pseudocode):

$linksToDisplay += $LINKSDB->filterDay($this_day_last_week);
$linksToDisplay += $LINKSDB->filterDay($this_day_last_month);
$linksToDisplay += $LINKSDB->filterDay($this_day_last_year);

@ArthurHoaro
Copy link
Member

Plugins shouldn't manipulate $LINKSDB directly as its format may change in the future.

However #160 and #161 are still open, which are feature requests to have more filter on the daily page.

@immanuelfodor
Copy link
Author

Thanks, I've subscribed to those. Well, then I might patch the showDaily function directly through my custom dockerfile 😃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plugin bells and whistles question
Projects
None yet
Development

No branches or pull requests

3 participants