@tnotesjs/core 0.6.1 → 0.7.0
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/config/templates.ts +0 -5
- package/dist/{chunk-5F5RJ2HV.cjs → chunk-7FEANCT6.cjs} +16 -7
- package/dist/chunk-AGVER5MX.cjs +1746 -0
- package/dist/{chunk-TJ4527KA.cjs → chunk-BL22KD4V.cjs} +324 -950
- package/dist/{chunk-56PKXCOX.js → chunk-GWG75A5M.js} +13 -4
- package/dist/{chunk-DUTS75WQ.js → chunk-XNO3PCEH.js} +374 -1000
- package/dist/chunk-ZEQS64PE.js +1746 -0
- package/dist/cli/index.cjs +76 -155
- package/dist/cli/index.js +10 -89
- package/dist/markdown/index.cjs +2 -3
- package/dist/markdown/index.d.cts +1 -1
- package/dist/markdown/index.d.ts +1 -1
- package/dist/markdown/index.js +1 -2
- package/dist/{types-CwBWwNVv.d.ts → types-C_d0fFeD.d.ts} +8 -1
- package/dist/{types-CpsEy8lA.d.cts → types-MRBGgJTX.d.cts} +8 -1
- package/dist/vitepress/config/index.cjs +200 -132
- package/dist/vitepress/config/index.js +187 -119
- package/dist/workspace/index.cjs +4 -1202
- package/dist/workspace/index.d.cts +2 -2
- package/dist/workspace/index.d.ts +2 -2
- package/dist/workspace/index.js +4 -1202
- package/package.json +1 -1
- package/services/file-watcher/folderChangeHandler.ts +19 -15
- package/services/file-watcher/globalUpdateCoordinator.ts +21 -27
- package/services/file-watcher/service.ts +1 -6
- package/services/index.ts +0 -1
- package/services/note/service.ts +4 -6
- package/services/readme/service.ts +11 -18
- package/services/reconcileToc.ts +20 -0
- package/utils/index.ts +0 -9
- package/{services/toc → utils}/moveTocInside.test.ts +1 -1
- package/vitepress/components/constants.ts +2 -2
- package/vitepress/components/sidebar.data.ts +8 -5
- package/vitepress/plugins/sidebarStructurePlugin.ts +242 -145
- package/dist/chunk-3R7QSABB.cjs +0 -502
- package/dist/chunk-CZXRQPFJ.js +0 -11
- package/dist/chunk-HXED7KVT.cjs +0 -11
- package/dist/chunk-U6IBLREL.js +0 -502
- package/services/toc/index.ts +0 -5
- package/services/toc/service.ts +0 -759
- package/utils/migrateReadmeToToc.test.ts +0 -111
- package/utils/migrateReadmeToToc.ts +0 -135
|
@@ -1,11 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
// utils/generateAnchor.ts
|
|
2
|
+
import GithubSlugger from "github-slugger";
|
|
3
|
+
var slugger = new GithubSlugger();
|
|
4
|
+
var generateAnchor = (label) => {
|
|
5
|
+
slugger.reset();
|
|
6
|
+
return slugger.slug(label);
|
|
7
|
+
};
|
|
4
8
|
|
|
5
9
|
// markdown/noteFormatter.ts
|
|
6
|
-
import { format as prettierFormat } from "prettier";
|
|
7
10
|
var NOTE_TOC_START_TAG = "<!-- region:toc -->";
|
|
8
11
|
var NOTE_TOC_END_TAG = "<!-- endregion:toc -->";
|
|
12
|
+
async function prettierFormat(content, options) {
|
|
13
|
+
const module = await import("prettier");
|
|
14
|
+
const prettier = module.default ?? module;
|
|
15
|
+
return prettier.format(content, options);
|
|
16
|
+
}
|
|
9
17
|
function generatedNoteTitle(input) {
|
|
10
18
|
const dirName = `${input.noteIndex}. ${input.title}`;
|
|
11
19
|
const encodedDirName = encodeURIComponent(dirName);
|
|
@@ -170,6 +178,7 @@ async function formatTNotesNote(input) {
|
|
|
170
178
|
}
|
|
171
179
|
|
|
172
180
|
export {
|
|
181
|
+
generateAnchor,
|
|
173
182
|
NOTE_TOC_START_TAG,
|
|
174
183
|
NOTE_TOC_END_TAG,
|
|
175
184
|
formatTNotesNote
|