@mnaoumov/create-obsidian-plugin 1.0.1 → 1.1.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/README.md +38 -7
- package/dist/main.js +1068 -333
- package/package.json +15 -6
- package/src/main.ts +118 -11
- package/templates/default/.github/ISSUE_TEMPLATE/config.yml.ejs +4 -0
- package/templates/default/.github/workflows/attest-release-assets.yml.ejs +1 -11
- package/templates/default/.github/workflows/ci.yml_framework.ejs +19 -0
- package/templates/default/.github/workflows/ci.yml_framework@job-permissions_measured-coverage-badge.ejs +3 -0
- package/templates/default/.github/workflows/ci.yml_framework@with_measured-coverage-badge.ejs +1 -0
- package/templates/default/.github/workflows/{ci.yml.ejs → ci.yml_standalone.ejs} +1 -1
- package/templates/default/.github/workflows/release.yml_framework.ejs +19 -0
- package/templates/default/.github/workflows/{release.yml.ejs → release.yml_standalone.ejs} +1 -1
- package/templates/default/.gitignore_common.ejs +1 -0
- package/templates/default/.gitignore_wdio-obsidian.ejs +2 -0
- package/templates/default/.nvmrc.ejs +1 -0
- package/templates/default/.prettierignore.ejs +1 -0
- package/templates/default/.prettierignore@ignores_docs-showcase.ejs +3 -0
- package/templates/default/{CONTRIBUTING.md@demo-vault_dev-utils.ejs → CONTRIBUTING.md@demo-vault_framework.ejs} +1 -1
- package/templates/default/{README.md@demo-vault_dev-utils.ejs → README.md@demo-vault_framework.ejs} +1 -1
- package/templates/default/README.md@preset_docs-showcase.ejs +4 -0
- package/templates/default/{README.md@preset_dev-utils.ejs → README.md@preset_framework.ejs} +1 -1
- package/templates/default/biome.jsonc_framework.ejs +16 -0
- package/templates/default/biome.jsonc_framework@excludes_docs-showcase.ejs +1 -0
- package/templates/default/{biome.jsonc.ejs → biome.jsonc_standalone.ejs} +1 -1
- package/templates/default/cspell.json.ejs +10 -2
- package/templates/default/cspell.json@ignore-paths_docs-showcase.ejs +1 -0
- package/templates/default/demo-vault/.gitignore.ejs +4 -4
- package/templates/default/demo-vault/00 Start.md.ejs +1 -1
- package/templates/default/demo-vault/01 Sample commands.md.ejs +4 -4
- package/templates/default/demo-vault/02 Settings.md.ejs +2 -2
- package/templates/default/demo-vault/03 WebAssembly.md.ejs +2 -2
- package/templates/default/demo-vault/README.md.ejs +1 -1
- package/templates/default/demo-vault/_assets/CodeScriptToolkit/demoSetup.ts.ejs +1 -1
- package/templates/default/demo-vault/_assets/CodeScriptToolkit/startup.ts.ejs +4 -4
- package/templates/default/dprint.json_framework.ejs +10 -0
- package/templates/default/dprint.json_framework@excludes_docs-showcase.ejs +2 -0
- package/templates/default/dprint.json_standalone.ejs +1 -0
- package/templates/default/eslint.config.mts_standalone.ejs +9 -0
- package/templates/default/jest.config.ts_framework.ejs +31 -0
- package/templates/default/{scripts/rollup.config.ts@lint-out-dir_dev-utils.ejs → jest.config.ts_framework@lint-root-dir_framework.ejs} +1 -1
- package/templates/default/jest.config.ts_framework@ts-jest-tsconfig_solid.ejs +8 -0
- package/templates/default/{jest.config.ts.ejs → jest.config.ts_standalone.ejs} +0 -1
- package/templates/default/package.json@targets_parcel-targets.ejs +31 -0
- package/templates/default/package.json@targets_parcel.ejs +2 -33
- package/templates/default/parcel-transformer-inline-imports.cjs.ejs +1 -1
- package/templates/default/prettier.config.mjs_framework.ejs +3 -0
- package/templates/default/scripts/build-clean.ts.ejs +2 -2
- package/templates/default/scripts/build-compile-typescript.ts.ejs +14 -0
- package/templates/default/scripts/build-compile.ts.ejs +2 -2
- package/templates/default/scripts/build-options.ts.ejs +9 -0
- package/templates/default/scripts/build-styles.ts.ejs +4 -7
- package/templates/default/scripts/build.ts.ejs +2 -2
- package/templates/default/scripts/build.ts@bundler_adapter-cli.ejs +11 -0
- package/templates/default/scripts/build.ts@bundler_adapter-cli@run_rollup.ejs +1 -0
- package/templates/default/scripts/build.ts@bundler_adapter-cli@run_vite.ejs +1 -0
- package/templates/default/scripts/build.ts@bundler_adapter-cli@run_webpack.ejs +1 -0
- package/templates/default/scripts/build.ts@bundler_cli-bundler.ejs +1 -1
- package/templates/default/scripts/build.ts@bundler_cli-bundler@import_tailwind.ejs +0 -1
- package/templates/default/scripts/build.ts@bundler_esbuild.ejs +2 -2
- package/templates/default/scripts/build.ts@bundler_esbuild@preset_framework.ejs +5 -0
- package/templates/default/scripts/build.ts@bundler_parcel-adapter.ejs +5 -0
- package/templates/default/scripts/commit.ts_framework.ejs +3 -0
- package/templates/default/scripts/commitlint-config.ts_framework.ejs +1 -0
- package/templates/default/scripts/demo-vault-global-setup.ts.ejs +7 -4
- package/templates/default/scripts/dev.ts.ejs +1 -1
- package/templates/default/scripts/dev.ts@bundler_adapter-cli.ejs +6 -0
- package/templates/default/scripts/dev.ts@bundler_adapter-cli@run_rollup.ejs +3 -0
- package/templates/default/scripts/dev.ts@bundler_adapter-cli@run_vite.ejs +3 -0
- package/templates/default/scripts/dev.ts@bundler_adapter-cli@run_webpack.ejs +3 -0
- package/templates/default/scripts/dev.ts@bundler_esbuild.ejs +2 -2
- package/templates/default/scripts/dev.ts@bundler_esbuild@preset_framework.ejs +5 -0
- package/templates/default/scripts/dev.ts@bundler_parcel-adapter.ejs +5 -0
- package/templates/default/scripts/eslint-config.ts.ejs +3 -14
- package/templates/default/scripts/eslint-config.ts@ignores_docs-showcase.ejs +4 -0
- package/templates/default/scripts/find-overexposed-fix.ts.ejs +4 -4
- package/templates/default/scripts/find-overexposed.ts.ejs +3 -3
- package/templates/default/scripts/format-check.ts@tool_biome-formatter.ejs +3 -8
- package/templates/default/scripts/format-check.ts@tool_biome-formatter@preset_framework.ejs +7 -0
- package/templates/default/scripts/format-check.ts@tool_biome-formatter@preset_standalone.ejs +8 -0
- package/templates/default/scripts/format-check.ts@tool_dprint.ejs +2 -2
- package/templates/default/scripts/format-check.ts@tool_dprint@preset_framework.ejs +7 -0
- package/templates/default/scripts/format-check.ts@tool_prettier.ejs +3 -8
- package/templates/default/scripts/format-check.ts@tool_prettier@preset_framework.ejs +7 -0
- package/templates/default/scripts/format-check.ts@tool_prettier@preset_standalone.ejs +8 -0
- package/templates/default/scripts/format.ts@tool_biome-formatter.ejs +3 -8
- package/templates/default/scripts/format.ts@tool_biome-formatter@preset_framework.ejs +7 -0
- package/templates/default/scripts/format.ts@tool_biome-formatter@preset_standalone.ejs +8 -0
- package/templates/default/scripts/format.ts@tool_dprint.ejs +2 -2
- package/templates/default/scripts/format.ts@tool_dprint@preset_framework.ejs +7 -0
- package/templates/default/scripts/format.ts@tool_prettier.ejs +3 -8
- package/templates/default/scripts/format.ts@tool_prettier@preset_framework.ejs +7 -0
- package/templates/default/scripts/format.ts@tool_prettier@preset_standalone.ejs +8 -0
- package/templates/default/scripts/gate.ts.ejs +3 -3
- package/templates/default/scripts/lint-fix.ts.ejs +2 -2
- package/templates/default/scripts/lint-fix.ts@tool_biome-linter.ejs +3 -8
- package/templates/default/scripts/lint-fix.ts@tool_biome-linter@preset_framework.ejs +7 -0
- package/templates/default/scripts/lint-fix.ts@tool_biome-linter@preset_standalone.ejs +8 -0
- package/templates/default/scripts/lint-fix.ts@tool_eslint.ejs +2 -2
- package/templates/default/scripts/lint-fix.ts@tool_eslint@preset_framework.ejs +7 -0
- package/templates/default/scripts/lint-md-fix.ts_framework.ejs +7 -0
- package/templates/default/scripts/lint-md.ts_framework.ejs +7 -0
- package/templates/default/scripts/lint.ts.ejs +2 -2
- package/templates/default/scripts/lint.ts@tool_biome-linter.ejs +3 -8
- package/templates/default/scripts/lint.ts@tool_biome-linter@preset_framework.ejs +7 -0
- package/templates/default/scripts/lint.ts@tool_biome-linter@preset_standalone.ejs +8 -0
- package/templates/default/scripts/lint.ts@tool_eslint.ejs +2 -2
- package/templates/default/scripts/lint.ts@tool_eslint@preset_framework.ejs +7 -0
- package/templates/default/scripts/{markdownlint-cli2-config.ts_dev-utils.ejs → markdownlint-cli2-config.ts_framework.ejs} +4 -4
- package/templates/default/scripts/markdownlint-cli2-config.ts_standalone.ejs +0 -3
- package/templates/default/scripts/nano-staged-config.ts_toolkit-nano-staged.ejs +3 -0
- package/templates/default/scripts/prepare.ts_framework.ejs +3 -0
- package/templates/default/scripts/rollup.config.ts_framework.ejs +49 -0
- package/templates/default/scripts/rollup.config.ts_framework@plugin_rollup-json.ejs +2 -0
- package/templates/default/scripts/rollup.config.ts_framework@plugin_scss.ejs +3 -0
- package/templates/default/scripts/{rollup.config.ts.ejs → rollup.config.ts_standalone.ejs} +4 -4
- package/templates/default/scripts/rollup.config.ts_standalone@import_rollup-json.ejs +1 -0
- package/templates/default/scripts/rollup.config.ts_standalone@import_scss.ejs +1 -0
- package/templates/default/scripts/rollup.config.ts_standalone@unwrap_rollup-json.ejs +1 -0
- package/templates/default/scripts/rollup.config.ts_standalone@unwrap_scss.ejs +1 -0
- package/templates/default/scripts/spellcheck.ts_framework.ejs +7 -0
- package/templates/default/scripts/stylesheet-stub.ts.ejs +1 -1
- package/templates/default/scripts/test-coverage.ts.ejs +2 -8
- package/templates/default/scripts/test-coverage.ts@tool_jest.ejs +5 -0
- package/templates/default/scripts/test-coverage.ts@tool_vitest.ejs +8 -0
- package/templates/default/scripts/test-e2e.ts@tool_obsidian-test.ejs +2 -8
- package/templates/default/scripts/test-e2e.ts@tool_obsidian-test@preset_framework.ejs +4 -0
- package/templates/default/scripts/test-e2e.ts@tool_obsidian-test@preset_standalone.ejs +8 -0
- package/templates/default/scripts/test-e2e.ts@tool_wdio-obsidian.ejs +2 -8
- package/templates/default/scripts/test-e2e.ts@tool_wdio-obsidian@preset_framework.ejs +5 -0
- package/templates/default/scripts/test-e2e.ts@tool_wdio-obsidian@preset_standalone.ejs +8 -0
- package/templates/default/scripts/test-integration-android.ts.ejs +2 -2
- package/templates/default/scripts/test-integration-demo-vault.ts.ejs +2 -2
- package/templates/default/scripts/test-integration-desktop-performance.ts.ejs +2 -2
- package/templates/default/scripts/test-integration-desktop.ts.ejs +2 -2
- package/templates/default/scripts/test-integration-no-app.ts.ejs +2 -2
- package/templates/default/scripts/test-integration.ts.ejs +2 -2
- package/templates/default/scripts/test-watch.ts_framework@tool_jest.ejs +5 -0
- package/templates/default/scripts/test-watch.ts_framework@tool_vitest.ejs +8 -0
- package/templates/default/scripts/test.ts_framework@tool_jest.ejs +5 -0
- package/templates/default/scripts/test.ts_framework@tool_vitest.ejs +8 -0
- package/templates/default/scripts/{version.ts_dev-utils.ejs → version.ts_framework.ejs} +3 -3
- package/templates/default/scripts/vite.config.ts_framework.ejs +10 -0
- package/templates/default/scripts/{vite.config.ts.ejs → vite.config.ts_standalone.ejs} +5 -8
- package/templates/default/scripts/vitest-config.ts.ejs +3 -2
- package/templates/default/scripts/vitest-config.ts@edit-context_docs-showcase.ejs +3 -0
- package/templates/default/scripts/webpack.config.ts_framework.ejs +19 -0
- package/templates/default/scripts/webpack.config.ts_framework@import_scss.ejs +1 -0
- package/templates/default/scripts/webpack.config.ts_framework@plugin_scss.ejs +1 -0
- package/templates/default/scripts/webpack.config.ts_framework@rule_scss.ejs +4 -0
- package/templates/default/scripts/{webpack.config.ts.ejs → webpack.config.ts_standalone.ejs} +4 -4
- package/templates/default/src/demo-vault-buttons.demo-vault.integration.test.ts.ejs +2 -2
- package/templates/default/src/demo-vault.no-app.integration.test.ts.ejs +3 -3
- package/templates/default/src/docs-showcase.desktop.integration.test.ts.ejs +77 -0
- package/templates/default/src/editor-extensions/{sample-state-field.ts_dev-utils.ejs → sample-state-field.ts_framework.ejs} +1 -1
- package/templates/default/src/main.ts@import_tailwind.ejs +1 -1
- package/templates/default/src/main.ts@import_tailwind@preset_framework.ejs +1 -0
- package/templates/default/src/main.ts@import_tailwind@preset_standalone.ejs +1 -0
- package/templates/default/src/{plugin-settings-component.test.ts_enhanced.ejs → plugin-settings-component.test.ts_all-in-one.ejs} +4 -4
- package/templates/default/src/plugin-settings-component.test.ts_demo.ejs +5 -5
- package/templates/default/src/{plugin-settings-component.ts_enhanced.ejs → plugin-settings-component.ts_all-in-one.ejs} +3 -3
- package/templates/default/src/plugin-settings-component.ts_demo.ejs +7 -7
- package/templates/default/src/{plugin-settings-tab.ts_enhanced.ejs → plugin-settings-tab.ts_all-in-one.ejs} +1 -1
- package/templates/default/src/plugin-settings-tab.ts_demo.ejs +3 -3
- package/templates/default/src/plugin-settings.ts_demo.ejs +2 -2
- package/templates/default/src/{plugin.ts_enhanced.ejs → plugin.ts_all-in-one.ejs} +5 -5
- package/templates/default/src/plugin.ts_all-in-one@import2_css-modules.ejs +1 -0
- package/templates/default/src/plugin.ts_all-in-one@import2_docs-showcase.ejs +1 -0
- package/templates/default/src/plugin.ts_all-in-one@onload_css-modules.ejs +1 -0
- package/templates/default/src/plugin.ts_all-in-one@onload_docs-showcase.ejs +3 -0
- package/templates/default/src/plugin.ts_demo.ejs +16 -16
- package/templates/default/src/plugin.ts_demo@import_css-modules.ejs +1 -0
- package/templates/default/src/plugin.ts_demo@onload_css-modules.ejs +1 -0
- package/templates/default/src/plugin.ts_standalone.ejs +5 -3
- package/templates/default/src/plugin.ts_standalone@import_css-modules.ejs +1 -0
- package/templates/default/src/plugin.ts_standalone@onload_css-modules.ejs +1 -0
- package/templates/default/src/react-components/{sample-react-component.tsx_dev-utils.ejs → sample-react-component.tsx_framework.ejs} +1 -1
- package/templates/default/src/styles/css-modules.d.ts.ejs +9 -3
- package/templates/default/src/styles/{main.css_dev-utils.ejs → main.css_framework.ejs} +2 -2
- package/templates/default/src/styles/main.module.css.ejs +4 -2
- package/templates/default/src/styles/{main.scss_dev-utils.ejs → main.scss_framework.ejs} +2 -2
- package/templates/default/src/styles/sample-css-module-command.ts.ejs +30 -0
- package/templates/default/src/views/{sample-react-view.tsx_dev-utils.ejs → sample-react-view.tsx_framework.ejs} +1 -1
- package/templates/default/src/wasm/README.md.ejs +1 -1
- package/templates/default/src/wasm/answer.ts_wasm-adapter.ejs +18 -0
- package/templates/default/{tsconfig.json_dev-utils.ejs → tsconfig.json_framework.ejs} +2 -2
- package/templates/default/tsconfig.json_framework@exclude_docs-showcase.ejs +4 -0
- package/templates/default/tsconfig.json_framework@include_wdio-obsidian.ejs +1 -0
- package/templates/default/tsconfig.json_framework@types_toolkit-styles.ejs +2 -0
- package/templates/default/tsconfig.json_framework@types_wasm.ejs +2 -0
- package/templates/default/tsconfig.json_standalone.ejs +1 -1
- package/templates/default/vitest.config.ts_standalone.ejs +11 -2
- package/templates/default/wdio.conf.mts.ejs +5 -0
- package/templates/default/wdio.conf.ts.ejs +4 -4
- package/templates/docs-showcase/files/src/docs/README.md +511 -0
- package/templates/docs-showcase/files/src/docs/entry.d.ts +8 -0
- package/templates/docs-showcase/files/src/docs/entry.js +4 -0
- package/templates/docs-showcase/files/src/docs/host.ts +449 -0
- package/templates/docs-showcase/files/src/docs/index.ts +699 -0
- package/templates/docs-showcase/files/src/docs/plugins/editor/communicating-with-editor-extensions/01-intro.ts +21 -0
- package/templates/docs-showcase/files/src/docs/plugins/editor/communicating-with-editor-extensions/03-state-field.ts +32 -0
- package/templates/docs-showcase/files/src/docs/plugins/editor/decorations/01-widgets.ts +23 -0
- package/templates/docs-showcase/files/src/docs/plugins/editor/decorations/02-widgets.ts +20 -0
- package/templates/docs-showcase/files/src/docs/plugins/editor/decorations/04-state-fields.ts +57 -0
- package/templates/docs-showcase/files/src/docs/plugins/editor/decorations/05-view-plugins.ts +79 -0
- package/templates/docs-showcase/files/src/docs/plugins/editor/editor/01-intro.ts +26 -0
- package/templates/docs-showcase/files/src/docs/plugins/editor/editor/03-replace-current-selection.ts +26 -0
- package/templates/docs-showcase/files/src/docs/plugins/editor/markdown-post-processing/01-intro.ts +39 -0
- package/templates/docs-showcase/files/src/docs/plugins/editor/state-fields/01-defining-state-effects.ts +19 -0
- package/templates/docs-showcase/files/src/docs/plugins/editor/state-fields/02-defining-a-state-field.ts +35 -0
- package/templates/docs-showcase/files/src/docs/plugins/editor/state-fields/04-dispatching-state-effects.ts +34 -0
- package/templates/docs-showcase/files/src/docs/plugins/editor/state-management/01-state-changes.ts +21 -0
- package/templates/docs-showcase/files/src/docs/plugins/editor/state-management/02-state-changes.ts +23 -0
- package/templates/docs-showcase/files/src/docs/plugins/editor/view-plugins/01-creating-a-view-plugin.ts +36 -0
- package/templates/docs-showcase/files/src/docs/plugins/events/01-intro.ts +21 -0
- package/templates/docs-showcase/files/src/docs/plugins/getting-started/anatomy-of-a-plugin/01-intro.ts +22 -0
- package/templates/docs-showcase/files/src/docs/plugins/getting-started/anatomy-of-a-plugin/02-plugin-lifecycle.ts +22 -0
- package/templates/docs-showcase/files/src/docs/plugins/getting-started/build-a-plugin/06-step-5-update-the-source-code.ts +19 -0
- package/templates/docs-showcase/files/src/docs/plugins/getting-started/build-a-plugin/07-step-5-update-the-source-code.ts +21 -0
- package/templates/docs-showcase/files/src/docs/plugins/getting-started/mobile-development/03-platform-specific-features.ts +25 -0
- package/templates/docs-showcase/files/src/docs/plugins/getting-started/use-react-in-your-plugin/03-configure-your-plugin.ts +23 -0
- package/templates/docs-showcase/files/src/docs/plugins/guides/build-a-bases-view/01-step-1-sample-plugin-setup.ts +18 -0
- package/templates/docs-showcase/files/src/docs/plugins/guides/build-a-bases-view/02-step-2-create-and-register-the-bases-vie.ts +46 -0
- package/templates/docs-showcase/files/src/docs/plugins/guides/build-a-bases-view/03-step-3-add-configuration.ts +40 -0
- package/templates/docs-showcase/files/src/docs/plugins/guides/defer-views/04-accessing-your-customview-without-reveal.ts +26 -0
- package/templates/docs-showcase/files/src/docs/plugins/guides/manage-plugin-lifecycle/01-overview.ts +26 -0
- package/templates/docs-showcase/files/src/docs/plugins/guides/manage-plugin-lifecycle/02-overview.ts +30 -0
- package/templates/docs-showcase/files/src/docs/plugins/guides/manage-plugin-lifecycle/03-automatic-resource-management-with-compo.ts +26 -0
- package/templates/docs-showcase/files/src/docs/plugins/guides/manage-plugin-lifecycle/04-registerevent-eventref.ts +22 -0
- package/templates/docs-showcase/files/src/docs/plugins/guides/manage-plugin-lifecycle/05-registerinterval-id.ts +21 -0
- package/templates/docs-showcase/files/src/docs/plugins/guides/manage-plugin-lifecycle/06-registerdomevent-el-event-handler.ts +20 -0
- package/templates/docs-showcase/files/src/docs/plugins/guides/manage-plugin-lifecycle/08-understanding-the-lifecycle-of-objects.ts +29 -0
- package/templates/docs-showcase/files/src/docs/plugins/guides/manage-plugin-lifecycle/14-componentized-modal-example.ts +37 -0
- package/templates/docs-showcase/files/src/docs/plugins/guides/optimize-plugin-load-time/01-option-a-check-if-the-layout-is-ready.ts +29 -0
- package/templates/docs-showcase/files/src/docs/plugins/guides/optimize-plugin-load-time/02-option-b-register-the-handler-once-the-l.ts +27 -0
- package/templates/docs-showcase/files/src/docs/plugins/guides/store-secrets/03-step-3-retrieve-the-secret-value.ts +22 -0
- package/templates/docs-showcase/files/src/docs/plugins/releasing/plugin-guidelines/01-use-setheading-instead-of-a-h1-h2.ts +20 -0
- package/templates/docs-showcase/files/src/docs/plugins/releasing/plugin-guidelines/03-clean-up-resources-when-plugin-unloads.ts +23 -0
- package/templates/docs-showcase/files/src/docs/plugins/releasing/plugin-guidelines/04-avoid-accessing-workspace-activeleaf-dir.ts +24 -0
- package/templates/docs-showcase/files/src/docs/plugins/releasing/plugin-guidelines/05-avoid-accessing-workspace-activeleaf-dir.ts +22 -0
- package/templates/docs-showcase/files/src/docs/plugins/releasing/plugin-guidelines/10-avoid-iterating-all-files-to-find-a-file.ts +20 -0
- package/templates/docs-showcase/files/src/docs/plugins/releasing/plugin-guidelines/11-avoid-iterating-all-files-to-find-a-file.ts +20 -0
- package/templates/docs-showcase/files/src/docs/plugins/releasing/plugin-guidelines/13-use-normalizepath-to-clean-up-user-defin.ts +18 -0
- package/templates/docs-showcase/files/src/docs/plugins/releasing/plugin-guidelines/15-no-hardcoded-styling.ts +21 -0
- package/templates/docs-showcase/files/src/docs/plugins/releasing/plugin-guidelines/16-no-hardcoded-styling.ts +19 -0
- package/templates/docs-showcase/files/src/docs/plugins/releasing/plugin-guidelines/17-no-hardcoded-styling.ts +14 -0
- package/templates/docs-showcase/files/src/docs/plugins/releasing/plugin-guidelines/18-prefer-async-await-over-promise.ts +24 -0
- package/templates/docs-showcase/files/src/docs/plugins/releasing/plugin-guidelines/19-prefer-async-await-over-promise.ts +27 -0
- package/templates/docs-showcase/files/src/docs/plugins/user-interface/commands/01-intro.ts +25 -0
- package/templates/docs-showcase/files/src/docs/plugins/user-interface/commands/03-editor-commands.ts +27 -0
- package/templates/docs-showcase/files/src/docs/plugins/user-interface/commands/05-hot-keys.ts +25 -0
- package/templates/docs-showcase/files/src/docs/plugins/user-interface/context-menus/01-intro.ts +41 -0
- package/templates/docs-showcase/files/src/docs/plugins/user-interface/html-elements/02-create-html-elements-using-createel.ts +19 -0
- package/templates/docs-showcase/files/src/docs/plugins/user-interface/html-elements/03-create-html-elements-using-createel.ts +21 -0
- package/templates/docs-showcase/files/src/docs/plugins/user-interface/html-elements/04-style-your-elements.ts +14 -0
- package/templates/docs-showcase/files/src/docs/plugins/user-interface/html-elements/05-style-your-elements.ts +21 -0
- package/templates/docs-showcase/files/src/docs/plugins/user-interface/html-elements/06-conditional-styles.ts +19 -0
- package/templates/docs-showcase/files/src/docs/plugins/user-interface/icons/01-use-icons.ts +20 -0
- package/templates/docs-showcase/files/src/docs/plugins/user-interface/icons/02-use-icons.ts +14 -0
- package/templates/docs-showcase/files/src/docs/plugins/user-interface/icons/03-add-your-own-icon.ts +23 -0
- package/templates/docs-showcase/files/src/docs/plugins/user-interface/modals/01-intro.ts +20 -0
- package/templates/docs-showcase/files/src/docs/plugins/user-interface/modals/02-intro.ts +26 -0
- package/templates/docs-showcase/files/src/docs/plugins/user-interface/modals/03-accept-user-input.ts +38 -0
- package/templates/docs-showcase/files/src/docs/plugins/user-interface/modals/04-accept-user-input.ts +22 -0
- package/templates/docs-showcase/files/src/docs/plugins/user-interface/modals/05-select-from-list-of-suggestions.ts +56 -0
- package/templates/docs-showcase/files/src/docs/plugins/user-interface/modals/06-approximate-string-matching-results.ts +28 -0
- package/templates/docs-showcase/files/src/docs/plugins/user-interface/modals/07-custom-rendering-of-fuzzy-search-results.ts +41 -0
- package/templates/docs-showcase/files/src/docs/plugins/user-interface/ribbon-actions/01-intro.ts +21 -0
- package/templates/docs-showcase/files/src/docs/plugins/user-interface/right-to-left/01-use-fallback-values-when-necessary.ts +14 -0
- package/templates/docs-showcase/files/src/docs/plugins/user-interface/right-to-left/02-global-selectors.ts +14 -0
- package/templates/docs-showcase/files/src/docs/plugins/user-interface/right-to-left/03-icons-are-mirrored-automatically.ts +14 -0
- package/templates/docs-showcase/files/src/docs/plugins/user-interface/settings/09-toggle.ts +20 -0
- package/templates/docs-showcase/files/src/docs/plugins/user-interface/settings/10-text.ts +23 -0
- package/templates/docs-showcase/files/src/docs/plugins/user-interface/settings/11-textarea.ts +23 -0
- package/templates/docs-showcase/files/src/docs/plugins/user-interface/settings/12-number.ts +23 -0
- package/templates/docs-showcase/files/src/docs/plugins/user-interface/settings/13-slider.ts +23 -0
- package/templates/docs-showcase/files/src/docs/plugins/user-interface/settings/14-dropdown.ts +28 -0
- package/templates/docs-showcase/files/src/docs/plugins/user-interface/settings/15-file.ts +27 -0
- package/templates/docs-showcase/files/src/docs/plugins/user-interface/settings/16-folder.ts +23 -0
- package/templates/docs-showcase/files/src/docs/plugins/user-interface/settings/17-color-picker.ts +20 -0
- package/templates/docs-showcase/files/src/docs/plugins/user-interface/settings/18-validating-input.ts +28 -0
- package/templates/docs-showcase/files/src/docs/plugins/user-interface/settings/23-groups.ts +27 -0
- package/templates/docs-showcase/files/src/docs/plugins/user-interface/settings/32-cleanup.ts +30 -0
- package/templates/docs-showcase/files/src/docs/plugins/user-interface/settings/33-no-top-level-heading.ts +27 -0
- package/templates/docs-showcase/files/src/docs/plugins/user-interface/settings/34-headings-only-when-there-are-multiple-se.ts +26 -0
- package/templates/docs-showcase/files/src/docs/plugins/user-interface/settings/36-headings.ts +20 -0
- package/templates/docs-showcase/files/src/docs/plugins/user-interface/settings/38-moment-format.ts +42 -0
- package/templates/docs-showcase/files/src/docs/plugins/user-interface/settings/39-buttons.ts +26 -0
- package/templates/docs-showcase/files/src/docs/plugins/user-interface/settings/40-extra-button.ts +28 -0
- package/templates/docs-showcase/files/src/docs/plugins/user-interface/settings/41-progress-bar.ts +23 -0
- package/templates/docs-showcase/files/src/docs/plugins/user-interface/status-bar/01-intro.ts +20 -0
- package/templates/docs-showcase/files/src/docs/plugins/user-interface/status-bar/02-intro.ts +25 -0
- package/templates/docs-showcase/files/src/docs/plugins/user-interface/views/01-intro.ts +39 -0
- package/templates/docs-showcase/files/src/docs/plugins/user-interface/workspace/05-inspect-the-workspace.ts +23 -0
- package/templates/docs-showcase/files/src/docs/plugins/user-interface/workspace/06-leaf-groups.ts +19 -0
- package/templates/docs-showcase/files/src/docs/plugins/vault/02-read-files.ts +37 -0
- package/templates/docs-showcase/files/src/docs/plugins/vault/03-modify-files.ts +19 -0
- package/templates/docs-showcase/files/src/docs/plugins/vault/04-modify-files.ts +22 -0
- package/templates/docs-showcase/files/src/docs/plugins/vault/05-is-it-a-file-or-folder.ts +25 -0
- package/templates/docs-showcase/files/src/docs/reference/css-variables/about-styling/01-for-plugins.ts +14 -0
- package/templates/docs-showcase/files/src/docs/reference/css-variables/about-styling/02-for-themes-and-snippets.ts +14 -0
- package/templates/docs-showcase/files/src/docs/reference/css-variables/publish/site-fonts/01-intro.ts +14 -0
- package/templates/docs-showcase/files/src/docs/reference/typescript-api/command/callback/01-example.ts +24 -0
- package/templates/docs-showcase/files/src/docs/reference/typescript-api/debounce/01-example.ts +24 -0
- package/templates/docs-showcase/files/src/docs/reference/typescript-api/vault/process/01-example.ts +22 -0
- package/templates/docs-showcase/files/src/docs/themes/app-themes/build-a-theme/05-step-4-change-the-font.ts +14 -0
- package/templates/docs-showcase/files/src/docs/themes/app-themes/build-a-theme/06-step-5-change-the-background-color.ts +14 -0
- package/templates/docs-showcase/files/src/docs/themes/app-themes/build-a-theme/07-step-6-change-the-input-hover-border-col.ts +14 -0
- package/templates/docs-showcase/files/src/docs/themes/app-themes/build-a-theme/08-step-7-discover-css-variables-in-use.ts +14 -0
- package/templates/docs-showcase/files/src/docs/themes/app-themes/embed-fonts-and-images-in-your-theme/02-use-data-urls.ts +14 -0
- package/templates/docs-showcase/files/src/docs/themes/app-themes/theme-guidelines/01-use-css-variables.ts +14 -0
- package/templates/docs-showcase/files/src/docs/themes/obsidian-publish-themes/best-practices-for-publish-themes/01-small-screens-and-mobile-devices.ts +14 -0
- package/templates/docs-showcase/files/src/docs/themes/obsidian-publish-themes/build-a-publish-theme/01-intro.ts +14 -0
- package/templates/docs-showcase/files/src/docs/tsconfig.json +25 -0
- package/templates/docs-showcase/host/entry.d.ts +8 -0
- package/templates/docs-showcase/host/entry.js +4 -0
- package/templates/docs-showcase/host/host.ts +449 -0
- package/templates/docs-showcase/host/tsconfig.json +25 -0
- package/templates/docs-showcase/snippets.json +3566 -0
- package/templates/official-sample/README.md +9 -0
- package/templates/official-sample/files/.editorconfig.vendored +11 -0
- package/templates/official-sample/files/.github/workflows/lint.yml.vendored +27 -0
- package/templates/official-sample/files/.github/workflows/release.yml.vendored +50 -0
- package/templates/official-sample/files/.gitignore.vendored +22 -0
- package/templates/official-sample/files/.npmrc.vendored +1 -0
- package/templates/official-sample/files/AGENTS.md.vendored +269 -0
- package/templates/official-sample/files/LICENSE.vendored +5 -0
- package/templates/official-sample/files/README.md.vendored +92 -0
- package/templates/official-sample/files/esbuild.config.mjs.vendored +49 -0
- package/templates/official-sample/files/eslint.config.mts.vendored +32 -0
- package/templates/official-sample/files/manifest.json.vendored +11 -0
- package/templates/official-sample/files/package-lock.json.vendored +5053 -0
- package/templates/official-sample/files/package.json.vendored +27 -0
- package/templates/official-sample/files/src/main.ts.vendored +114 -0
- package/templates/official-sample/files/src/settings.ts.vendored +38 -0
- package/templates/official-sample/files/styles.css.vendored +8 -0
- package/templates/official-sample/files/tsconfig.json.vendored +19 -0
- package/templates/official-sample/files/version-bump.mjs.vendored +17 -0
- package/templates/official-sample/files/versions.json.vendored +3 -0
- package/upstreams.json +35 -0
- package/templates/default/dprint.json_dev-utils.ejs +0 -10
- package/templates/default/jest.config.ts@lint-root-dir_dev-utils.ejs +0 -1
- package/templates/default/scripts/build.ts@bundler_cli-bundler@lint-build-styles_dev-utils.ejs +0 -1
- package/templates/default/scripts/build.ts@bundler_esbuild@dev-utils-pre-build_tailwind.ejs +0 -2
- package/templates/default/scripts/build.ts@bundler_esbuild@lint-build-styles_dev-utils.ejs +0 -1
- package/templates/default/scripts/build.ts@bundler_esbuild@preset_dev-utils.ejs +0 -7
- package/templates/default/scripts/commit.ts_dev-utils.ejs +0 -3
- package/templates/default/scripts/dev.ts@bundler_esbuild@dev-utils-pre-build_tailwind.ejs +0 -2
- package/templates/default/scripts/dev.ts@bundler_esbuild@lint-build-styles_dev-utils.ejs +0 -1
- package/templates/default/scripts/dev.ts@bundler_esbuild@preset_dev-utils.ejs +0 -7
- package/templates/default/scripts/esbuild-plugins.ts.ejs +0 -20
- package/templates/default/scripts/esbuild-plugins.ts@dev-utils-import_vue.ejs +0 -2
- package/templates/default/scripts/esbuild-plugins.ts@dev-utils-plugin_vue.ejs +0 -1
- package/templates/default/scripts/esbuild-plugins.ts@dev-utils-plugin_wasm.ejs +0 -13
- package/templates/default/scripts/format-check.ts@tool_dprint@preset_dev-utils.ejs +0 -7
- package/templates/default/scripts/format.ts@tool_dprint@preset_dev-utils.ejs +0 -7
- package/templates/default/scripts/lint-fix.ts@tool_eslint@preset_dev-utils.ejs +0 -7
- package/templates/default/scripts/lint-md-fix.ts_dev-utils.ejs +0 -7
- package/templates/default/scripts/lint-md.ts_dev-utils.ejs +0 -7
- package/templates/default/scripts/lint.ts@tool_eslint@preset_dev-utils.ejs +0 -7
- package/templates/default/scripts/prepare.ts_dev-utils.ejs +0 -3
- package/templates/default/scripts/spellcheck.ts_dev-utils.ejs +0 -7
- package/templates/default/scripts/test-watch.ts_dev-utils@tool_jest.ejs +0 -13
- package/templates/default/scripts/test-watch.ts_dev-utils@tool_vitest.ejs +0 -8
- package/templates/default/scripts/test.ts_dev-utils@tool_jest.ejs +0 -13
- package/templates/default/scripts/test.ts_dev-utils@tool_vitest.ejs +0 -8
- package/templates/default/scripts/vite.config.ts@lint-empty-out-dir_dev-utils.ejs +0 -1
- package/templates/default/scripts/vite.config.ts@lint-out-dir_dev-utils.ejs +0 -1
- package/templates/default/scripts/webpack.config.ts@lint-webpack-default_dev-utils.ejs +0 -1
- package/templates/default/src/main.ts@import_css-modules.ejs +0 -1
- package/templates/default/src/views/sample-preact-view.tsx_dev-utils.ejs +0 -45
- package/templates/default/tsconfig.json_dev-utils@compiler-options_preact.ejs +0 -2
- package/templates/default/tsconfig.json_dev-utils@compiler-options_react.ejs +0 -1
- package/templates/default/tsconfig.json_dev-utils@compiler-options_solid.ejs +0 -2
- /package/templates/default/.github/workflows/{ci.yml@steps_biome-linter.ejs → ci.yml_standalone@steps_biome-linter.ejs} +0 -0
- /package/templates/default/.github/workflows/{ci.yml@steps_cspell.ejs → ci.yml_standalone@steps_cspell.ejs} +0 -0
- /package/templates/default/.github/workflows/{ci.yml@steps_dprint.ejs → ci.yml_standalone@steps_dprint.ejs} +0 -0
- /package/templates/default/.github/workflows/{ci.yml@steps_eslint.ejs → ci.yml_standalone@steps_eslint.ejs} +0 -0
- /package/templates/default/.github/workflows/{ci.yml@steps_jest.ejs → ci.yml_standalone@steps_jest.ejs} +0 -0
- /package/templates/default/.github/workflows/{ci.yml@steps_markdownlint.ejs → ci.yml_standalone@steps_markdownlint.ejs} +0 -0
- /package/templates/default/.github/workflows/{ci.yml@steps_prettier.ejs → ci.yml_standalone@steps_prettier.ejs} +0 -0
- /package/templates/default/.github/workflows/{ci.yml@steps_vitest.ejs → ci.yml_standalone@steps_vitest.ejs} +0 -0
- /package/templates/default/{.gitignore_tailwind.ejs → .gitignore_tailwind-cli.ejs} +0 -0
- /package/templates/default/{CONTRIBUTING.md@scripts_dev-utils.ejs → CONTRIBUTING.md@scripts_framework.ejs} +0 -0
- /package/templates/default/e2e/{sample.spec.ts_obsidian-test@lint-no-void-disable_dev-utils.ejs → sample.spec.ts_obsidian-test@lint-no-void-disable_framework.ejs} +0 -0
- /package/templates/default/e2e/{sample.spec.ts_obsidian-test@lint-no-void-enable_dev-utils.ejs → sample.spec.ts_obsidian-test@lint-no-void-enable_framework.ejs} +0 -0
- /package/templates/default/{eslint.config.mts_dev-utils.ejs → eslint.config.mts_framework.ejs} +0 -0
- /package/templates/default/{jest.config.ts@ts-jest-tsconfig_solid.ejs → jest.config.ts_standalone@ts-jest-tsconfig_solid.ejs} +0 -0
- /package/templates/default/{prettier.config.mjs.ejs → prettier.config.mjs_standalone.ejs} +0 -0
- /package/templates/default/scripts/{commitlint-config.ts.ejs → commitlint-config.ts_standalone.ejs} +0 -0
- /package/templates/default/scripts/{nano-staged-config.ts.ejs → nano-staged-config.ts_inline-nano-staged.ejs} +0 -0
- /package/templates/default/scripts/{rollup.config.ts@import_rollup-json.ejs → rollup.config.ts_framework@import_rollup-json.ejs} +0 -0
- /package/templates/default/scripts/{rollup.config.ts@import_scss.ejs → rollup.config.ts_framework@import_scss.ejs} +0 -0
- /package/templates/default/scripts/{rollup.config.ts@unwrap_rollup-json.ejs → rollup.config.ts_framework@unwrap_rollup-json.ejs} +0 -0
- /package/templates/default/scripts/{rollup.config.ts@unwrap_scss.ejs → rollup.config.ts_framework@unwrap_scss.ejs} +0 -0
- /package/templates/default/scripts/{rollup.config.ts@import_rollup-babel.ejs → rollup.config.ts_standalone@import_rollup-babel.ejs} +0 -0
- /package/templates/default/scripts/{rollup.config.ts@import_rollup-postcss.ejs → rollup.config.ts_standalone@import_rollup-postcss.ejs} +0 -0
- /package/templates/default/scripts/{rollup.config.ts@import_svelte.ejs → rollup.config.ts_standalone@import_svelte.ejs} +0 -0
- /package/templates/default/scripts/{rollup.config.ts@import_vue.ejs → rollup.config.ts_standalone@import_vue.ejs} +0 -0
- /package/templates/default/scripts/{rollup.config.ts@import_wasm.ejs → rollup.config.ts_standalone@import_wasm.ejs} +0 -0
- /package/templates/default/scripts/{rollup.config.ts@post-plugin_preact.ejs → rollup.config.ts_standalone@post-plugin_preact.ejs} +0 -0
- /package/templates/default/scripts/{rollup.config.ts@post-plugin_react.ejs → rollup.config.ts_standalone@post-plugin_react.ejs} +0 -0
- /package/templates/default/scripts/{rollup.config.ts@post-plugin_rollup-json.ejs → rollup.config.ts_standalone@post-plugin_rollup-json.ejs} +0 -0
- /package/templates/default/scripts/{rollup.config.ts@post-plugin_rollup-postcss.ejs → rollup.config.ts_standalone@post-plugin_rollup-postcss.ejs} +0 -0
- /package/templates/default/scripts/{rollup.config.ts@post-plugin_scss.ejs → rollup.config.ts_standalone@post-plugin_scss.ejs} +0 -0
- /package/templates/default/scripts/{rollup.config.ts@post-plugin_solid.ejs → rollup.config.ts_standalone@post-plugin_solid.ejs} +0 -0
- /package/templates/default/scripts/{rollup.config.ts@post-plugin_wasm.ejs → rollup.config.ts_standalone@post-plugin_wasm.ejs} +0 -0
- /package/templates/default/scripts/{rollup.config.ts@pre-plugin_svelte.ejs → rollup.config.ts_standalone@pre-plugin_svelte.ejs} +0 -0
- /package/templates/default/scripts/{rollup.config.ts@pre-plugin_vue.ejs → rollup.config.ts_standalone@pre-plugin_vue.ejs} +0 -0
- /package/templates/default/scripts/{rollup.config.ts@unwrap_rollup-babel.ejs → rollup.config.ts_standalone@unwrap_rollup-babel.ejs} +0 -0
- /package/templates/default/scripts/{rollup.config.ts@unwrap_rollup-postcss.ejs → rollup.config.ts_standalone@unwrap_rollup-postcss.ejs} +0 -0
- /package/templates/default/scripts/{rollup.config.ts@unwrap_svelte.ejs → rollup.config.ts_standalone@unwrap_svelte.ejs} +0 -0
- /package/templates/default/scripts/{rollup.config.ts@unwrap_vue.ejs → rollup.config.ts_standalone@unwrap_vue.ejs} +0 -0
- /package/templates/default/scripts/{rollup.config.ts@unwrap_wasm.ejs → rollup.config.ts_standalone@unwrap_wasm.ejs} +0 -0
- /package/templates/default/scripts/{test-watch.ts_dev-utils.ejs → test-watch.ts_framework.ejs} +0 -0
- /package/templates/default/scripts/{test.ts_dev-utils.ejs → test.ts_framework.ejs} +0 -0
- /package/templates/default/scripts/{vite.config.ts@import_preact.ejs → vite.config.ts_standalone@import_preact.ejs} +0 -0
- /package/templates/default/scripts/{vite.config.ts@import_react.ejs → vite.config.ts_standalone@import_react.ejs} +0 -0
- /package/templates/default/scripts/{vite.config.ts@import_solid.ejs → vite.config.ts_standalone@import_solid.ejs} +0 -0
- /package/templates/default/scripts/{vite.config.ts@import_svelte.ejs → vite.config.ts_standalone@import_svelte.ejs} +0 -0
- /package/templates/default/scripts/{vite.config.ts@import_vue.ejs → vite.config.ts_standalone@import_vue.ejs} +0 -0
- /package/templates/default/scripts/{vite.config.ts@plugin_preact.ejs → vite.config.ts_standalone@plugin_preact.ejs} +0 -0
- /package/templates/default/scripts/{vite.config.ts@plugin_react.ejs → vite.config.ts_standalone@plugin_react.ejs} +0 -0
- /package/templates/default/scripts/{vite.config.ts@plugin_solid.ejs → vite.config.ts_standalone@plugin_solid.ejs} +0 -0
- /package/templates/default/scripts/{vite.config.ts@plugin_svelte.ejs → vite.config.ts_standalone@plugin_svelte.ejs} +0 -0
- /package/templates/default/scripts/{vite.config.ts@plugin_vue.ejs → vite.config.ts_standalone@plugin_vue.ejs} +0 -0
- /package/templates/default/scripts/{webpack.config.ts@import_svelte.ejs → webpack.config.ts_standalone@import_svelte.ejs} +0 -0
- /package/templates/default/scripts/{webpack.config.ts@import_vue.ejs → webpack.config.ts_standalone@import_vue.ejs} +0 -0
- /package/templates/default/scripts/{webpack.config.ts@import_webpack-css-extract.ejs → webpack.config.ts_standalone@import_webpack-css-extract.ejs} +0 -0
- /package/templates/default/scripts/{webpack.config.ts@plugin_vue.ejs → webpack.config.ts_standalone@plugin_vue.ejs} +0 -0
- /package/templates/default/scripts/{webpack.config.ts@plugin_webpack-css-extract.ejs → webpack.config.ts_standalone@plugin_webpack-css-extract.ejs} +0 -0
- /package/templates/default/scripts/{webpack.config.ts@rule_css-modules.ejs → webpack.config.ts_standalone@rule_css-modules.ejs} +0 -0
- /package/templates/default/scripts/{webpack.config.ts@rule_css.ejs → webpack.config.ts_standalone@rule_css.ejs} +0 -0
- /package/templates/default/scripts/{webpack.config.ts@rule_postcss.ejs → webpack.config.ts_standalone@rule_postcss.ejs} +0 -0
- /package/templates/default/scripts/{webpack.config.ts@rule_scss.ejs → webpack.config.ts_standalone@rule_scss.ejs} +0 -0
- /package/templates/default/scripts/{webpack.config.ts@rule_solid.ejs → webpack.config.ts_standalone@rule_solid.ejs} +0 -0
- /package/templates/default/scripts/{webpack.config.ts@rule_svelte.ejs → webpack.config.ts_standalone@rule_svelte.ejs} +0 -0
- /package/templates/default/scripts/{webpack.config.ts@rule_tailwind.ejs → webpack.config.ts_standalone@rule_tailwind.ejs} +0 -0
- /package/templates/default/scripts/{webpack.config.ts@rule_vue.ejs → webpack.config.ts_standalone@rule_vue.ejs} +0 -0
- /package/templates/default/scripts/{webpack.config.ts@rule_wasm.ejs → webpack.config.ts_standalone@rule_wasm.ejs} +0 -0
- /package/templates/default/scripts/{webpack.config.ts@ts-loader-compiler-options_vue.ejs → webpack.config.ts_standalone@ts-loader-compiler-options_vue.ejs} +0 -0
- /package/templates/default/scripts/{webpack.config.ts@ts-loader-options_vue.ejs → webpack.config.ts_standalone@ts-loader-options_vue.ejs} +0 -0
- /package/templates/default/src/{plugin-settings-component.test.ts_enhanced@test-imports_vitest.ejs → plugin-settings-component.test.ts_all-in-one@test-imports_vitest.ejs} +0 -0
- /package/templates/default/src/{plugin-settings.ts_enhanced.ejs → plugin-settings.ts_all-in-one.ejs} +0 -0
- /package/templates/default/src/{plugin.ts_enhanced@import2_codemirror.ejs → plugin.ts_all-in-one@import2_codemirror.ejs} +0 -0
- /package/templates/default/src/{plugin.ts_enhanced@import2_i18next.ejs → plugin.ts_all-in-one@import2_i18next.ejs} +0 -0
- /package/templates/default/src/{plugin.ts_enhanced@import2_lit.ejs → plugin.ts_all-in-one@import2_lit.ejs} +0 -0
- /package/templates/default/src/{plugin.ts_enhanced@import2_preact.ejs → plugin.ts_all-in-one@import2_preact.ejs} +0 -0
- /package/templates/default/src/{plugin.ts_enhanced@import2_react.ejs → plugin.ts_all-in-one@import2_react.ejs} +0 -0
- /package/templates/default/src/{plugin.ts_enhanced@import2_solid.ejs → plugin.ts_all-in-one@import2_solid.ejs} +0 -0
- /package/templates/default/src/{plugin.ts_enhanced@import2_svelte.ejs → plugin.ts_all-in-one@import2_svelte.ejs} +0 -0
- /package/templates/default/src/{plugin.ts_enhanced@import2_typesafe-i18n.ejs → plugin.ts_all-in-one@import2_typesafe-i18n.ejs} +0 -0
- /package/templates/default/src/{plugin.ts_enhanced@import2_vue.ejs → plugin.ts_all-in-one@import2_vue.ejs} +0 -0
- /package/templates/default/src/{plugin.ts_enhanced@import2_wasm.ejs → plugin.ts_all-in-one@import2_wasm.ejs} +0 -0
- /package/templates/default/src/{plugin.ts_enhanced@method_ui-view.ejs → plugin.ts_all-in-one@method_ui-view.ejs} +0 -0
- /package/templates/default/src/{plugin.ts_enhanced@onload_codemirror.ejs → plugin.ts_all-in-one@onload_codemirror.ejs} +0 -0
- /package/templates/default/src/{plugin.ts_enhanced@onload_i18next.ejs → plugin.ts_all-in-one@onload_i18next.ejs} +0 -0
- /package/templates/default/src/{plugin.ts_enhanced@onload_lit.ejs → plugin.ts_all-in-one@onload_lit.ejs} +0 -0
- /package/templates/default/src/{plugin.ts_enhanced@onload_preact.ejs → plugin.ts_all-in-one@onload_preact.ejs} +0 -0
- /package/templates/default/src/{plugin.ts_enhanced@onload_react.ejs → plugin.ts_all-in-one@onload_react.ejs} +0 -0
- /package/templates/default/src/{plugin.ts_enhanced@onload_solid.ejs → plugin.ts_all-in-one@onload_solid.ejs} +0 -0
- /package/templates/default/src/{plugin.ts_enhanced@onload_svelte.ejs → plugin.ts_all-in-one@onload_svelte.ejs} +0 -0
- /package/templates/default/src/{plugin.ts_enhanced@onload_typesafe-i18n.ejs → plugin.ts_all-in-one@onload_typesafe-i18n.ejs} +0 -0
- /package/templates/default/src/{plugin.ts_enhanced@onload_vue.ejs → plugin.ts_all-in-one@onload_vue.ejs} +0 -0
- /package/templates/default/src/{plugin.ts_enhanced@onload_wasm.ejs → plugin.ts_all-in-one@onload_wasm.ejs} +0 -0
- /package/templates/default/src/preact-components/{sample-preact-component.tsx_dev-utils.ejs → sample-preact-component.tsx_framework.ejs} +0 -0
- /package/templates/default/src/solid-components/{sample-solid-component.tsx_dev-utils.ejs → sample-solid-component.tsx_framework.ejs} +0 -0
- /package/templates/default/src/styles/{main.css_dev-utils@content_tailwind.ejs → main.css_framework@content_tailwind.ejs} +0 -0
- /package/templates/default/src/views/{sample-lit-view.ts@lint-register-element_dev-utils.ejs → sample-lit-view.ts@lint-register-element_framework.ejs} +0 -0
- /package/templates/default/src/views/{sample-preact-view.tsx_standalone.ejs → sample-preact-view.tsx.ejs} +0 -0
- /package/templates/default/src/views/{sample-solid-view.tsx_dev-utils.ejs → sample-solid-view.tsx_framework.ejs} +0 -0
- /package/templates/default/src/wasm/{answer.ts_esbuild.ejs → answer.ts_wasm-esbuild.ejs} +0 -0
- /package/templates/default/src/wasm/{answer.ts_parcel.ejs → answer.ts_wasm-parcel.ejs} +0 -0
- /package/templates/default/src/wasm/{answer.ts_rollup.ejs → answer.ts_wasm-rollup.ejs} +0 -0
- /package/templates/default/src/wasm/{answer.ts_vite.ejs → answer.ts_wasm-vite.ejs} +0 -0
- /package/templates/default/src/wasm/{answer.ts_webpack.ejs → answer.ts_wasm-webpack.ejs} +0 -0
- /package/templates/default/src/{wasm.d.ts_esbuild.ejs → wasm.d.ts_wasm-esbuild.ejs} +0 -0
- /package/templates/default/src/{wasm.d.ts_parcel.ejs → wasm.d.ts_wasm-parcel.ejs} +0 -0
- /package/templates/default/src/{wasm.d.ts_rollup.ejs → wasm.d.ts_wasm-rollup.ejs} +0 -0
- /package/templates/default/src/{wasm.d.ts_vite.ejs → wasm.d.ts_wasm-vite.ejs} +0 -0
- /package/templates/default/src/{wasm.d.ts_webpack.ejs → wasm.d.ts_wasm-webpack.ejs} +0 -0
- /package/templates/default/{tsconfig.json_dev-utils@compiler-options_i18next.ejs → tsconfig.json_framework@compiler-options_i18next.ejs} +0 -0
- /package/templates/default/{tsconfig.json_dev-utils@compiler-options_lit.ejs → tsconfig.json_framework@compiler-options_lit.ejs} +0 -0
- /package/templates/default/{tsconfig.json_dev-utils@include_has-e2e.ejs → tsconfig.json_framework@include_has-e2e.ejs} +0 -0
- /package/templates/default/{tsconfig.json_dev-utils@include_svelte.ejs → tsconfig.json_framework@include_svelte.ejs} +0 -0
- /package/templates/default/{tsconfig.json_dev-utils@include_vue.ejs → tsconfig.json_framework@include_vue.ejs} +0 -0
- /package/templates/default/{tsconfig.json_dev-utils@types_jest.ejs → tsconfig.json_framework@types_jest.ejs} +0 -0
- /package/templates/default/{tsconfig.json_dev-utils@types_svelte.ejs → tsconfig.json_framework@types_svelte.ejs} +0 -0
- /package/templates/default/{tsconfig.json_dev-utils@types_wdio-obsidian.ejs → tsconfig.json_framework@types_wdio-obsidian.ejs} +0 -0
- /package/templates/default/{tsconfig.json_dev-utils@types_with-unofficial.ejs → tsconfig.json_framework@types_with-unofficial.ejs} +0 -0
- /package/templates/default/{vitest.config.ts_dev-utils.ejs → vitest.config.ts_framework.ejs} +0 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// Docs: Plugin guidelines > Styling > No hardcoded styling
|
|
2
|
+
// https://docs.obsidian.md/Plugins/Releasing/Plugin+guidelines#No+hardcoded+styling
|
|
3
|
+
// Source: https://github.com/obsidianmd/obsidian-developer-docs/blob/1c26772ac13d6e9870c865936d389fdfe694e742/en/Plugins/Releasing/Plugin%20guidelines.md?plain=1#L315
|
|
4
|
+
// The code block is licensed under 0BSD (code examples of obsidianmd/obsidian-developer-docs, Copyright (C) 2020-2026 Dynalist Inc.).
|
|
5
|
+
// The code block is upstream's, as the docs show it. create-obsidian-plugin generated the rest: the imports it
|
|
6
|
+
// leaves out, the exports later blocks on the page take, and the `run(context)` host the command calls.
|
|
7
|
+
|
|
8
|
+
import type { DocsContext } from '../../../host.ts';
|
|
9
|
+
|
|
10
|
+
async function snippet(context: DocsContext) {
|
|
11
|
+
const containerEl = context.getContainerEl();
|
|
12
|
+
{
|
|
13
|
+
const el = containerEl.createDiv();
|
|
14
|
+
el.style.color = 'white';
|
|
15
|
+
el.style.backgroundColor = 'red';
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export async function run(context: DocsContext): Promise<void> {
|
|
20
|
+
await context.showResult(await snippet(context));
|
|
21
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// Docs: Plugin guidelines > Styling > No hardcoded styling (2)
|
|
2
|
+
// https://docs.obsidian.md/Plugins/Releasing/Plugin+guidelines#No+hardcoded+styling
|
|
3
|
+
// Source: https://github.com/obsidianmd/obsidian-developer-docs/blob/1c26772ac13d6e9870c865936d389fdfe694e742/en/Plugins/Releasing/Plugin%20guidelines.md?plain=1#L325
|
|
4
|
+
// The code block is licensed under 0BSD (code examples of obsidianmd/obsidian-developer-docs, Copyright (C) 2020-2026 Dynalist Inc.).
|
|
5
|
+
// The code block is upstream's, as the docs show it. create-obsidian-plugin generated the rest: the imports it
|
|
6
|
+
// leaves out, the exports later blocks on the page take, and the `run(context)` host the command calls.
|
|
7
|
+
|
|
8
|
+
import type { DocsContext } from '../../../host.ts';
|
|
9
|
+
|
|
10
|
+
async function snippet(context: DocsContext) {
|
|
11
|
+
const containerEl = context.getContainerEl();
|
|
12
|
+
{
|
|
13
|
+
const el = containerEl.createDiv({cls: 'warning-container'});
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export async function run(context: DocsContext): Promise<void> {
|
|
18
|
+
await context.showResult(await snippet(context));
|
|
19
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// Docs: Plugin guidelines > Styling > No hardcoded styling (3)
|
|
2
|
+
// https://docs.obsidian.md/Plugins/Releasing/Plugin+guidelines#No+hardcoded+styling
|
|
3
|
+
// Source: https://github.com/obsidianmd/obsidian-developer-docs/blob/1c26772ac13d6e9870c865936d389fdfe694e742/en/Plugins/Releasing/Plugin%20guidelines.md?plain=1#L331
|
|
4
|
+
// The code block is licensed under 0BSD (code examples of obsidianmd/obsidian-developer-docs, Copyright (C) 2020-2026 Dynalist Inc.).
|
|
5
|
+
// The code block is upstream's, as the docs show it. create-obsidian-plugin generated the rest: the imports it
|
|
6
|
+
// leaves out, the exports later blocks on the page take, and the `run(context)` host the command calls.
|
|
7
|
+
|
|
8
|
+
import type { DocsContext } from '../../../host.ts';
|
|
9
|
+
|
|
10
|
+
const css = ".warning-container {\n\tcolor: var(--text-normal);\n\tbackground-color: var(--background-modifier-error);\n}";
|
|
11
|
+
|
|
12
|
+
export async function run(context: DocsContext): Promise<void> {
|
|
13
|
+
await context.toggleCss(css);
|
|
14
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// Docs: Plugin guidelines > TypeScript > Prefer async/await over Promise
|
|
2
|
+
// https://docs.obsidian.md/Plugins/Releasing/Plugin+guidelines#Prefer+async%2Fawait+over+Promise
|
|
3
|
+
// Source: https://github.com/obsidianmd/obsidian-developer-docs/blob/1c26772ac13d6e9870c865936d389fdfe694e742/en/Plugins/Releasing/Plugin%20guidelines.md?plain=1#L353
|
|
4
|
+
// The code block is licensed under 0BSD (code examples of obsidianmd/obsidian-developer-docs, Copyright (C) 2020-2026 Dynalist Inc.).
|
|
5
|
+
// The code block is upstream's, as the docs show it. create-obsidian-plugin generated the rest: the imports it
|
|
6
|
+
// leaves out, the exports later blocks on the page take, and the `run(context)` host the command calls.
|
|
7
|
+
|
|
8
|
+
import type { DocsContext } from '../../../host.ts';
|
|
9
|
+
import { requestUrl } from 'obsidian';
|
|
10
|
+
|
|
11
|
+
function test(): Promise<string | null> {
|
|
12
|
+
return requestUrl('https://example.com')
|
|
13
|
+
.then(res => res.text)
|
|
14
|
+
.catch(e => {
|
|
15
|
+
console.log(e);
|
|
16
|
+
return null;
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export { test };
|
|
21
|
+
|
|
22
|
+
export async function run(context: DocsContext): Promise<void> {
|
|
23
|
+
await context.showResult(await test(), 'test()');
|
|
24
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// Docs: Plugin guidelines > TypeScript > Prefer async/await over Promise (2)
|
|
2
|
+
// https://docs.obsidian.md/Plugins/Releasing/Plugin+guidelines#Prefer+async%2Fawait+over+Promise
|
|
3
|
+
// Source: https://github.com/obsidianmd/obsidian-developer-docs/blob/1c26772ac13d6e9870c865936d389fdfe694e742/en/Plugins/Releasing/Plugin%20guidelines.md?plain=1#L366
|
|
4
|
+
// The code block is licensed under 0BSD (code examples of obsidianmd/obsidian-developer-docs, Copyright (C) 2020-2026 Dynalist Inc.).
|
|
5
|
+
// The code block is upstream's, as the docs show it. create-obsidian-plugin generated the rest: the imports it
|
|
6
|
+
// leaves out, the exports later blocks on the page take, and the `run(context)` host the command calls.
|
|
7
|
+
|
|
8
|
+
import type { DocsContext } from '../../../host.ts';
|
|
9
|
+
import { requestUrl } from 'obsidian';
|
|
10
|
+
|
|
11
|
+
async function AsyncTest(): Promise<string | null> {
|
|
12
|
+
try {
|
|
13
|
+
let res = await requestUrl('https://example.com');
|
|
14
|
+
let text = await res.text;
|
|
15
|
+
return text;
|
|
16
|
+
}
|
|
17
|
+
catch (e) {
|
|
18
|
+
console.log(e);
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export { AsyncTest };
|
|
24
|
+
|
|
25
|
+
export async function run(context: DocsContext): Promise<void> {
|
|
26
|
+
await context.showResult(await AsyncTest(), 'AsyncTest()');
|
|
27
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// Docs: Commands
|
|
2
|
+
// https://docs.obsidian.md/Plugins/User+interface/Commands
|
|
3
|
+
// Source: https://github.com/obsidianmd/obsidian-developer-docs/blob/1c26772ac13d6e9870c865936d389fdfe694e742/en/Plugins/User%20interface/Commands.md?plain=1#L7
|
|
4
|
+
// The code block is licensed under 0BSD (code examples of obsidianmd/obsidian-developer-docs, Copyright (C) 2020-2026 Dynalist Inc.).
|
|
5
|
+
// The code block is upstream's, as the docs show it. create-obsidian-plugin generated the rest: the imports it
|
|
6
|
+
// leaves out, the exports later blocks on the page take, and the `run(context)` host the command calls.
|
|
7
|
+
|
|
8
|
+
import type { DocsContext } from '../../../host.ts';
|
|
9
|
+
import { Plugin } from 'obsidian';
|
|
10
|
+
|
|
11
|
+
export default class ExamplePlugin extends Plugin {
|
|
12
|
+
async onload() {
|
|
13
|
+
this.addCommand({
|
|
14
|
+
id: 'print-greeting-to-console',
|
|
15
|
+
name: 'Print greeting to console',
|
|
16
|
+
callback: () => {
|
|
17
|
+
console.log('Hey, you!');
|
|
18
|
+
},
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export async function run(context: DocsContext): Promise<void> {
|
|
24
|
+
await context.toggleChildPlugin(ExamplePlugin);
|
|
25
|
+
}
|
package/templates/docs-showcase/files/src/docs/plugins/user-interface/commands/03-editor-commands.ts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// Docs: Commands > Editor commands
|
|
2
|
+
// https://docs.obsidian.md/Plugins/User+interface/Commands#Editor+commands
|
|
3
|
+
// Source: https://github.com/obsidianmd/obsidian-developer-docs/blob/1c26772ac13d6e9870c865936d389fdfe694e742/en/Plugins/User%20interface/Commands.md?plain=1#L63
|
|
4
|
+
// The code block is licensed under 0BSD (code examples of obsidianmd/obsidian-developer-docs, Copyright (C) 2020-2026 Dynalist Inc.).
|
|
5
|
+
// The code block is upstream's, as the docs show it. create-obsidian-plugin generated the rest: the imports it
|
|
6
|
+
// leaves out, the exports later blocks on the page take, and the `run(context)` host the command calls.
|
|
7
|
+
|
|
8
|
+
import type { DocsContext, DocsThis } from '../../../host.ts';
|
|
9
|
+
import { Editor, MarkdownFileInfo, MarkdownView } from 'obsidian';
|
|
10
|
+
|
|
11
|
+
async function snippet(this: DocsThis, context: DocsContext) {
|
|
12
|
+
{
|
|
13
|
+
this.addCommand({
|
|
14
|
+
id: 'example-command',
|
|
15
|
+
name: 'Example command',
|
|
16
|
+
editorCallback: (editor: Editor, ctx: MarkdownView | MarkdownFileInfo) => {
|
|
17
|
+
const sel = editor.getSelection()
|
|
18
|
+
|
|
19
|
+
console.log(`You have selected: ${sel}`);
|
|
20
|
+
},
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export async function run(context: DocsContext): Promise<void> {
|
|
26
|
+
await context.showResult(await snippet.call(context.thisValue(), context));
|
|
27
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// Docs: Commands > Hot keys
|
|
2
|
+
// https://docs.obsidian.md/Plugins/User+interface/Commands#Hot+keys
|
|
3
|
+
// Source: https://github.com/obsidianmd/obsidian-developer-docs/blob/1c26772ac13d6e9870c865936d389fdfe694e742/en/Plugins/User%20interface/Commands.md?plain=1#L109
|
|
4
|
+
// The code block is licensed under 0BSD (code examples of obsidianmd/obsidian-developer-docs, Copyright (C) 2020-2026 Dynalist Inc.).
|
|
5
|
+
// The code block is upstream's, as the docs show it. create-obsidian-plugin generated the rest: the imports it
|
|
6
|
+
// leaves out, the exports later blocks on the page take, and the `run(context)` host the command calls.
|
|
7
|
+
|
|
8
|
+
import type { DocsContext, DocsThis } from '../../../host.ts';
|
|
9
|
+
|
|
10
|
+
async function snippet(this: DocsThis, context: DocsContext) {
|
|
11
|
+
{
|
|
12
|
+
this.addCommand({
|
|
13
|
+
id: 'example-command',
|
|
14
|
+
name: 'Example command',
|
|
15
|
+
hotkeys: [{ modifiers: ['Mod', 'Shift'], key: 'A' }],
|
|
16
|
+
callback: () => {
|
|
17
|
+
console.log('Hey, you!');
|
|
18
|
+
},
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export async function run(context: DocsContext): Promise<void> {
|
|
24
|
+
await context.showResult(await snippet.call(context.thisValue(), context));
|
|
25
|
+
}
|
package/templates/docs-showcase/files/src/docs/plugins/user-interface/context-menus/01-intro.ts
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
// Docs: Context menus
|
|
2
|
+
// https://docs.obsidian.md/Plugins/User+interface/Context+menus
|
|
3
|
+
// Source: https://github.com/obsidianmd/obsidian-developer-docs/blob/1c26772ac13d6e9870c865936d389fdfe694e742/en/Plugins/User%20interface/Context%20menus.md?plain=1#L3
|
|
4
|
+
// The code block is licensed under 0BSD (code examples of obsidianmd/obsidian-developer-docs, Copyright (C) 2020-2026 Dynalist Inc.).
|
|
5
|
+
// The code block is upstream's, as the docs show it. create-obsidian-plugin generated the rest: the imports it
|
|
6
|
+
// leaves out, the exports later blocks on the page take, and the `run(context)` host the command calls.
|
|
7
|
+
|
|
8
|
+
import type { DocsContext } from '../../../host.ts';
|
|
9
|
+
import { Menu, Notice, Plugin } from 'obsidian';
|
|
10
|
+
|
|
11
|
+
export default class ExamplePlugin extends Plugin {
|
|
12
|
+
async onload() {
|
|
13
|
+
this.addRibbonIcon('dice', 'Open menu', (event) => {
|
|
14
|
+
const menu = new Menu();
|
|
15
|
+
|
|
16
|
+
menu.addItem((item) =>
|
|
17
|
+
item
|
|
18
|
+
.setTitle('Copy')
|
|
19
|
+
.setIcon('documents')
|
|
20
|
+
.onClick(() => {
|
|
21
|
+
new Notice('Copied');
|
|
22
|
+
})
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
menu.addItem((item) =>
|
|
26
|
+
item
|
|
27
|
+
.setTitle('Paste')
|
|
28
|
+
.setIcon('paste')
|
|
29
|
+
.onClick(() => {
|
|
30
|
+
new Notice('Pasted');
|
|
31
|
+
})
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
menu.showAtMouseEvent(event);
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export async function run(context: DocsContext): Promise<void> {
|
|
40
|
+
await context.toggleChildPlugin(ExamplePlugin);
|
|
41
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// Docs: HTML elements > Create HTML elements using createEl()
|
|
2
|
+
// https://docs.obsidian.md/Plugins/User+interface/HTML+elements#Create+HTML+elements+using+%60createEl()%60
|
|
3
|
+
// Source: https://github.com/obsidianmd/obsidian-developer-docs/blob/1c26772ac13d6e9870c865936d389fdfe694e742/en/Plugins/User%20interface/HTML%20elements.md?plain=1#L31
|
|
4
|
+
// The code block is licensed under 0BSD (code examples of obsidianmd/obsidian-developer-docs, Copyright (C) 2020-2026 Dynalist Inc.).
|
|
5
|
+
// The code block is upstream's, as the docs show it. create-obsidian-plugin generated the rest: the imports it
|
|
6
|
+
// leaves out, the exports later blocks on the page take, and the `run(context)` host the command calls.
|
|
7
|
+
|
|
8
|
+
import type { DocsContext } from '../../../host.ts';
|
|
9
|
+
|
|
10
|
+
async function snippet(context: DocsContext) {
|
|
11
|
+
const containerEl = context.getContainerEl();
|
|
12
|
+
{
|
|
13
|
+
containerEl.createEl('h1', { text: 'Heading 1' });
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export async function run(context: DocsContext): Promise<void> {
|
|
18
|
+
await context.showResult(await snippet(context));
|
|
19
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// Docs: HTML elements > Create HTML elements using createEl() (2)
|
|
2
|
+
// https://docs.obsidian.md/Plugins/User+interface/HTML+elements#Create+HTML+elements+using+%60createEl()%60
|
|
3
|
+
// Source: https://github.com/obsidianmd/obsidian-developer-docs/blob/1c26772ac13d6e9870c865936d389fdfe694e742/en/Plugins/User%20interface/HTML%20elements.md?plain=1#L37
|
|
4
|
+
// The code block is licensed under 0BSD (code examples of obsidianmd/obsidian-developer-docs, Copyright (C) 2020-2026 Dynalist Inc.).
|
|
5
|
+
// The code block is upstream's, as the docs show it. create-obsidian-plugin generated the rest: the imports it
|
|
6
|
+
// leaves out, the exports later blocks on the page take, and the `run(context)` host the command calls.
|
|
7
|
+
|
|
8
|
+
import type { DocsContext } from '../../../host.ts';
|
|
9
|
+
|
|
10
|
+
async function snippet(context: DocsContext) {
|
|
11
|
+
const containerEl = context.getContainerEl();
|
|
12
|
+
{
|
|
13
|
+
const book = containerEl.createEl('div');
|
|
14
|
+
book.createEl('div', { text: 'How to Take Smart Notes' });
|
|
15
|
+
book.createEl('small', { text: 'Sönke Ahrens' });
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export async function run(context: DocsContext): Promise<void> {
|
|
20
|
+
await context.showResult(await snippet(context));
|
|
21
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// Docs: HTML elements > Style your elements
|
|
2
|
+
// https://docs.obsidian.md/Plugins/User+interface/HTML+elements#Style+your+elements
|
|
3
|
+
// Source: https://github.com/obsidianmd/obsidian-developer-docs/blob/1c26772ac13d6e9870c865936d389fdfe694e742/en/Plugins/User%20interface/HTML%20elements.md?plain=1#L47
|
|
4
|
+
// The code block is licensed under 0BSD (code examples of obsidianmd/obsidian-developer-docs, Copyright (C) 2020-2026 Dynalist Inc.).
|
|
5
|
+
// The code block is upstream's, as the docs show it. create-obsidian-plugin generated the rest: the imports it
|
|
6
|
+
// leaves out, the exports later blocks on the page take, and the `run(context)` host the command calls.
|
|
7
|
+
|
|
8
|
+
import type { DocsContext } from '../../../host.ts';
|
|
9
|
+
|
|
10
|
+
const css = ".book {\n border: 1px solid var(--background-modifier-border);\n padding: 10px;\n}\n\n.book__title {\n font-weight: 600;\n}\n\n.book__author {\n color: var(--text-muted);\n}";
|
|
11
|
+
|
|
12
|
+
export async function run(context: DocsContext): Promise<void> {
|
|
13
|
+
await context.toggleCss(css);
|
|
14
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// Docs: HTML elements > Style your elements (2)
|
|
2
|
+
// https://docs.obsidian.md/Plugins/User+interface/HTML+elements#Style+your+elements
|
|
3
|
+
// Source: https://github.com/obsidianmd/obsidian-developer-docs/blob/1c26772ac13d6e9870c865936d389fdfe694e742/en/Plugins/User%20interface/HTML%20elements.md?plain=1#L67
|
|
4
|
+
// The code block is licensed under 0BSD (code examples of obsidianmd/obsidian-developer-docs, Copyright (C) 2020-2026 Dynalist Inc.).
|
|
5
|
+
// The code block is upstream's, as the docs show it. create-obsidian-plugin generated the rest: the imports it
|
|
6
|
+
// leaves out, the exports later blocks on the page take, and the `run(context)` host the command calls.
|
|
7
|
+
|
|
8
|
+
import type { DocsContext } from '../../../host.ts';
|
|
9
|
+
|
|
10
|
+
async function snippet(context: DocsContext) {
|
|
11
|
+
const containerEl = context.getContainerEl();
|
|
12
|
+
{
|
|
13
|
+
const book = containerEl.createEl('div', { cls: 'book' });
|
|
14
|
+
book.createEl('div', { text: 'How to Take Smart Notes', cls: 'book__title' });
|
|
15
|
+
book.createEl('small', { text: 'Sönke Ahrens', cls: 'book__author' });
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export async function run(context: DocsContext): Promise<void> {
|
|
20
|
+
await context.showResult(await snippet(context));
|
|
21
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// Docs: HTML elements > Style your elements > Conditional styles
|
|
2
|
+
// https://docs.obsidian.md/Plugins/User+interface/HTML+elements#Conditional+styles
|
|
3
|
+
// Source: https://github.com/obsidianmd/obsidian-developer-docs/blob/1c26772ac13d6e9870c865936d389fdfe694e742/en/Plugins/User%20interface/HTML%20elements.md?plain=1#L81
|
|
4
|
+
// The code block is licensed under 0BSD (code examples of obsidianmd/obsidian-developer-docs, Copyright (C) 2020-2026 Dynalist Inc.).
|
|
5
|
+
// The code block is upstream's, as the docs show it. create-obsidian-plugin generated the rest: the imports it
|
|
6
|
+
// leaves out, the exports later blocks on the page take, and the `run(context)` host the command calls.
|
|
7
|
+
|
|
8
|
+
import type { DocsContext } from '../../../host.ts';
|
|
9
|
+
|
|
10
|
+
async function snippet(context: DocsContext) {
|
|
11
|
+
const element = context.getContainerEl();
|
|
12
|
+
{
|
|
13
|
+
element.toggleClass('danger', status === 'error');
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export async function run(context: DocsContext): Promise<void> {
|
|
18
|
+
await context.showResult(await snippet(context));
|
|
19
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// Docs: Icons > Use icons
|
|
2
|
+
// https://docs.obsidian.md/Plugins/User+interface/Icons#Use+icons
|
|
3
|
+
// Source: https://github.com/obsidianmd/obsidian-developer-docs/blob/1c26772ac13d6e9870c865936d389fdfe694e742/en/Plugins/User%20interface/Icons.md?plain=1#L13
|
|
4
|
+
// The code block is licensed under 0BSD (code examples of obsidianmd/obsidian-developer-docs, Copyright (C) 2020-2026 Dynalist Inc.).
|
|
5
|
+
// The code block is upstream's, as the docs show it. create-obsidian-plugin generated the rest: the imports it
|
|
6
|
+
// leaves out, the exports later blocks on the page take, and the `run(context)` host the command calls.
|
|
7
|
+
|
|
8
|
+
import type { DocsContext } from '../../../host.ts';
|
|
9
|
+
import { Plugin, setIcon } from 'obsidian';
|
|
10
|
+
|
|
11
|
+
export default class ExamplePlugin extends Plugin {
|
|
12
|
+
async onload() {
|
|
13
|
+
const item = this.addStatusBarItem();
|
|
14
|
+
setIcon(item, 'info');
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export async function run(context: DocsContext): Promise<void> {
|
|
19
|
+
await context.toggleChildPlugin(ExamplePlugin);
|
|
20
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// Docs: Icons > Use icons (2)
|
|
2
|
+
// https://docs.obsidian.md/Plugins/User+interface/Icons#Use+icons
|
|
3
|
+
// Source: https://github.com/obsidianmd/obsidian-developer-docs/blob/1c26772ac13d6e9870c865936d389fdfe694e742/en/Plugins/User%20interface/Icons.md?plain=1#L26
|
|
4
|
+
// The code block is licensed under 0BSD (code examples of obsidianmd/obsidian-developer-docs, Copyright (C) 2020-2026 Dynalist Inc.).
|
|
5
|
+
// The code block is upstream's, as the docs show it. create-obsidian-plugin generated the rest: the imports it
|
|
6
|
+
// leaves out, the exports later blocks on the page take, and the `run(context)` host the command calls.
|
|
7
|
+
|
|
8
|
+
import type { DocsContext } from '../../../host.ts';
|
|
9
|
+
|
|
10
|
+
const css = "div {\n --icon-size: var(--icon-size-m);\n}";
|
|
11
|
+
|
|
12
|
+
export async function run(context: DocsContext): Promise<void> {
|
|
13
|
+
await context.toggleCss(css);
|
|
14
|
+
}
|
package/templates/docs-showcase/files/src/docs/plugins/user-interface/icons/03-add-your-own-icon.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// Docs: Icons > Add your own icon
|
|
2
|
+
// https://docs.obsidian.md/Plugins/User+interface/Icons#Add+your+own+icon
|
|
3
|
+
// Source: https://github.com/obsidianmd/obsidian-developer-docs/blob/1c26772ac13d6e9870c865936d389fdfe694e742/en/Plugins/User%20interface/Icons.md?plain=1#L36
|
|
4
|
+
// The code block is licensed under 0BSD (code examples of obsidianmd/obsidian-developer-docs, Copyright (C) 2020-2026 Dynalist Inc.).
|
|
5
|
+
// The code block is upstream's, as the docs show it. create-obsidian-plugin generated the rest: the imports it
|
|
6
|
+
// leaves out, the exports later blocks on the page take, and the `run(context)` host the command calls.
|
|
7
|
+
|
|
8
|
+
import type { DocsContext } from '../../../host.ts';
|
|
9
|
+
import { addIcon, Plugin } from 'obsidian';
|
|
10
|
+
|
|
11
|
+
export default class ExamplePlugin extends Plugin {
|
|
12
|
+
async onload() {
|
|
13
|
+
addIcon('circle', `<circle cx="50" cy="50" r="50" fill="currentColor" />`);
|
|
14
|
+
|
|
15
|
+
this.addRibbonIcon('circle', 'Click me', () => {
|
|
16
|
+
console.log('Hello, you!');
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export async function run(context: DocsContext): Promise<void> {
|
|
22
|
+
await context.toggleChildPlugin(ExamplePlugin);
|
|
23
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// Docs: Modals
|
|
2
|
+
// https://docs.obsidian.md/Plugins/User+interface/Modals
|
|
3
|
+
// Source: https://github.com/obsidianmd/obsidian-developer-docs/blob/1c26772ac13d6e9870c865936d389fdfe694e742/en/Plugins/User%20interface/Modals.md?plain=1#L3
|
|
4
|
+
// The code block is licensed under 0BSD (code examples of obsidianmd/obsidian-developer-docs, Copyright (C) 2020-2026 Dynalist Inc.).
|
|
5
|
+
// The code block is upstream's, as the docs show it. create-obsidian-plugin generated the rest: the imports it
|
|
6
|
+
// leaves out, the exports later blocks on the page take, and the `run(context)` host the command calls.
|
|
7
|
+
|
|
8
|
+
import type { DocsContext } from '../../../host.ts';
|
|
9
|
+
import { App, Modal } from 'obsidian';
|
|
10
|
+
|
|
11
|
+
export class ExampleModal extends Modal {
|
|
12
|
+
constructor(app: App) {
|
|
13
|
+
super(app);
|
|
14
|
+
this.setContent('Look at me, I\'m a modal! 👀')
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export async function run(context: DocsContext): Promise<void> {
|
|
19
|
+
context.openModal(new ExampleModal(context.app));
|
|
20
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// Docs: Modals (2)
|
|
2
|
+
// https://docs.obsidian.md/Plugins/User+interface/Modals
|
|
3
|
+
// Source: https://github.com/obsidianmd/obsidian-developer-docs/blob/1c26772ac13d6e9870c865936d389fdfe694e742/en/Plugins/User%20interface/Modals.md?plain=1#L16
|
|
4
|
+
// The code block is licensed under 0BSD (code examples of obsidianmd/obsidian-developer-docs, Copyright (C) 2020-2026 Dynalist Inc.).
|
|
5
|
+
// The code block is upstream's, as the docs show it. create-obsidian-plugin generated the rest: the imports it
|
|
6
|
+
// leaves out, the exports later blocks on the page take, and the `run(context)` host the command calls.
|
|
7
|
+
|
|
8
|
+
import type { DocsContext } from '../../../host.ts';
|
|
9
|
+
import { Plugin } from 'obsidian';
|
|
10
|
+
import { ExampleModal } from './01-intro.ts';
|
|
11
|
+
|
|
12
|
+
export default class ExamplePlugin extends Plugin {
|
|
13
|
+
async onload() {
|
|
14
|
+
this.addCommand({
|
|
15
|
+
id: 'display-modal',
|
|
16
|
+
name: 'Display modal',
|
|
17
|
+
callback: () => {
|
|
18
|
+
new ExampleModal(this.app).open();
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export async function run(context: DocsContext): Promise<void> {
|
|
25
|
+
await context.toggleChildPlugin(ExamplePlugin);
|
|
26
|
+
}
|
package/templates/docs-showcase/files/src/docs/plugins/user-interface/modals/03-accept-user-input.ts
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
// Docs: Modals > Accept user input
|
|
2
|
+
// https://docs.obsidian.md/Plugins/User+interface/Modals#Accept+user+input
|
|
3
|
+
// Source: https://github.com/obsidianmd/obsidian-developer-docs/blob/1c26772ac13d6e9870c865936d389fdfe694e742/en/Plugins/User%20interface/Modals.md?plain=1#L39
|
|
4
|
+
// The code block is licensed under 0BSD (code examples of obsidianmd/obsidian-developer-docs, Copyright (C) 2020-2026 Dynalist Inc.).
|
|
5
|
+
// The code block is upstream's, as the docs show it. create-obsidian-plugin generated the rest: the imports it
|
|
6
|
+
// leaves out, the exports later blocks on the page take, and the `run(context)` host the command calls.
|
|
7
|
+
|
|
8
|
+
import type { DocsContext } from '../../../host.ts';
|
|
9
|
+
import { App, Modal, Setting } from 'obsidian';
|
|
10
|
+
|
|
11
|
+
export class ExampleModal extends Modal {
|
|
12
|
+
constructor(app: App, onSubmit: (result: string) => void) {
|
|
13
|
+
super(app);
|
|
14
|
+
this.setTitle('What\'s your name?');
|
|
15
|
+
|
|
16
|
+
let name = '';
|
|
17
|
+
new Setting(this.contentEl)
|
|
18
|
+
.setName('Name')
|
|
19
|
+
.addText((text) =>
|
|
20
|
+
text.onChange((value) => {
|
|
21
|
+
name = value;
|
|
22
|
+
}));
|
|
23
|
+
|
|
24
|
+
new Setting(this.contentEl)
|
|
25
|
+
.addButton((btn) =>
|
|
26
|
+
btn
|
|
27
|
+
.setButtonText('Submit')
|
|
28
|
+
.setCta()
|
|
29
|
+
.onClick(() => {
|
|
30
|
+
this.close();
|
|
31
|
+
onSubmit(name);
|
|
32
|
+
}));
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export async function run(context: DocsContext): Promise<void> {
|
|
37
|
+
context.openModal(new ExampleModal(context.app, (...values: unknown[]) => { void context.showResult(values); }));
|
|
38
|
+
}
|
package/templates/docs-showcase/files/src/docs/plugins/user-interface/modals/04-accept-user-input.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// Docs: Modals > Accept user input (2)
|
|
2
|
+
// https://docs.obsidian.md/Plugins/User+interface/Modals#Accept+user+input
|
|
3
|
+
// Source: https://github.com/obsidianmd/obsidian-developer-docs/blob/1c26772ac13d6e9870c865936d389fdfe694e742/en/Plugins/User%20interface/Modals.md?plain=1#L70
|
|
4
|
+
// The code block is licensed under 0BSD (code examples of obsidianmd/obsidian-developer-docs, Copyright (C) 2020-2026 Dynalist Inc.).
|
|
5
|
+
// The code block is upstream's, as the docs show it. create-obsidian-plugin generated the rest: the imports it
|
|
6
|
+
// leaves out, the exports later blocks on the page take, and the `run(context)` host the command calls.
|
|
7
|
+
|
|
8
|
+
import type { DocsContext, DocsThis } from '../../../host.ts';
|
|
9
|
+
import { ExampleModal } from './03-accept-user-input.ts';
|
|
10
|
+
import { Notice } from 'obsidian';
|
|
11
|
+
|
|
12
|
+
async function snippet(this: DocsThis, context: DocsContext) {
|
|
13
|
+
{
|
|
14
|
+
new ExampleModal(this.app, (result) => {
|
|
15
|
+
new Notice(`Hello, ${result}!`);
|
|
16
|
+
}).open();
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export async function run(context: DocsContext): Promise<void> {
|
|
21
|
+
await context.showResult(await snippet.call(context.thisValue(), context));
|
|
22
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
// Docs: Modals > Select from list of suggestions
|
|
2
|
+
// https://docs.obsidian.md/Plugins/User+interface/Modals#Select+from+list+of+suggestions
|
|
3
|
+
// Source: https://github.com/obsidianmd/obsidian-developer-docs/blob/1c26772ac13d6e9870c865936d389fdfe694e742/en/Plugins/User%20interface/Modals.md?plain=1#L82
|
|
4
|
+
// The code block is licensed under 0BSD (code examples of obsidianmd/obsidian-developer-docs, Copyright (C) 2020-2026 Dynalist Inc.).
|
|
5
|
+
// The code block is upstream's, as the docs show it. create-obsidian-plugin generated the rest: the imports it
|
|
6
|
+
// leaves out, the exports later blocks on the page take, and the `run(context)` host the command calls.
|
|
7
|
+
|
|
8
|
+
import type { DocsContext } from '../../../host.ts';
|
|
9
|
+
import { App, Notice, SuggestModal } from 'obsidian';
|
|
10
|
+
|
|
11
|
+
interface Book {
|
|
12
|
+
title: string;
|
|
13
|
+
author: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const ALL_BOOKS = [
|
|
17
|
+
{
|
|
18
|
+
title: 'How to Take Smart Notes',
|
|
19
|
+
author: 'Sönke Ahrens',
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
title: 'Thinking, Fast and Slow',
|
|
23
|
+
author: 'Daniel Kahneman',
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
title: 'Deep Work',
|
|
27
|
+
author: 'Cal Newport',
|
|
28
|
+
},
|
|
29
|
+
];
|
|
30
|
+
|
|
31
|
+
export class ExampleModal extends SuggestModal<Book> {
|
|
32
|
+
// Returns all available suggestions.
|
|
33
|
+
getSuggestions(query: string): Book[] {
|
|
34
|
+
return ALL_BOOKS.filter((book) =>
|
|
35
|
+
book.title.toLowerCase().includes(query.toLowerCase())
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// Renders each suggestion item.
|
|
40
|
+
renderSuggestion(book: Book, el: HTMLElement) {
|
|
41
|
+
el.createEl('div', { text: book.title });
|
|
42
|
+
el.createEl('small', { text: book.author });
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// Perform action on the selected suggestion.
|
|
46
|
+
onChooseSuggestion(book: Book, evt: MouseEvent | KeyboardEvent) {
|
|
47
|
+
new Notice(`Selected ${book.title}`);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export { ALL_BOOKS };
|
|
52
|
+
export type { Book };
|
|
53
|
+
|
|
54
|
+
export async function run(context: DocsContext): Promise<void> {
|
|
55
|
+
context.openModal(new ExampleModal(context.app));
|
|
56
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// Docs: Modals > Select from list of suggestions > Approximate string matching results
|
|
2
|
+
// https://docs.obsidian.md/Plugins/User+interface/Modals#Approximate+string+matching+results
|
|
3
|
+
// Source: https://github.com/obsidianmd/obsidian-developer-docs/blob/1c26772ac13d6e9870c865936d389fdfe694e742/en/Plugins/User%20interface/Modals.md?plain=1#L132
|
|
4
|
+
// The code block is licensed under 0BSD (code examples of obsidianmd/obsidian-developer-docs, Copyright (C) 2020-2026 Dynalist Inc.).
|
|
5
|
+
// The code block is upstream's, as the docs show it. create-obsidian-plugin generated the rest: the imports it
|
|
6
|
+
// leaves out, the exports later blocks on the page take, and the `run(context)` host the command calls.
|
|
7
|
+
|
|
8
|
+
import type { DocsContext } from '../../../host.ts';
|
|
9
|
+
import {FuzzySuggestModal, Notice} from "obsidian";
|
|
10
|
+
import { ALL_BOOKS, Book } from './05-select-from-list-of-suggestions.ts';
|
|
11
|
+
|
|
12
|
+
export class ExampleSuggestModal extends FuzzySuggestModal<Book> {
|
|
13
|
+
getItems(): Book[] {
|
|
14
|
+
return ALL_BOOKS;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
getItemText(book: Book): string {
|
|
18
|
+
return book.title;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
onChooseItem(book: Book, evt: MouseEvent | KeyboardEvent) {
|
|
22
|
+
new Notice(`Selected ${book.title}`);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export async function run(context: DocsContext): Promise<void> {
|
|
27
|
+
context.openModal(new ExampleSuggestModal(context.app));
|
|
28
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
// Docs: Modals > Select from list of suggestions > Custom rendering of fuzzy search results
|
|
2
|
+
// https://docs.obsidian.md/Plugins/User+interface/Modals#Custom+rendering+of+fuzzy+search+results
|
|
3
|
+
// Source: https://github.com/obsidianmd/obsidian-developer-docs/blob/1c26772ac13d6e9870c865936d389fdfe694e742/en/Plugins/User%20interface/Modals.md?plain=1#L158
|
|
4
|
+
// The code block is licensed under 0BSD (code examples of obsidianmd/obsidian-developer-docs, Copyright (C) 2020-2026 Dynalist Inc.).
|
|
5
|
+
// The code block is upstream's, as the docs show it. create-obsidian-plugin generated the rest: the imports it
|
|
6
|
+
// leaves out, the exports later blocks on the page take, and the `run(context)` host the command calls.
|
|
7
|
+
|
|
8
|
+
import type { DocsContext } from '../../../host.ts';
|
|
9
|
+
import {FuzzyMatch, FuzzySuggestModal, Notice, renderResults} from "obsidian";
|
|
10
|
+
import { ALL_BOOKS, Book } from './05-select-from-list-of-suggestions.ts';
|
|
11
|
+
|
|
12
|
+
export class ExampleSuggestModal extends FuzzySuggestModal<Book> {
|
|
13
|
+
|
|
14
|
+
//return a string representation, so there is something to search
|
|
15
|
+
getItemText(item: Book): string {
|
|
16
|
+
return item.title + " " + item.author;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
getItems(): Book[] {
|
|
20
|
+
return ALL_BOOKS;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
renderSuggestion(match: FuzzyMatch<Book>, el: HTMLElement) {
|
|
24
|
+
const titleEl = el.createDiv();
|
|
25
|
+
renderResults(titleEl, match.item.title, match.match);
|
|
26
|
+
|
|
27
|
+
// Only render the matches in the author name.
|
|
28
|
+
const authorEl = el.createEl('small');
|
|
29
|
+
const offset = -(match.item.title.length + 1);
|
|
30
|
+
renderResults(authorEl, match.item.author, match.match, offset);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
onChooseItem(book: Book, evt: MouseEvent | KeyboardEvent): void {
|
|
34
|
+
new Notice(`Selected ${book.title}`);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export async function run(context: DocsContext): Promise<void> {
|
|
40
|
+
context.openModal(new ExampleSuggestModal(context.app));
|
|
41
|
+
}
|