Skip to content

Commit

Permalink
Clean up config.
Browse files Browse the repository at this point in the history
  • Loading branch information
kitschpatrol committed Jun 2, 2024
1 parent e23ec4c commit a4e0d93
Show file tree
Hide file tree
Showing 8 changed files with 85 additions and 43 deletions.
1 change: 1 addition & 0 deletions .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"throughs",
"Weinstein-Raun",
"Yanki",
"Yankī",
"Yatskov"
]
}
3 changes: 0 additions & 3 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
{
"recommendations": [
"astro-build.astro-vscode",
"svelte.svelte-vscode",
"streetsidesoftware.code-spell-checker",
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"unifiedjs.vscode-mdx",
"stylelint.vscode-stylelint"
]
}
28 changes: 3 additions & 25 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,45 +12,23 @@
"source.fixAll": "explicit"
},
"eslint.enable": true,
"eslint.validate": [
"astro",
"html",
"javascript",
"javascriptreact",
"markdown",
"mdx",
"svelte",
"typescript",
"typescriptreact"
],
"eslint.validate": ["html", "javascript", "markdown", "typescript"],
"typescript.tsdk": "node_modules/typescript/lib",
"[astro]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[gitignore]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[ruby]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[shellscript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[svelte]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"prettier.documentSelectors": [
"**/.eslintignore",
"**/.node-version",
"**/.npmrc",
"**/.prettierignore",
"**/*.astro",
"**/*.rb",
"**/*.svelte"
"**/.prettierignore"
],
"prettier.enable": true,
"stylelint.enable": true,
"stylelint.validate": ["css", "html", "svelte", "astro"]
"stylelint.validate": ["css", "html"]
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@
"string-strip-html": "^13.4.8",
"tsx": "^4.11.0",
"type-fest": "^4.18.3",
"typescript": "^5.4.5",
"unified": "^11.0.4",
"unist-builder": "^4.0.0",
"unist-util-visit": "^5.0.0",
Expand Down
3 changes: 3 additions & 0 deletions pnpm-lock.yaml

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

6 changes: 3 additions & 3 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@

Yanki MD simply syncs a folder of Markdown notes to Anki.

The "Y" prefix in "Yanki" is in the "Yet another" naming tradition; a nod to Anki's robust and occasionally duplicative ecosystem of third-party tools.
The "Y" prefix in "Yanki" is in the "Yet another" naming tradition; a nod to Anki's robust and occasionally duplicative ecosystem of third-party tools. (Also, appropriately, Yankī are a variety of [truant youth](https://en.wikipedia.org/wiki/Yankee#/media/File:ヤンキー.jpg).)

This library leverages my [`yanki-connect`](https://github.com/kitschpatrol/yanki-connect) library, and powers my [`yanki-obsidian`](https://github.com/kitschpatrol/yanki-obsidian) plugin.
This library leverages the [`yanki-connect`](https://github.com/kitschpatrol/yanki-connect) library, and powers the [`yanki-obsidian`](https://github.com/kitschpatrol/yanki-obsidian) plugin.

## Quick start

Expand Down Expand Up @@ -142,7 +142,7 @@ Jazz isn't dead
_It just smells funny_
```

---
***

### Cloze

Expand Down
73 changes: 73 additions & 0 deletions test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
import { cleanNotes, syncFiles } from './src/lib'
// Import { mdastToHtml } from './src/lib/parse/rehype-utilities'
// import { getAstFromMarkdown } from './src/lib/parse/remark-utilities'
// import fs from 'node:fs/promises'

const paths = [
'test/assets/minimal-notes/basic-and-reversed-card-with-no-back.md',
'test/assets/minimal-notes/basic-and-reversed-card-with-no-front.md',
'test/assets/minimal-notes/basic-and-reversed-card.md',
'test/assets/minimal-notes/basic-type-in-the-answer-with-empty-frontmatter.md',
'test/assets/minimal-notes/basic-type-in-the-answer-with-frontmatter.md',
'test/assets/minimal-notes/basic-type-in-the-answer-with-multiple-emphasis.md',
'test/assets/minimal-notes/basic-type-in-the-answer.md',
'test/assets/minimal-notes/basic-with-cloze-like-back.md',
'test/assets/minimal-notes/basic-with-empty-everything.md',
'test/assets/minimal-notes/basic-with-empty-frontmatter.md',
'test/assets/minimal-notes/basic-with-no-back.md',
'test/assets/minimal-notes/basic-with-no-front-empty-frontmatter.md',
'test/assets/minimal-notes/basic-with-no-front.md',
'test/assets/minimal-notes/basic-with-type-in-like-answer-and-no-back.md',
'test/assets/minimal-notes/basic-with-type-in-like-answer-and-no-front.md',
'test/assets/minimal-notes/basic-with-type-in-like-single-line-with-empty-frontmatter.md',
'test/assets/minimal-notes/basic-with-type-in-like-single-line-with-frontmatter.md',
'test/assets/minimal-notes/basic-with-type-in-like-single-line.md',
'test/assets/minimal-notes/basic.md',
'test/assets/minimal-notes/cloze-with-extra-empty.md',
'test/assets/minimal-notes/cloze-with-extra.md',
'test/assets/minimal-notes/cloze-with-style.md',
'test/assets/minimal-notes/cloze.md',
]

const cleanResults = await cleanNotes({
dryRun: false,
namespace: '*',
})

console.log('Cleaned ----------------------------------')
console.log(cleanResults.deleted.length)

const results = await syncFiles(paths, {
namespace: 'YankiTestFile',
})

console.log('----------------------------------')
console.log('----------------------------------')
console.log(JSON.stringify(results, undefined, 2))

//
// const markdown = await fs.readFile(
// './test/assets/minimal-notes/basic-with-empty-everything.md',
// 'utf8',
// )

// Console.log('----------------------------------')
// console.log(markdown)

// const mdast = await getAstFromMarkdown(markdown, {
// obsidianVault: 'Vault',
// })

// console.log('----------------------------------')
// console.log(JSON.stringify(mdast, undefined, 2))

// console.log('----------------------------------')
// const html = await mdastToHtml(mdast)

// console.log(html)

// "<p>I'm an <strong>answer</strong> to which there is no question.</p>"
// "<p>I'm an <strong>answer</strong> to which there is no question.</p>",

// "<!-- This is tricky, if the very first two lines are `---` and `---` then assume it's empty frontmatter. But if there's a space first, as will be generated from this comment, then assume it's an empty \"front\" of a basic (and reversed card) note. -->"
// "<!-- This is tricky, if the very first two lines are `---` and `---` then assume it's empty frontmatter. But if there's a space first, as will be generated from this comment, then assume it's an empty \"front\" of a basic (and reversed card) note. -->"
13 changes: 1 addition & 12 deletions tsconfig.eslint.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,5 @@
},
"extends": "./tsconfig.json",
"exclude": [],
"include": [
"**/**.js",
"**/**.ts",
"**/**.svelte",
"**/**.astro",
"**/**.cjs",
"**/**.mjs",
"**/**.cts",
"**/**.mts",
"**/**.jsx",
"**/**.tsx"
]
"include": ["**/**.js", "**/**.ts", "**/**.cjs", "**/**.mjs", "**/**.cts", "**/**.mts"]
}

0 comments on commit a4e0d93

Please sign in to comment.