Files
obsidian-typst-pdf-export/CLAUDE.md
T
AlexKucera a3c430183e Initial Setup
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.
2025-08-29 16:23:28 +02:00

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 compilation
  • npm run build - Production build with TypeScript checking and minification
  • npm 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: obsidianTypstPDFExport extends Obsidian's Plugin class
  • Settings Interface: obsidianTypstPDFExportSettings for 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 compatibility
  • package.json - Node.js dependencies and scripts
  • styles.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: MyPluginSettings should be settings: obsidianTypstPDFExportSettings
  • Line 111: plugin: MyPlugin should be plugin: obsidianTypstPDFExport
  • Line 113: plugin: MyPlugin parameter should be plugin: 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 (obsidian package)
  • 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