This is a template repository for creating an Obsidian plugin using Svelte and Tailwind CSS. It provides a basic setup and structure to kickstart your development process.
Obsidian is a powerful note-taking and knowledge management application. With the help of this template, you can create a plugin that extends Obsidian's functionality using Svelte, a popular JavaScript framework for building user interfaces, along with Tailwind CSS, a utility-first CSS framework.
Before you get started, ensure that you have the following software installed:
To create a new plugin using this template, follow these steps:
pnpm install
pnpm dev
pnpm build
build
directory.The project structure follows a typical Svelte application structure with a few additional files specific to Obsidian plugin development. Here's an overview:
src/
- Contains the source code for your plugin.components/
- Contains Svelte Components.views/
- Contains Obsidian Views.build/
- The bundled output directory for the plugin generated by the build
command.To get the source map to load in Obsidian, and thus allowing you to see your Typescript code when debugging, you might need to set the sourcemapBaseUrl parameter in vite.config.ts. To actual path can be found by adding the folder (test-vault) containing your .map file to the "Filesystem" tab in the debugger. Right-click the map file and select "Copy link address". Set sourcemapBaseUrl to the base address.
Here are some resources to help you get started with building plugins for Obsidian, Svelte, and Tailwind CSS:
If you encounter any issues or have suggestions for improvements, feel free to open an issue or submit a pull request. Contributions are welcome!
This template is available under the MIT License. Feel free to modify and use it to create your own Obsidian plugins.