@mdfriday/foundry 26.4.20 → 26.5.1
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/dist/cjs/index.js +1 -1
- package/dist/cjs/obsidian/mobile.js +1 -1
- package/dist/cjs/worker/pool-manager.js +2 -2
- package/dist/cjs/worker/worker-node.js +2 -2
- package/dist/esm/index.js +1 -1
- package/dist/esm/obsidian/mobile.js +1 -1
- package/dist/types/internal/application/batch-task-queue.d.ts +17 -0
- package/dist/types/internal/application/container.d.ts +66 -0
- package/dist/types/internal/application/identity.d.ts +173 -0
- package/dist/types/internal/application/incremental-build-coordinator.d.ts +28 -0
- package/dist/types/internal/application/incremental-ssg.d.ts +4 -0
- package/dist/types/internal/application/index.d.ts +5 -4
- package/dist/types/internal/application/publish.d.ts +37 -0
- package/dist/types/internal/application/ssg-parallel.d.ts +6 -0
- package/dist/types/internal/application/ssg.d.ts +15 -0
- package/dist/types/internal/application/wiki-service-config.d.ts +65 -0
- package/dist/types/internal/application/wiki-service.d.ts +199 -0
- package/dist/types/internal/application/worker/pool-manager.d.ts +43 -0
- package/dist/types/internal/application/worker/worker-browser.d.ts +6 -0
- package/dist/types/internal/application/worker/worker-main.d.ts +12 -0
- package/dist/types/internal/application/worker/worker-state.d.ts +23 -0
- package/dist/types/internal/application/workspace.d.ts +98 -0
- package/dist/types/internal/domain/config/entity/config.d.ts +40 -0
- package/dist/types/internal/domain/config/entity/language.d.ts +51 -0
- package/dist/types/internal/domain/config/entity/markdown.d.ts +36 -0
- package/dist/types/internal/domain/config/entity/module.d.ts +36 -0
- package/dist/types/internal/domain/config/entity/root.d.ts +39 -0
- package/dist/types/internal/domain/config/entity/service.d.ts +36 -0
- package/dist/types/internal/domain/config/entity/social.d.ts +43 -0
- package/dist/types/internal/domain/config/entity/taxonomy.d.ts +39 -0
- package/dist/types/internal/domain/config/factory/config.d.ts +3 -0
- package/dist/types/internal/domain/config/factory/loader.d.ts +24 -0
- package/dist/types/internal/domain/config/factory/provider.d.ts +10 -0
- package/dist/types/internal/domain/config/factory/sourcedescriptor.d.ts +12 -0
- package/dist/types/internal/domain/config/type.d.ts +56 -0
- package/dist/types/internal/domain/config/vo/language.d.ts +6 -0
- package/dist/types/internal/domain/config/vo/markdown.d.ts +13 -0
- package/dist/types/internal/domain/config/vo/module.d.ts +9 -0
- package/dist/types/internal/domain/config/vo/root.d.ts +6 -0
- package/dist/types/internal/domain/config/vo/service.d.ts +6 -0
- package/dist/types/internal/domain/config/vo/social.d.ts +16 -0
- package/dist/types/internal/domain/config/vo/taxonomy.d.ts +12 -0
- package/dist/types/internal/domain/content/entity/content.d.ts +36 -0
- package/dist/types/internal/domain/content/entity/page.d.ts +23 -0
- package/dist/types/internal/domain/content/entity/pagebuilder.d.ts +83 -0
- package/dist/types/internal/domain/content/entity/pagecollector.d.ts +3 -0
- package/dist/types/internal/domain/content/entity/pagecontent.d.ts +14 -0
- package/dist/types/internal/domain/content/entity/pagemap.d.ts +69 -0
- package/dist/types/internal/domain/content/entity/pagesource.d.ts +52 -0
- package/dist/types/internal/domain/content/entity/pagetrees.d.ts +12 -0
- package/dist/types/internal/domain/content/entity/paginator.d.ts +19 -0
- package/dist/types/internal/domain/content/entity/section.d.ts +15 -0
- package/dist/types/internal/domain/content/entity/shortcode.d.ts +39 -0
- package/dist/types/internal/domain/content/entity/standalone.d.ts +9 -0
- package/dist/types/internal/domain/content/entity/taxonomy.d.ts +15 -0
- package/dist/types/internal/domain/content/entity/term.d.ts +6 -0
- package/dist/types/internal/domain/content/entity/translator.d.ts +22 -0
- package/dist/types/internal/domain/content/type.d.ts +6 -0
- package/dist/types/internal/domain/content/vo/classifier.d.ts +24 -0
- package/dist/types/internal/domain/content/vo/frontmatter.d.ts +65 -0
- package/dist/types/internal/domain/content/vo/kind.d.ts +10 -0
- package/dist/types/internal/domain/fs/entity/basefs.d.ts +23 -0
- package/dist/types/internal/domain/fs/entity/fs.d.ts +13 -0
- package/dist/types/internal/domain/fs/entity/originfs.d.ts +6 -0
- package/dist/types/internal/domain/fs/entity/overlaydir.d.ts +44 -0
- package/dist/types/internal/domain/fs/entity/overlayfs.d.ts +79 -0
- package/dist/types/internal/domain/fs/entity/service.d.ts +15 -0
- package/dist/types/internal/domain/fs/factory/fs.d.ts +4 -0
- package/dist/types/internal/domain/fs/type.d.ts +95 -0
- package/dist/types/internal/domain/fs/vo/dir.d.ts +41 -0
- package/dist/types/internal/domain/fs/vo/file.d.ts +28 -0
- package/dist/types/internal/domain/fs/vo/fileinfo.d.ts +23 -0
- package/dist/types/internal/domain/fs/vo/filemeta.d.ts +45 -0
- package/dist/types/internal/domain/fs/vo/filesystemscollector.d.ts +17 -0
- package/dist/types/internal/domain/fs/vo/filevitural.d.ts +8 -0
- package/dist/types/internal/domain/fs/vo/osfs.d.ts +12 -0
- package/dist/types/internal/domain/fs/vo/overlay-factory.d.ts +4 -0
- package/dist/types/internal/domain/fs/vo/overlayfs-factory.d.ts +42 -0
- package/dist/types/internal/domain/fs/vo/overlayoptions.d.ts +44 -0
- package/dist/types/internal/domain/fs/vo/static-copier.d.ts +22 -0
- package/dist/types/internal/domain/fs/vo/walkway.d.ts +22 -0
- package/dist/types/internal/domain/identity/entity/user.d.ts +100 -0
- package/dist/types/internal/domain/identity/factory/user-factory.d.ts +183 -0
- package/dist/types/internal/domain/identity/repository/index.d.ts +30 -0
- package/dist/types/internal/domain/identity/type.d.ts +17 -0
- package/dist/types/internal/domain/identity/value-object/device.d.ts +26 -0
- package/dist/types/internal/domain/identity/value-object/email.d.ts +29 -0
- package/dist/types/internal/domain/identity/value-object/license.d.ts +91 -0
- package/dist/types/internal/domain/identity/value-object/server-config.d.ts +37 -0
- package/dist/types/internal/domain/identity/value-object/sync-config.d.ts +47 -0
- package/dist/types/internal/domain/identity/value-object/token.d.ts +35 -0
- package/dist/types/internal/domain/markdown/entity/markdown.d.ts +41 -0
- package/dist/types/internal/domain/markdown/factory/it/config.d.ts +60 -0
- package/dist/types/internal/domain/markdown/factory/it/index.d.ts +21 -1
- package/dist/types/internal/domain/markdown/factory/it/parserresult.d.ts +3 -0
- package/dist/types/internal/domain/markdown/factory/it/plugins/callout-plugin.d.ts +40 -0
- package/dist/types/internal/domain/markdown/factory/it/plugins/latex-plugin.d.ts +23 -0
- package/dist/types/internal/domain/markdown/factory/it/plugins/mermaid-plugin.d.ts +24 -0
- package/dist/types/internal/domain/markdown/factory/it/plugins/tag-plugin.d.ts +71 -0
- package/dist/types/internal/domain/markdown/factory/it/plugins/wikilink-plugin.d.ts +28 -0
- package/dist/types/internal/domain/markdown/factory/it/plugins/wikilink.d.ts +31 -0
- package/dist/types/internal/domain/markdown/factory/it/tableofcontents.d.ts +21 -0
- package/dist/types/internal/domain/markdown/factory/it/util/path.d.ts +11 -0
- package/dist/types/internal/domain/markdown/factory/it/util/slugger-fallback.d.ts +6 -0
- package/dist/types/internal/domain/markdown/type.d.ts +159 -0
- package/dist/types/internal/domain/markdown/vo/config.d.ts +48 -0
- package/dist/types/internal/domain/markdown/vo/content.d.ts +92 -0
- package/dist/types/internal/domain/markdown/vo/context.d.ts +9 -0
- package/dist/types/internal/domain/markdown/vo/highlight.d.ts +15 -0
- package/dist/types/internal/domain/markdown/vo/pageparser.d.ts +9 -0
- package/dist/types/internal/domain/markdown/vo/parseinfo.d.ts +36 -0
- package/dist/types/internal/domain/markdown/vo/parserresult.d.ts +6 -0
- package/dist/types/internal/domain/markdown/vo/shortcode.d.ts +31 -1
- package/dist/types/internal/domain/markdown/vo/tableofcontents.d.ts +21 -0
- package/dist/types/internal/domain/module/entity/lang.d.ts +12 -0
- package/dist/types/internal/domain/module/entity/module.d.ts +73 -0
- package/dist/types/internal/domain/module/factory/module.d.ts +6 -0
- package/dist/types/internal/domain/module/type.d.ts +58 -0
- package/dist/types/internal/domain/module/vo/cache.d.ts +48 -0
- package/dist/types/internal/domain/module/vo/httpclient.d.ts +14 -0
- package/dist/types/internal/domain/module/vo/module.d.ts +76 -0
- package/dist/types/internal/domain/module/vo/mount.d.ts +39 -0
- package/dist/types/internal/domain/module/vo/themes.d.ts +38 -0
- package/dist/types/internal/domain/module/vo/zipextractor.d.ts +31 -0
- package/dist/types/internal/domain/paths/entity/path.d.ts +28 -0
- package/dist/types/internal/domain/paths/factory/pathfactory.d.ts +82 -0
- package/dist/types/internal/domain/paths/type.d.ts +132 -0
- package/dist/types/internal/domain/paths/vo/pathcomponents.d.ts +94 -0
- package/dist/types/internal/domain/paths/vo/pathparser.d.ts +77 -0
- package/dist/types/internal/domain/publish/entity/publisher.d.ts +26 -0
- package/dist/types/internal/domain/publish/factory/publisher-factory.d.ts +17 -0
- package/dist/types/internal/domain/publish/repository/http-client.d.ts +21 -0
- package/dist/types/internal/domain/publish/repository/manifest-repository.d.ts +27 -0
- package/dist/types/internal/domain/publish/type.d.ts +49 -0
- package/dist/types/internal/domain/publish/value-object/ftp-publisher.d.ts +30 -0
- package/dist/types/internal/domain/publish/value-object/mdfriday-publisher.d.ts +57 -0
- package/dist/types/internal/domain/publish/value-object/netlify-publisher.d.ts +55 -0
- package/dist/types/internal/domain/publish/value-object/publish-config.d.ts +38 -0
- package/dist/types/internal/domain/publish/value-object/publish-manifest.d.ts +50 -0
- package/dist/types/internal/domain/resources/entity/http.d.ts +11 -0
- package/dist/types/internal/domain/resources/entity/integrity.d.ts +4 -0
- package/dist/types/internal/domain/resources/entity/minifier.d.ts +4 -0
- package/dist/types/internal/domain/resources/entity/publisher.d.ts +24 -0
- package/dist/types/internal/domain/resources/entity/resource.d.ts +4 -0
- package/dist/types/internal/domain/resources/entity/resources.d.ts +40 -0
- package/dist/types/internal/domain/resources/entity/template.d.ts +4 -0
- package/dist/types/internal/domain/resources/factory/resource.d.ts +4 -0
- package/dist/types/internal/domain/site/entity/language.d.ts +55 -0
- package/dist/types/internal/domain/site/entity/menu-builder.d.ts +50 -0
- package/dist/types/internal/domain/site/entity/navigation.d.ts +8 -0
- package/dist/types/internal/domain/site/entity/page.d.ts +88 -0
- package/dist/types/internal/domain/site/entity/pagegraph.d.ts +85 -0
- package/dist/types/internal/domain/site/entity/pager.d.ts +6 -0
- package/dist/types/internal/domain/site/entity/publisher.d.ts +26 -0
- package/dist/types/internal/domain/site/entity/ref.d.ts +27 -0
- package/dist/types/internal/domain/site/entity/site.d.ts +178 -0
- package/dist/types/internal/domain/site/factory/navigation-factory.d.ts +6 -0
- package/dist/types/internal/domain/site/factory/site.d.ts +4 -0
- package/dist/types/internal/domain/site/service/html-link-processor.d.ts +44 -0
- package/dist/types/internal/domain/site/type.d.ts +100 -0
- package/dist/types/internal/domain/site/valueobject/author.d.ts +16 -0
- package/dist/types/internal/domain/site/valueobject/baseurl.d.ts +39 -0
- package/dist/types/internal/domain/site/valueobject/menu.d.ts +49 -0
- package/dist/types/internal/domain/site/valueobject/organization.d.ts +37 -0
- package/dist/types/internal/domain/site/valueobject/path.d.ts +50 -0
- package/dist/types/internal/domain/site/valueobject/version.d.ts +14 -0
- package/dist/types/internal/domain/template/entity/executor.d.ts +22 -0
- package/dist/types/internal/domain/template/entity/lookup.d.ts +55 -0
- package/dist/types/internal/domain/template/entity/parser.d.ts +40 -0
- package/dist/types/internal/domain/template/entity/template.d.ts +87 -0
- package/dist/types/internal/domain/template/factory/template.d.ts +61 -0
- package/dist/types/internal/domain/template/type.d.ts +109 -0
- package/dist/types/internal/domain/template/vo/baseof.d.ts +47 -0
- package/dist/types/internal/domain/template/vo/info.d.ts +28 -0
- package/dist/types/internal/domain/template/vo/namespace.d.ts +91 -0
- package/dist/types/internal/domain/template/vo/registry.d.ts +160 -0
- package/dist/types/internal/domain/wiki/entity/concept.d.ts +31 -0
- package/dist/types/internal/domain/wiki/entity/connection.d.ts +29 -0
- package/dist/types/internal/domain/wiki/entity/conversation.d.ts +65 -0
- package/dist/types/internal/domain/wiki/entity/embedding-index.d.ts +60 -0
- package/dist/types/internal/domain/wiki/entity/entity.d.ts +32 -0
- package/dist/types/internal/domain/wiki/entity/knowledge-base.d.ts +292 -0
- package/dist/types/internal/domain/wiki/entity/operation-log.d.ts +82 -0
- package/dist/types/internal/domain/wiki/factory/wiki-factory.d.ts +41 -0
- package/dist/types/internal/domain/wiki/index.d.ts +22 -0
- package/dist/types/internal/domain/wiki/repository/conversation-repository.interface.d.ts +29 -0
- package/dist/types/internal/domain/wiki/repository/crypto-service.d.ts +16 -0
- package/dist/types/internal/domain/wiki/repository/embedding-provider.d.ts +12 -0
- package/dist/types/internal/domain/wiki/repository/file-system.d.ts +43 -0
- package/dist/types/internal/domain/wiki/repository/index.d.ts +14 -0
- package/dist/types/internal/domain/wiki/repository/kb-repository.interface.d.ts +30 -0
- package/dist/types/internal/domain/wiki/repository/llm-http-client.d.ts +40 -0
- package/dist/types/internal/domain/wiki/repository/llm-provider.d.ts +34 -0
- package/dist/types/internal/domain/wiki/repository/path-service.d.ts +32 -0
- package/dist/types/internal/domain/wiki/repository/wiki-page-repository.interface.d.ts +49 -0
- package/dist/types/internal/domain/wiki/value-object/connection-type.d.ts +24 -0
- package/dist/types/internal/domain/wiki/value-object/content-annotator.d.ts +61 -0
- package/dist/types/internal/domain/wiki/value-object/entity-id.d.ts +17 -0
- package/dist/types/internal/domain/wiki/value-object/entity-type.d.ts +24 -0
- package/dist/types/internal/domain/wiki/value-object/extraction-parser.d.ts +27 -0
- package/dist/types/internal/domain/wiki/value-object/extraction-result.d.ts +32 -0
- package/dist/types/internal/domain/wiki/value-object/retrieval.d.ts +228 -0
- package/dist/types/internal/domain/wiki/value-object/source-record.d.ts +17 -0
- package/dist/types/internal/domain/wiki/value-object/wiki-config.d.ts +40 -0
- package/dist/types/internal/domain/wiki/value-object/wiki-index-generator.d.ts +31 -0
- package/dist/types/internal/domain/wiki/value-object/wiki-page-renderer.d.ts +42 -0
- package/dist/types/internal/domain/workspace/entity/authentication.d.ts +29 -0
- package/dist/types/internal/domain/workspace/entity/project.d.ts +173 -0
- package/dist/types/internal/domain/workspace/entity/workspace.d.ts +85 -0
- package/dist/types/internal/domain/workspace/factory/workspace-factory.d.ts +107 -0
- package/dist/types/internal/domain/workspace/repository/file-system.d.ts +241 -0
- package/dist/types/internal/domain/workspace/repository/index.d.ts +6 -0
- package/dist/types/internal/domain/workspace/repository.d.ts +72 -0
- package/dist/types/internal/domain/workspace/type.d.ts +18 -0
- package/dist/types/internal/domain/workspace/value-object/folder-structure.d.ts +41 -0
- package/dist/types/internal/domain/workspace/value-object/project-metadata.d.ts +36 -0
- package/dist/types/internal/domain/workspace/value-object/workspace-metadata.d.ts +7 -0
- package/dist/types/internal/infrastructure/embedding/embedding-provider.interface.d.ts +33 -0
- package/dist/types/internal/infrastructure/embedding/index.d.ts +5 -0
- package/dist/types/internal/infrastructure/embedding/ollama-embedding-provider.d.ts +24 -0
- package/dist/types/internal/infrastructure/http/netlify-http-client.d.ts +20 -0
- package/dist/types/internal/infrastructure/http/node-http-client.d.ts +3 -0
- package/dist/types/internal/infrastructure/index.d.ts +8 -0
- package/dist/types/internal/infrastructure/llm/fetch-http-client.d.ts +24 -0
- package/dist/types/internal/infrastructure/llm/index.d.ts +6 -0
- package/dist/types/internal/infrastructure/llm/llm-config.d.ts +80 -0
- package/dist/types/internal/infrastructure/llm/lmstudio-provider.d.ts +55 -0
- package/dist/types/internal/infrastructure/llm/node-llm-http-client.d.ts +21 -0
- package/dist/types/internal/infrastructure/llm/ollama-provider.d.ts +17 -0
- package/dist/types/internal/infrastructure/llm/openai-compatible-provider.d.ts +70 -0
- package/dist/types/internal/infrastructure/llm/provider-factory.d.ts +36 -0
- package/dist/types/internal/infrastructure/llm/provider.d.ts +77 -0
- package/dist/types/internal/infrastructure/node/index.d.ts +11 -0
- package/dist/types/internal/infrastructure/node/node-conversation-repository.d.ts +21 -0
- package/dist/types/internal/infrastructure/node/node-crypto-service.d.ts +10 -0
- package/dist/types/internal/infrastructure/node/node-file-system.d.ts +29 -0
- package/dist/types/internal/infrastructure/node/node-kb-repository.d.ts +18 -0
- package/dist/types/internal/infrastructure/node/node-path-service.d.ts +14 -0
- package/dist/types/internal/infrastructure/node/node-wiki-page-repository.d.ts +25 -0
- package/dist/types/internal/infrastructure/persistence/node-file-system.d.ts +8 -0
- package/dist/types/internal/infrastructure/persistence/node-manifest-repository.d.ts +31 -0
- package/dist/types/internal/infrastructure/persistence/node-snapshot-repository.d.ts +28 -0
- package/dist/types/internal/infrastructure/persistence/node-workspace-repository.d.ts +9 -0
- package/dist/types/pkg/cahce/cache.d.ts +56 -0
- package/dist/types/pkg/lang/data.d.ts +21 -0
- package/dist/types/pkg/lang/index.d.ts +46 -0
- package/dist/types/pkg/lang/service.d.ts +49 -0
- package/dist/types/pkg/lang/types.d.ts +29 -0
- package/dist/types/pkg/log/http.d.ts +16 -0
- package/dist/types/pkg/log/manager.d.ts +57 -0
- package/dist/types/pkg/maps/scratch.d.ts +25 -0
- package/dist/types/pkg/md/parser/item.d.ts +3 -3
- package/dist/types/pkg/media/type.d.ts +19 -0
- package/dist/types/pkg/page-filter/index.d.ts +29 -0
- package/dist/types/pkg/paths/index.d.ts +9 -0
- package/dist/types/pkg/text/index.d.ts +4 -0
- package/dist/types/pkg/web/server/livereload-server.d.ts +7 -0
- package/dist/types/pkg/web/watcher/content-file-watcher.d.ts +3 -0
- package/package.json +21 -15
- package/dist/types/index.d.ts +0 -20
- package/dist/types/internal/interfaces/obsidian/adapters/identity-adapter.d.ts +0 -5
- package/dist/types/internal/interfaces/obsidian/adapters/index.d.ts +0 -2
- package/dist/types/internal/interfaces/obsidian/adapters/workspace-adapter.d.ts +0 -8
- package/dist/types/internal/interfaces/obsidian/desktop/adapters/identity-adapter.d.ts +0 -6
- package/dist/types/internal/interfaces/obsidian/desktop/adapters/index.d.ts +0 -2
- package/dist/types/internal/interfaces/obsidian/desktop/adapters/workspace-adapter.d.ts +0 -12
- package/dist/types/internal/interfaces/obsidian/desktop/container.d.ts +0 -7
- package/dist/types/internal/interfaces/obsidian/desktop/index.d.ts +0 -22
- package/dist/types/internal/interfaces/obsidian/index.d.ts +0 -7
- package/dist/types/internal/interfaces/obsidian/mobile/adapters/identity-adapter.d.ts +0 -9
- package/dist/types/internal/interfaces/obsidian/mobile/adapters/index.d.ts +0 -2
- package/dist/types/internal/interfaces/obsidian/mobile/adapters/workspace-adapter.d.ts +0 -13
- package/dist/types/internal/interfaces/obsidian/mobile/config-types.d.ts +0 -13
- package/dist/types/internal/interfaces/obsidian/mobile/container.d.ts +0 -6
- package/dist/types/internal/interfaces/obsidian/mobile/index.d.ts +0 -16
- package/dist/types/internal/interfaces/obsidian/mobile.d.ts +0 -2
- package/dist/types/internal/interfaces/obsidian/services/auth.service.d.ts +0 -11
- package/dist/types/internal/interfaces/obsidian/services/build.service.d.ts +0 -9
- package/dist/types/internal/interfaces/obsidian/services/config.service.d.ts +0 -31
- package/dist/types/internal/interfaces/obsidian/services/domain.service.d.ts +0 -15
- package/dist/types/internal/interfaces/obsidian/services/license.service.d.ts +0 -22
- package/dist/types/internal/interfaces/obsidian/services/project.service.d.ts +0 -17
- package/dist/types/internal/interfaces/obsidian/services/publish.service.d.ts +0 -11
- package/dist/types/internal/interfaces/obsidian/services/serve.service.d.ts +0 -18
- package/dist/types/internal/interfaces/obsidian/services/workspace.service.d.ts +0 -10
- package/dist/types/internal/interfaces/obsidian/types/auth.d.ts +0 -27
- package/dist/types/internal/interfaces/obsidian/types/build.d.ts +0 -23
- package/dist/types/internal/interfaces/obsidian/types/config.d.ts +0 -16
- package/dist/types/internal/interfaces/obsidian/types/domain.d.ts +0 -46
- package/dist/types/internal/interfaces/obsidian/types/index.d.ts +0 -9
- package/dist/types/internal/interfaces/obsidian/types/license.d.ts +0 -87
- package/dist/types/internal/interfaces/obsidian/types/project.d.ts +0 -56
- package/dist/types/internal/interfaces/obsidian/types/publish.d.ts +0 -33
- package/dist/types/internal/interfaces/obsidian/types/serve.d.ts +0 -46
- package/dist/types/internal/interfaces/obsidian/types/workspace.d.ts +0 -27
- package/dist/types/pkg/log/browser-manager.d.ts +0 -20
- package/dist/types/pkg/log/browser.d.ts +0 -25
- package/dist/types/pkg/media/buildin.d.ts +0 -3
|
@@ -1,19 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Token Value Object
|
|
3
|
+
*
|
|
4
|
+
* 不可变的认证令牌值对象
|
|
5
|
+
*/
|
|
1
6
|
export declare class Token {
|
|
2
7
|
private readonly value;
|
|
3
8
|
private readonly expiresAt;
|
|
4
9
|
private constructor();
|
|
10
|
+
/**
|
|
11
|
+
* 创建 Token 实例
|
|
12
|
+
*/
|
|
5
13
|
static create(value: string, expiresAt?: number): Token;
|
|
14
|
+
/**
|
|
15
|
+
* 从 JSON 数据创建 Token
|
|
16
|
+
*/
|
|
6
17
|
static fromJSON(data: {
|
|
7
18
|
token: string;
|
|
8
19
|
expiresAt?: number;
|
|
9
20
|
}): Token;
|
|
21
|
+
/**
|
|
22
|
+
* 获取 token 字符串
|
|
23
|
+
*/
|
|
10
24
|
getValue(): string;
|
|
25
|
+
/**
|
|
26
|
+
* 获取过期时间(毫秒时间戳)
|
|
27
|
+
*/
|
|
11
28
|
getExpiresAt(): number | undefined;
|
|
29
|
+
/**
|
|
30
|
+
* 检查 token 是否已过期
|
|
31
|
+
*/
|
|
12
32
|
isExpired(): boolean;
|
|
33
|
+
/**
|
|
34
|
+
* 检查 token 是否有效(未过期)
|
|
35
|
+
*/
|
|
13
36
|
isValid(): boolean;
|
|
37
|
+
/**
|
|
38
|
+
* 获取剩余有效时间(毫秒)
|
|
39
|
+
*/
|
|
14
40
|
getRemainingTime(): number | null;
|
|
41
|
+
/**
|
|
42
|
+
* 比较两个 Token 是否相等
|
|
43
|
+
*/
|
|
15
44
|
equals(other: Token): boolean;
|
|
45
|
+
/**
|
|
46
|
+
* 转换为字符串(返回 token 值)
|
|
47
|
+
*/
|
|
16
48
|
toString(): string;
|
|
49
|
+
/**
|
|
50
|
+
* 序列化为 JSON
|
|
51
|
+
*/
|
|
17
52
|
toJSON(): {
|
|
18
53
|
token: string;
|
|
19
54
|
expiresAt?: number;
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { ContentResult, DocumentContext, Highlighter, Markdown, MarkdownRenderer, ParseAndRenderOptions, ParsedContentResult, RenderableDocument, RenderContext, Result } from '../type';
|
|
2
|
+
/**
|
|
3
|
+
* MarkdownImpl implements the main Markdown interface
|
|
4
|
+
* This is the TypeScript equivalent of the Go entity.Markdown
|
|
5
|
+
*/
|
|
2
6
|
export declare class MarkdownImpl implements Markdown {
|
|
3
7
|
private renderer;
|
|
4
8
|
private highlighter;
|
|
@@ -9,16 +13,53 @@ export declare class MarkdownImpl implements Markdown {
|
|
|
9
13
|
renderCodeblock(cctx: any, w: import('../type').FlexiWriter, ctx: import('../type').CodeblockContext): Promise<void>;
|
|
10
14
|
isDefaultCodeBlockRenderer(): boolean;
|
|
11
15
|
prepareRender(source: Uint8Array): Promise<RenderableDocument>;
|
|
16
|
+
/**
|
|
17
|
+
* Parse and render content in one step - simplified interface for external use
|
|
18
|
+
* This method hides implementation details and provides a clean interface
|
|
19
|
+
*/
|
|
12
20
|
parseAndRenderContent(source: Uint8Array, options?: ParseAndRenderOptions): Promise<ContentResult>;
|
|
21
|
+
/**
|
|
22
|
+
* Check if the renderer supports tag collection (MarkdownItRenderer)
|
|
23
|
+
*/
|
|
13
24
|
private hasCollectedTagsSupport;
|
|
25
|
+
/**
|
|
26
|
+
* Get collected tags from renderer (if supported)
|
|
27
|
+
*/
|
|
14
28
|
private getCollectedTags;
|
|
29
|
+
/**
|
|
30
|
+
* Parse markdown source with front matter and shortcodes
|
|
31
|
+
*/
|
|
15
32
|
parseContent(source: Uint8Array): Promise<ParsedContentResult>;
|
|
33
|
+
/**
|
|
34
|
+
* Parse front matter from item
|
|
35
|
+
*/
|
|
16
36
|
private parseFrontMatter;
|
|
37
|
+
/**
|
|
38
|
+
* Simple YAML parser (basic implementation)
|
|
39
|
+
*/
|
|
17
40
|
private parseYAML;
|
|
41
|
+
/**
|
|
42
|
+
* Simple TOML parser using smol-toml library
|
|
43
|
+
*/
|
|
18
44
|
private parseTOML;
|
|
45
|
+
/**
|
|
46
|
+
* Simple JSON parser
|
|
47
|
+
*/
|
|
19
48
|
private parseJSON;
|
|
49
|
+
/**
|
|
50
|
+
* Simple Org mode parser (basic implementation)
|
|
51
|
+
*/
|
|
20
52
|
private parseOrg;
|
|
53
|
+
/**
|
|
54
|
+
* Parse value (string, number, boolean, array)
|
|
55
|
+
*/
|
|
21
56
|
private parseValue;
|
|
57
|
+
/**
|
|
58
|
+
* Parse markdown source into tokens and create parsing result
|
|
59
|
+
*/
|
|
22
60
|
private parse;
|
|
61
|
+
/**
|
|
62
|
+
* Render the parsed result to bytes
|
|
63
|
+
*/
|
|
23
64
|
private renderToBytes;
|
|
24
65
|
}
|
|
@@ -1,9 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Auto heading ID types
|
|
3
|
+
*/
|
|
1
4
|
export declare const AutoHeadingIDType: {
|
|
2
5
|
readonly GitHub: "github";
|
|
3
6
|
readonly GitHubAscii: "github-ascii";
|
|
4
7
|
readonly Blackfriday: "blackfriday";
|
|
5
8
|
};
|
|
6
9
|
export type AutoHeadingIDType = typeof AutoHeadingIDType[keyof typeof AutoHeadingIDType];
|
|
10
|
+
/**
|
|
11
|
+
* Typographer configuration
|
|
12
|
+
*/
|
|
7
13
|
export interface TypographerConfig {
|
|
8
14
|
disable: boolean;
|
|
9
15
|
leftSingleQuote: string;
|
|
@@ -17,20 +23,32 @@ export interface TypographerConfig {
|
|
|
17
23
|
rightAngleQuote: string;
|
|
18
24
|
apostrophe: string;
|
|
19
25
|
}
|
|
26
|
+
/**
|
|
27
|
+
* CJK configuration
|
|
28
|
+
*/
|
|
20
29
|
export interface CJKConfig {
|
|
21
30
|
enable: boolean;
|
|
22
31
|
eastAsianLineBreaks: boolean;
|
|
23
32
|
eastAsianLineBreaksStyle: string;
|
|
24
33
|
escapedSpace: boolean;
|
|
25
34
|
}
|
|
35
|
+
/**
|
|
36
|
+
* Delimiters configuration
|
|
37
|
+
*/
|
|
26
38
|
export interface DelimitersConfig {
|
|
27
39
|
inline: string[][];
|
|
28
40
|
block: string[][];
|
|
29
41
|
}
|
|
42
|
+
/**
|
|
43
|
+
* Passthrough configuration
|
|
44
|
+
*/
|
|
30
45
|
export interface PassthroughConfig {
|
|
31
46
|
enable: boolean;
|
|
32
47
|
delimiters: DelimitersConfig;
|
|
33
48
|
}
|
|
49
|
+
/**
|
|
50
|
+
* Highlight configuration
|
|
51
|
+
*/
|
|
34
52
|
export interface HighlightConfig {
|
|
35
53
|
style: string;
|
|
36
54
|
lineNos: boolean;
|
|
@@ -43,31 +61,55 @@ export interface HighlightConfig {
|
|
|
43
61
|
guessSyntax: boolean;
|
|
44
62
|
tabWidth: number;
|
|
45
63
|
}
|
|
64
|
+
/**
|
|
65
|
+
* Parser attribute configuration
|
|
66
|
+
*/
|
|
46
67
|
export interface ParserAttributeConfig {
|
|
47
68
|
title: boolean;
|
|
48
69
|
block: boolean;
|
|
49
70
|
}
|
|
71
|
+
/**
|
|
72
|
+
* Parser configuration
|
|
73
|
+
*/
|
|
50
74
|
export interface ParserConfig {
|
|
51
75
|
autoHeadingID: boolean;
|
|
52
76
|
autoHeadingIDType: AutoHeadingIDType;
|
|
53
77
|
wrapStandAloneImageWithinParagraph: boolean;
|
|
54
78
|
attribute: ParserAttributeConfig;
|
|
55
79
|
}
|
|
80
|
+
/**
|
|
81
|
+
* Renderer configuration
|
|
82
|
+
*/
|
|
56
83
|
export interface RendererConfig {
|
|
57
84
|
unsafe: boolean;
|
|
58
85
|
}
|
|
86
|
+
/**
|
|
87
|
+
* Wikilink configuration
|
|
88
|
+
*/
|
|
59
89
|
export interface WikilinkConfig {
|
|
60
90
|
enable: boolean;
|
|
91
|
+
/** Disable broken wikilink rendering */
|
|
61
92
|
disableBrokenWikilinks?: boolean;
|
|
93
|
+
/** Link resolution strategy for Pass 2 */
|
|
62
94
|
markdownLinkResolution?: 'absolute' | 'relative' | 'shortest';
|
|
95
|
+
/** Pretty links (show only filename) */
|
|
63
96
|
prettyLinks?: boolean;
|
|
64
97
|
}
|
|
98
|
+
/**
|
|
99
|
+
* LaTeX configuration
|
|
100
|
+
*/
|
|
65
101
|
export interface LatexConfig {
|
|
66
102
|
enable: boolean;
|
|
67
103
|
}
|
|
104
|
+
/**
|
|
105
|
+
* Mermaid diagram configuration
|
|
106
|
+
*/
|
|
68
107
|
export interface MermaidConfig {
|
|
69
108
|
enable: boolean;
|
|
70
109
|
}
|
|
110
|
+
/**
|
|
111
|
+
* Extensions configuration
|
|
112
|
+
*/
|
|
71
113
|
export interface ExtensionsConfig {
|
|
72
114
|
typographer: TypographerConfig;
|
|
73
115
|
footnote: boolean;
|
|
@@ -86,16 +128,28 @@ export interface ExtensionsConfig {
|
|
|
86
128
|
latex?: LatexConfig;
|
|
87
129
|
mermaid?: MermaidConfig;
|
|
88
130
|
}
|
|
131
|
+
/**
|
|
132
|
+
* Image render hook configuration
|
|
133
|
+
*/
|
|
89
134
|
export interface ImageRenderHookConfig {
|
|
90
135
|
enableDefault: boolean;
|
|
91
136
|
}
|
|
137
|
+
/**
|
|
138
|
+
* Link render hook configuration
|
|
139
|
+
*/
|
|
92
140
|
export interface LinkRenderHookConfig {
|
|
93
141
|
enableDefault: boolean;
|
|
94
142
|
}
|
|
143
|
+
/**
|
|
144
|
+
* Render hooks configuration
|
|
145
|
+
*/
|
|
95
146
|
export interface RenderHooksConfig {
|
|
96
147
|
image: ImageRenderHookConfig;
|
|
97
148
|
link: LinkRenderHookConfig;
|
|
98
149
|
}
|
|
150
|
+
/**
|
|
151
|
+
* Main Markdown configuration
|
|
152
|
+
*/
|
|
99
153
|
export interface DomainMarkdownConfig {
|
|
100
154
|
renderer: RendererConfig;
|
|
101
155
|
parser: ParserConfig;
|
|
@@ -103,5 +157,11 @@ export interface DomainMarkdownConfig {
|
|
|
103
157
|
duplicateResourceFiles: boolean;
|
|
104
158
|
renderHooks: RenderHooksConfig;
|
|
105
159
|
}
|
|
160
|
+
/**
|
|
161
|
+
* Default highlight configuration
|
|
162
|
+
*/
|
|
106
163
|
export declare const DefaultHighlightConfig: HighlightConfig;
|
|
164
|
+
/**
|
|
165
|
+
* Default markdown configuration
|
|
166
|
+
*/
|
|
107
167
|
export declare const DefaultMarkdownConfig: DomainMarkdownConfig;
|
|
@@ -1,23 +1,43 @@
|
|
|
1
1
|
import MarkdownIt from 'markdown-it';
|
|
2
|
-
import Token from 'markdown-it/lib/token.mjs';
|
|
2
|
+
import type Token from 'markdown-it/lib/token.mjs';
|
|
3
3
|
import { DomainMarkdownConfig } from './config';
|
|
4
4
|
import { MarkdownRenderer, ParsingResult } from "@internal/domain/markdown";
|
|
5
|
+
/**
|
|
6
|
+
* MarkdownIt-based renderer implementation
|
|
7
|
+
*/
|
|
5
8
|
export declare class MarkdownItRenderer implements MarkdownRenderer {
|
|
6
9
|
private md;
|
|
7
10
|
private config;
|
|
8
11
|
private idGenerator;
|
|
9
12
|
private collectedTags;
|
|
10
13
|
constructor(config: DomainMarkdownConfig, externalMd?: MarkdownIt);
|
|
14
|
+
/**
|
|
15
|
+
* Set up custom renderer rules (heading auto ID, etc.)
|
|
16
|
+
* Called once during initialization, not on every render
|
|
17
|
+
*/
|
|
11
18
|
private setupRendererRules;
|
|
12
19
|
render(source: string): Promise<string>;
|
|
20
|
+
/**
|
|
21
|
+
* Get collected tags from last render
|
|
22
|
+
* These tags should be injected into frontmatter.tags
|
|
23
|
+
*/
|
|
13
24
|
getCollectedTags(): string[];
|
|
14
25
|
parse(source: string): Promise<ParsingResult>;
|
|
15
26
|
_parse(source: string): Promise<Token[]>;
|
|
27
|
+
/**
|
|
28
|
+
* Get the underlying MarkdownIt instance
|
|
29
|
+
*/
|
|
16
30
|
getMarkdownIt(): MarkdownIt;
|
|
31
|
+
/**
|
|
32
|
+
* Add a custom plugin
|
|
33
|
+
*/
|
|
17
34
|
addPlugin(plugin: any, options?: any): void;
|
|
18
35
|
private createMarkdownItInstance;
|
|
19
36
|
private configureBasicPlugins;
|
|
20
37
|
}
|
|
38
|
+
/**
|
|
39
|
+
* Factory function to create MarkdownIt renderer with default configuration
|
|
40
|
+
*/
|
|
21
41
|
export declare function createMarkdownItRenderer(config?: Partial<DomainMarkdownConfig>, externalMd?: MarkdownIt): MarkdownItRenderer;
|
|
22
42
|
export { DomainMarkdownConfig, DefaultMarkdownConfig } from './config';
|
|
23
43
|
export { ParserResult } from './parserresult';
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import Token from 'markdown-it/lib/token.mjs';
|
|
2
2
|
import { ParsingResult, Header, TocFragments } from '../../index';
|
|
3
3
|
import { AutoIDGenerator } from '@internal/domain/markdown/vo/tableofcontents';
|
|
4
|
+
/**
|
|
5
|
+
* ParserResult implements ParsingResult
|
|
6
|
+
*/
|
|
4
7
|
export declare class ParserResult implements ParsingResult {
|
|
5
8
|
private _headers;
|
|
6
9
|
private _toc;
|
|
@@ -1,6 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* markdown-it plugin for Obsidian-style callouts
|
|
3
|
+
*
|
|
4
|
+
* Ported from Quartz v4: quartz/plugins/transformers/ofm.ts (callout handling)
|
|
5
|
+
*
|
|
6
|
+
* This plugin follows markdown-it best practices:
|
|
7
|
+
* 1. Block parsing rule to recognize blockquote-based callout syntax
|
|
8
|
+
* 2. Token-based representation
|
|
9
|
+
* 3. Custom renderer for callout HTML output
|
|
10
|
+
*
|
|
11
|
+
* Supports:
|
|
12
|
+
* - All Obsidian callout types: note, abstract, info, todo, tip, success, etc.
|
|
13
|
+
* - Custom titles: > [!note] Custom Title
|
|
14
|
+
* - Foldable callouts: > [!note]+ (expanded) or > [!note]- (collapsed)
|
|
15
|
+
* - Nested content with proper formatting
|
|
16
|
+
*
|
|
17
|
+
* Syntax:
|
|
18
|
+
* ```markdown
|
|
19
|
+
* > [!note] Optional Title
|
|
20
|
+
* > Content line 1
|
|
21
|
+
* > Content line 2
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
1
24
|
import MarkdownIt from 'markdown-it';
|
|
25
|
+
/**
|
|
26
|
+
* Plugin options
|
|
27
|
+
*/
|
|
2
28
|
export interface CalloutPluginOptions {
|
|
29
|
+
/** Enable/disable callout parsing */
|
|
3
30
|
enable?: boolean;
|
|
4
31
|
}
|
|
32
|
+
/**
|
|
33
|
+
* markdown-it plugin interface
|
|
34
|
+
*
|
|
35
|
+
* Usage:
|
|
36
|
+
* const md = new MarkdownIt();
|
|
37
|
+
* md.use(calloutPlugin, { enable: true });
|
|
38
|
+
*
|
|
39
|
+
* @param md - MarkdownIt instance
|
|
40
|
+
* @param options - Plugin options
|
|
41
|
+
*/
|
|
5
42
|
export declare function calloutPlugin(md: MarkdownIt, options?: CalloutPluginOptions): void;
|
|
43
|
+
/**
|
|
44
|
+
* Export as default for convenience
|
|
45
|
+
*/
|
|
6
46
|
export default calloutPlugin;
|
|
@@ -1,6 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LaTeX markdown-it plugin for Quartz-style math expressions
|
|
3
|
+
* Reference: quartz-src/quartz/plugins/transformers/latex.ts
|
|
4
|
+
*
|
|
5
|
+
* This plugin identifies $...$ (inline) and $$...$$ (block) math expressions
|
|
6
|
+
* and generates HTML with data attributes for client-side KaTeX rendering.
|
|
7
|
+
*
|
|
8
|
+
* Unlike remark-math + rehype-katex used in Quartz, we use markdown-it's
|
|
9
|
+
* inline/block rule system to achieve the same result.
|
|
10
|
+
*/
|
|
1
11
|
import MarkdownIt from 'markdown-it';
|
|
2
12
|
export interface LatexPluginOptions {
|
|
3
13
|
enable?: boolean;
|
|
4
14
|
}
|
|
15
|
+
/**
|
|
16
|
+
* markdown-it plugin interface
|
|
17
|
+
*
|
|
18
|
+
* Usage:
|
|
19
|
+
* const md = new MarkdownIt();
|
|
20
|
+
* md.use(latexPlugin, { enable: true });
|
|
21
|
+
*
|
|
22
|
+
* @param md - MarkdownIt instance
|
|
23
|
+
* @param options - Plugin options
|
|
24
|
+
*/
|
|
5
25
|
export declare function latexPlugin(md: MarkdownIt, options?: LatexPluginOptions): void;
|
|
26
|
+
/**
|
|
27
|
+
* Export as default for convenience
|
|
28
|
+
*/
|
|
6
29
|
export default latexPlugin;
|
|
@@ -1,6 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mermaid markdown-it plugin for Quartz-style diagram rendering
|
|
3
|
+
* Reference: quartz-src/quartz/components/scripts/mermaid.inline.ts
|
|
4
|
+
*
|
|
5
|
+
* This plugin identifies ```mermaid code blocks and adds the 'mermaid' class
|
|
6
|
+
* for client-side rendering.
|
|
7
|
+
*
|
|
8
|
+
* Unlike other markdown-it plugins, mermaid doesn't need custom parsing rules
|
|
9
|
+
* because markdown-it already parses fenced code blocks. We just need to
|
|
10
|
+
* modify the renderer to add the appropriate class.
|
|
11
|
+
*/
|
|
1
12
|
import MarkdownIt from 'markdown-it';
|
|
2
13
|
export interface MermaidPluginOptions {
|
|
3
14
|
enable?: boolean;
|
|
4
15
|
}
|
|
16
|
+
/**
|
|
17
|
+
* markdown-it plugin interface
|
|
18
|
+
*
|
|
19
|
+
* Usage:
|
|
20
|
+
* const md = new MarkdownIt();
|
|
21
|
+
* md.use(mermaidPlugin, { enable: true });
|
|
22
|
+
*
|
|
23
|
+
* @param md - MarkdownIt instance
|
|
24
|
+
* @param options - Plugin options
|
|
25
|
+
*/
|
|
5
26
|
export declare function mermaidPlugin(md: MarkdownIt, options?: MermaidPluginOptions): void;
|
|
27
|
+
/**
|
|
28
|
+
* Export as default for convenience
|
|
29
|
+
*/
|
|
6
30
|
export default mermaidPlugin;
|
|
@@ -1,24 +1,95 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Standard markdown-it plugin for Obsidian-style inline tags
|
|
3
|
+
*
|
|
4
|
+
* Ported from Quartz v4: quartz/plugins/transformers/ofm.ts
|
|
5
|
+
*
|
|
6
|
+
* This plugin follows markdown-it best practices:
|
|
7
|
+
* 1. Inline parsing rule to recognize #tag syntax
|
|
8
|
+
* 2. Token-based representation (not HTML string manipulation)
|
|
9
|
+
* 3. Separate renderer rules for output
|
|
10
|
+
*
|
|
11
|
+
* Supports:
|
|
12
|
+
* - Simple tags: #idea, #note
|
|
13
|
+
* - Hierarchical tags: #plugin/emitter, #work/project/frontend
|
|
14
|
+
* - Unicode tags: #笔记, #项目/前端
|
|
15
|
+
* - Emoji tags: #🎉celebration
|
|
16
|
+
*
|
|
17
|
+
* IMPORTANT: This plugin also INJECTS tags into frontmatter.tags array
|
|
18
|
+
* This ensures tags are available in Foundry's taxonomy system
|
|
19
|
+
*/
|
|
1
20
|
import MarkdownIt from 'markdown-it';
|
|
21
|
+
/**
|
|
22
|
+
* Internal state to track tags during parsing
|
|
23
|
+
*/
|
|
2
24
|
interface TagPluginState {
|
|
3
25
|
tagBaseURL?: string;
|
|
4
26
|
onTagFound?: (tag: string) => void;
|
|
5
27
|
}
|
|
28
|
+
/**
|
|
29
|
+
* Extend MarkdownIt type to include our custom state
|
|
30
|
+
*/
|
|
6
31
|
declare module 'markdown-it' {
|
|
7
32
|
interface MarkdownIt {
|
|
8
33
|
__tagPluginState?: TagPluginState;
|
|
9
34
|
}
|
|
10
35
|
}
|
|
36
|
+
/**
|
|
37
|
+
* Tag metadata structure
|
|
38
|
+
*/
|
|
11
39
|
export interface TagMeta {
|
|
12
40
|
rawTag: string;
|
|
13
41
|
slugTag: string;
|
|
14
42
|
url: string;
|
|
15
43
|
}
|
|
44
|
+
/**
|
|
45
|
+
* Tag regex from Quartz
|
|
46
|
+
* Source: quartz-src/quartz/plugins/transformers/ofm.ts lines 140-142
|
|
47
|
+
*
|
|
48
|
+
* (?<=^| ) -> lookbehind: tag must start at line beginning or after space
|
|
49
|
+
* #(...) -> capturing group: tag must start with #
|
|
50
|
+
* (?:[-_\p{L}\p{Emoji}\p{M}\d])+ -> non-capturing group: alphanumeric + symbols (Unicode-aware)
|
|
51
|
+
* (?:\/[-_\p{L}\p{Emoji}\p{M}\d]+)* -> optional: hierarchical tags separated by /
|
|
52
|
+
*/
|
|
16
53
|
export declare const tagRegex: RegExp;
|
|
54
|
+
/**
|
|
55
|
+
* Options for tag plugin
|
|
56
|
+
*/
|
|
17
57
|
export interface TagPluginOptions {
|
|
58
|
+
/** Enable/disable tag parsing */
|
|
18
59
|
enable?: boolean;
|
|
60
|
+
/** Base URL for tag links (default: "tags/") - relative path without leading slash */
|
|
19
61
|
tagBaseURL?: string;
|
|
62
|
+
/** Callback to collect tags for frontmatter injection */
|
|
20
63
|
onTagFound?: (tag: string) => void;
|
|
21
64
|
}
|
|
65
|
+
/**
|
|
66
|
+
* Slugify tag name (from Quartz util/path.ts)
|
|
67
|
+
*
|
|
68
|
+
* Normalizes tag to lowercase URL-safe format
|
|
69
|
+
* Handles hierarchical tags: "Plugin/Emitter" → "plugin/emitter"
|
|
70
|
+
*
|
|
71
|
+
* @param tag - Raw tag text
|
|
72
|
+
* @returns Normalized slug
|
|
73
|
+
*/
|
|
22
74
|
export declare function slugTag(tag: string): string;
|
|
75
|
+
/**
|
|
76
|
+
* markdown-it plugin interface
|
|
77
|
+
*
|
|
78
|
+
* Usage:
|
|
79
|
+
* const md = new MarkdownIt();
|
|
80
|
+
* const collectedTags = new Set<string>();
|
|
81
|
+
* md.use(tagPlugin, {
|
|
82
|
+
* enable: true,
|
|
83
|
+
* onTagFound: (tag) => collectedTags.add(tag)
|
|
84
|
+
* });
|
|
85
|
+
* const html = md.render(markdown);
|
|
86
|
+
* // collectedTags now contains all inline tags found
|
|
87
|
+
*
|
|
88
|
+
* @param md - MarkdownIt instance
|
|
89
|
+
* @param options - Plugin options
|
|
90
|
+
*/
|
|
23
91
|
export declare function tagPlugin(md: MarkdownIt, options?: TagPluginOptions): void;
|
|
92
|
+
/**
|
|
93
|
+
* Export as default for convenience
|
|
94
|
+
*/
|
|
24
95
|
export default tagPlugin;
|
|
@@ -1,4 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Standard markdown-it plugin for Obsidian-style wikilinks
|
|
3
|
+
*
|
|
4
|
+
* This plugin follows markdown-it best practices:
|
|
5
|
+
* 1. Inline parsing rule to recognize [[...]] syntax
|
|
6
|
+
* 2. Token-based representation (not HTML string manipulation)
|
|
7
|
+
* 3. Separate renderer rules for output
|
|
8
|
+
*
|
|
9
|
+
* Supports:
|
|
10
|
+
* - Regular wikilinks: [[Page]], [[Page#anchor]], [[Page|alias]]
|
|
11
|
+
* - Embeds: ![[image.png]], ![[video.mp4]], ![[Page]]
|
|
12
|
+
*/
|
|
1
13
|
import MarkdownIt from 'markdown-it';
|
|
14
|
+
/**
|
|
15
|
+
* Wikilink metadata structure
|
|
16
|
+
*/
|
|
2
17
|
export interface WikilinkMeta {
|
|
3
18
|
isEmbed: boolean;
|
|
4
19
|
filepath: string;
|
|
@@ -6,7 +21,20 @@ export interface WikilinkMeta {
|
|
|
6
21
|
alias?: string | undefined;
|
|
7
22
|
url: string;
|
|
8
23
|
}
|
|
24
|
+
/**
|
|
25
|
+
* markdown-it plugin interface
|
|
26
|
+
*
|
|
27
|
+
* Usage:
|
|
28
|
+
* const md = new MarkdownIt();
|
|
29
|
+
* md.use(wikilinkPlugin);
|
|
30
|
+
*
|
|
31
|
+
* @param md - MarkdownIt instance
|
|
32
|
+
* @param options - Plugin options
|
|
33
|
+
*/
|
|
9
34
|
export declare function wikilinkPlugin(md: MarkdownIt, options?: {
|
|
10
35
|
enable?: boolean;
|
|
11
36
|
}): void;
|
|
37
|
+
/**
|
|
38
|
+
* Export as default for convenience
|
|
39
|
+
*/
|
|
12
40
|
export default wikilinkPlugin;
|
|
@@ -1,8 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wikilink processing utilities ported from Quartz
|
|
3
|
+
* Source: quartz-src/quartz/plugins/transformers/ofm.ts
|
|
4
|
+
*
|
|
5
|
+
* This module handles Obsidian-style wikilink syntax [[Page]] in markdown.
|
|
6
|
+
* Since MDFriday uses markdown-it (not remark), we do text-level preprocessing.
|
|
7
|
+
*/
|
|
1
8
|
export declare const externalLinkRegex: RegExp;
|
|
2
9
|
export declare const wikilinkRegex: RegExp;
|
|
3
10
|
export declare const tableRegex: RegExp;
|
|
4
11
|
export declare const tableWikilinkRegex: RegExp;
|
|
12
|
+
/**
|
|
13
|
+
* Pre-transform wikilinks at text level (before markdown parsing)
|
|
14
|
+
* Based on Quartz ofm.ts textTransform method (lines 161-209)
|
|
15
|
+
*
|
|
16
|
+
* This function:
|
|
17
|
+
* 1. Escapes wikilinks inside tables (pipe characters need escaping)
|
|
18
|
+
* 2. Normalizes wikilink format
|
|
19
|
+
* 3. Converts external links in wikilinks to regular markdown links
|
|
20
|
+
*/
|
|
5
21
|
export declare function preprocessWikilinks(src: string): string;
|
|
22
|
+
/**
|
|
23
|
+
* Parse wikilink syntax into components
|
|
24
|
+
* Used by markdown-it renderer to convert [[Page]] to semantic HTML
|
|
25
|
+
*/
|
|
6
26
|
export interface WikilinkComponents {
|
|
7
27
|
isEmbed: boolean;
|
|
8
28
|
filepath: string;
|
|
@@ -11,6 +31,17 @@ export interface WikilinkComponents {
|
|
|
11
31
|
url: string;
|
|
12
32
|
}
|
|
13
33
|
export declare function parseWikilink(match: string): WikilinkComponents | null;
|
|
34
|
+
/**
|
|
35
|
+
* Get embed type from file extension
|
|
36
|
+
*/
|
|
14
37
|
export declare function getEmbedType(filepath: string): 'image' | 'video' | 'audio' | 'pdf' | 'transclude';
|
|
38
|
+
/**
|
|
39
|
+
* Generate HTML for embedded content
|
|
40
|
+
* Based on Quartz ofm.ts lines 229-278
|
|
41
|
+
*/
|
|
15
42
|
export declare function generateEmbedHtml(components: WikilinkComponents): string;
|
|
43
|
+
/**
|
|
44
|
+
* Check if a wikilink target exists in the site
|
|
45
|
+
* Used for broken link detection
|
|
46
|
+
*/
|
|
16
47
|
export declare function checkWikilinkExists(filepath: string, allSlugs: string[]): boolean;
|
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
import { TocFragments, Header, Link, Paragraph } from '../../index';
|
|
2
|
+
/**
|
|
3
|
+
* Fragment represents a single TOC entry
|
|
4
|
+
*/
|
|
2
5
|
export interface Fragment {
|
|
3
6
|
id: string;
|
|
4
7
|
text: string;
|
|
5
8
|
level: number;
|
|
6
9
|
children?: Fragment[];
|
|
7
10
|
}
|
|
11
|
+
/**
|
|
12
|
+
* TableOfContentsImpl implements TocFragments
|
|
13
|
+
*/
|
|
8
14
|
export declare class TableOfContentsImpl implements TocFragments {
|
|
9
15
|
private fragments;
|
|
10
16
|
constructor(fragments?: Fragment[]);
|
|
@@ -15,6 +21,9 @@ export declare class TableOfContentsImpl implements TocFragments {
|
|
|
15
21
|
addFragment(fragment: Fragment): void;
|
|
16
22
|
getFragments(): Fragment[];
|
|
17
23
|
}
|
|
24
|
+
/**
|
|
25
|
+
* HeaderImpl implements Header interface
|
|
26
|
+
*/
|
|
18
27
|
export declare class HeaderImpl implements Header {
|
|
19
28
|
private _name;
|
|
20
29
|
private _level;
|
|
@@ -31,6 +40,9 @@ export declare class HeaderImpl implements Header {
|
|
|
31
40
|
addParagraph(paragraph: Paragraph): void;
|
|
32
41
|
addListParagraph(paragraph: Paragraph): void;
|
|
33
42
|
}
|
|
43
|
+
/**
|
|
44
|
+
* LinkImpl implements Link interface
|
|
45
|
+
*/
|
|
34
46
|
export declare class LinkImpl implements Link {
|
|
35
47
|
private _text;
|
|
36
48
|
private _url;
|
|
@@ -38,11 +50,17 @@ export declare class LinkImpl implements Link {
|
|
|
38
50
|
text(): string;
|
|
39
51
|
url(): string;
|
|
40
52
|
}
|
|
53
|
+
/**
|
|
54
|
+
* ParagraphImpl implements Paragraph interface
|
|
55
|
+
*/
|
|
41
56
|
export declare class ParagraphImpl implements Paragraph {
|
|
42
57
|
private _text;
|
|
43
58
|
constructor(_text: string);
|
|
44
59
|
text(): string;
|
|
45
60
|
}
|
|
61
|
+
/**
|
|
62
|
+
* TOC Builder utility class
|
|
63
|
+
*/
|
|
46
64
|
export declare class TOCBuilder {
|
|
47
65
|
private fragments;
|
|
48
66
|
private stack;
|
|
@@ -50,6 +68,9 @@ export declare class TOCBuilder {
|
|
|
50
68
|
build(): TableOfContentsImpl;
|
|
51
69
|
reset(): void;
|
|
52
70
|
}
|
|
71
|
+
/**
|
|
72
|
+
* Auto ID generation utilities
|
|
73
|
+
*/
|
|
53
74
|
export declare class AutoIDGenerator {
|
|
54
75
|
private usedIds;
|
|
55
76
|
generateID(text: string, type?: 'github' | 'github-ascii' | 'blackfriday'): string;
|
|
@@ -1,12 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Path utilities ported from Quartz
|
|
3
|
+
* Source: quartz-src/quartz/util/path.ts
|
|
4
|
+
*
|
|
5
|
+
* This file contains path manipulation utilities for wikilink processing.
|
|
6
|
+
* These utilities are designed to work with Quartz-style slugs and paths.
|
|
7
|
+
*/
|
|
1
8
|
type SlugLike<T> = string & {
|
|
2
9
|
__brand: T;
|
|
3
10
|
};
|
|
11
|
+
/** Cannot be relative and must have a file extension. */
|
|
4
12
|
export type FilePath = SlugLike<"filepath">;
|
|
5
13
|
export declare function isFilePath(s: string): s is FilePath;
|
|
14
|
+
/** Cannot be relative and may not have leading or trailing slashes. It can have `index` as it's last segment. Use this wherever possible is it's the most 'general' interpretation of a slug. */
|
|
6
15
|
export type FullSlug = SlugLike<"full">;
|
|
7
16
|
export declare function isFullSlug(s: string): s is FullSlug;
|
|
17
|
+
/** Shouldn't be a relative path and shouldn't have `/index` as an ending or a file extension. It _can_ however have a trailing slash to indicate a folder path. */
|
|
8
18
|
export type SimpleSlug = SlugLike<"simple">;
|
|
9
19
|
export declare function isSimpleSlug(s: string): s is SimpleSlug;
|
|
20
|
+
/** Can be found on `href`s but can also be constructed for client-side navigation (e.g. search and graph) */
|
|
10
21
|
export type RelativeURL = SlugLike<"relative">;
|
|
11
22
|
export declare function isRelativeURL(s: string): s is RelativeURL;
|
|
12
23
|
export declare function isAbsoluteURL(s: string): boolean;
|