(cards) implements spaced repetition cards

This commit is contained in:
2021-06-12 16:11:47 +02:00
parent 54bce75122
commit 257dc0794b
9 changed files with 210 additions and 8 deletions

View File

@@ -11,6 +11,17 @@ export const useFile = (sha: string, retrieveContent = true) => {
const fromCache = ref(false)
const content = ref('')
const rawContent = ref('')
const getRawContent = async () => {
const fileContent = await getCachedFileContent()
if (!fileContent) {
return
}
content.value = render(fileContent)
rawContent.value = fileContent
return rawContent.value
}
const getContent = async () => {
const fileContent = await getCachedFileContent()
@@ -18,6 +29,7 @@ export const useFile = (sha: string, retrieveContent = true) => {
return
}
content.value = render(fileContent)
rawContent.value = fileContent
return content.value
}
@@ -45,6 +57,7 @@ export const useFile = (sha: string, retrieveContent = true) => {
return {
content,
getRawContent,
getContent,
getCachedFileContent,
fromCache