Sets up the basic structure for an Obsidian plugin designed to export notes to Typst-generated PDFs. This commit includes: - Initial plugin manifest and configuration. - Placeholder plugin class and settings. - Basic .gitignore to exclude common files. - Claude.md file to guide Claude AI on development Task Master is imported for dev workflow.
2.8 KiB
2.8 KiB
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Project Overview
This is an Obsidian plugin called "Obsidian Typst PDF Export" that exports notes or collections of notes to PDF using Typst. The plugin is currently in early development, built from the Obsidian sample plugin template.
Development Commands
Core Development Workflow
npm run dev- Start development with file watching and automatic compilationnpm run build- Production build with TypeScript checking and minificationnpm run version- Bump version and update manifest files
Setup
npm install- Install dependencies- Ensure NodeJS version is at least v16
Architecture & Code Structure
Entry Point
main.ts- Primary plugin entry point containing the main plugin class- Currently contains template code that needs to be replaced with Typst PDF export functionality
Key Components
- Plugin Class:
obsidianTypstPDFExportextends Obsidian'sPluginclass - Settings Interface:
obsidianTypstPDFExportSettingsfor plugin configuration - Modal:
SampleModal(template - needs replacement) - Settings Tab:
SampleSettingTab(template - needs replacement)
Build System
- esbuild for bundling and compilation
- TypeScript for type checking
- Configuration in
esbuild.config.mjs - Development mode includes source maps and file watching
- Production mode includes minification and tree shaking
Plugin Structure
manifest.json- Plugin metadata and Obsidian compatibilitypackage.json- Node.js dependencies and scriptsstyles.css- Plugin-specific CSS (currently empty template)main.js- Compiled output (generated by esbuild)
Type Inconsistencies to Address
The current code has several type mismatches that need fixing:
- Line 14:
settings: MyPluginSettingsshould besettings: obsidianTypstPDFExportSettings - Line 111:
plugin: MyPluginshould beplugin: obsidianTypstPDFExport - Line 113:
plugin: MyPluginparameter should beplugin: obsidianTypstPDFExport
Development Environment
File Structure
- Root contains configuration files and entry points
reference/directory contains example plugins for reference- Plugin follows standard Obsidian plugin structure
External Dependencies
- Obsidian API (
obsidianpackage) - Standard build tools (esbuild, TypeScript, ESLint)
- Node.js built-in modules are externalized in the build
Installation for Development
Plugin should be developed directly in an Obsidian vault at .obsidian/plugins/obsidian-typst-pdf-export/ for live testing during development.
Task Master AI Instructions
Import Task Master's development workflow commands and guidelines, treat as if import is in the main CLAUDE.md file. @./.taskmaster/CLAUDE.md