henkan 0.0.0 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/index.cjs.js +7 -6
- package/dist/index.cjs.js.map +2 -2
- package/dist/index.mjs +7 -6
- package/dist/index.mjs.map +2 -2
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# henkan
|
|
2
2
|
|
|
3
|
-
A Node.JS library that helps you convert any dictionary from [EDRDG](https://www.edrdg.org/), transform their entries into more user-friendly schemas and create Anki notes from
|
|
3
|
+
A Node.JS library that helps you convert any dictionary from [EDRDG](https://www.edrdg.org/), transform their entries into more user-friendly schemas and create Anki notes from them.
|
|
4
4
|
|
|
5
5
|
> The library is used for the [Full Japanese Study Deck](https://ankiweb.net/shared/info/1407096987), so some features might be tailored specifically to the deck.
|
|
6
6
|
|
|
@@ -79,4 +79,4 @@ See [CONTRIBUTING.md](CONTRIBUTING.md)
|
|
|
79
79
|
|
|
80
80
|
# License
|
|
81
81
|
|
|
82
|
-
This library is licensed under the [MIT License](LICENSE.md).
|
|
82
|
+
This library is licensed under the [MIT License](LICENSE.md).
|
package/dist/index.cjs.js
CHANGED
|
@@ -2203,11 +2203,11 @@ function generateAnkiNote(entry) {
|
|
|
2203
2203
|
function generateAnkiNotesFile(list) {
|
|
2204
2204
|
if (list.length > 0) {
|
|
2205
2205
|
const headers = [
|
|
2206
|
-
"#separator:tab
|
|
2207
|
-
"#html:true
|
|
2208
|
-
"#guid column:1
|
|
2209
|
-
"#notetype column:2
|
|
2210
|
-
"#deck column:3
|
|
2206
|
+
"#separator:tab",
|
|
2207
|
+
"#html:true",
|
|
2208
|
+
"#guid column:1",
|
|
2209
|
+
"#notetype column:2",
|
|
2210
|
+
"#deck column:3"
|
|
2211
2211
|
];
|
|
2212
2212
|
const ankiNotes = list.map((result) => {
|
|
2213
2213
|
if (!result.noteID || !result.noteTypeName || !result.deckPath)
|
|
@@ -2219,7 +2219,8 @@ function generateAnkiNotesFile(list) {
|
|
|
2219
2219
|
return `${result.noteID} ${result.noteTypeName} ${result.deckPath} ${note.join(" ")}`;
|
|
2220
2220
|
}).join("\n").trim();
|
|
2221
2221
|
if (ankiNotes.length === 0) throw new Error("Invalid list");
|
|
2222
|
-
return `${headers.join("")}
|
|
2222
|
+
return `${headers.join("\n")}
|
|
2223
|
+
${ankiNotes}`;
|
|
2223
2224
|
} else console.log("No entries available for Anki notes creation");
|
|
2224
2225
|
return void 0;
|
|
2225
2226
|
}
|