feat: add comprehensive template embedding and release automation

Implements dual-strategy template distribution for reliable plugin deployment:

Template Embedding System:
- Add esbuild plugin to embed .typ templates as base64 strings in main.js
- Create EmbeddedTemplateManager for automatic template extraction
- Add TypeScript declarations for virtual template-embed module
- Templates auto-extract on plugin load if missing from disk

Release Automation:
- Add GitHub Actions workflow for automated ZIP releases
- Create package-plugin.js script for complete distribution packages
- Update version-bump.mjs for Obsidian-compliant tags (no 'v' prefix)
- Ensure releases include templates/ directory for manual installations

Documentation Updates:
- Comprehensive installation instructions with troubleshooting
- Clear warnings about requiring complete ZIP packages
- Multiple installation methods including manual and automated

This ensures the plugin works regardless of installation method:
- ZIP releases provide templates/ directory (primary method)
- Embedded templates auto-extract as fallback (secondary method)

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Jarvis committed 2025-09-05 15:34:00 +02:00
1 parent d40253e6c4
commit 8557720f43
10 files changed
+1619 -21

No files matched your search

+49 -4
View File
@@ -52,11 +52,28 @@ Typst offers several advantages over standard PDF export:
3. Click **Browse** and search for "Typst PDF Export"
4. **Install** and **Enable** the plugin
### Method 2: Manual Installation
### Method 2: Manual Installation from GitHub Releases
1. Download the latest release from [GitHub Releases](https://github.com/akucera/obsidian-typst-pdf-export/releases)
2. Extract the files to `{VaultFolder}/.obsidian/plugins/obsidian-typst-pdf-export/`
3. Reload Obsidian and enable the plugin in Settings
**⚠️ Important**: This plugin requires template files to function. Always use the complete ZIP package.
1. Go to [GitHub Releases](https://github.com/akucera/obsidian-typst-pdf-export/releases)
2. Download the **complete ZIP package** (`obsidian-typst-pdf-export.zip`) - **NOT just main.js**
3. Extract the entire contents to `{VaultFolder}/.obsidian/plugins/obsidian-typst-pdf-export/`
4. Ensure the `templates/` directory is included with all `.typ` files:
```
.obsidian/plugins/obsidian-typst-pdf-export/
├── main.js
├── manifest.json
├── styles.css
└── templates/
├── default.typ
├── modern.typ
├── article.typ
├── report.typ
└── universal-wrapper.pandoc.typ
```
5. Reload Obsidian (`Ctrl/Cmd + R` or restart)
6. Enable the plugin in **Settings** → **Community Plugins**
### Method 3: BRAT (Beta Reviewer's Auto-update Tool)
@@ -64,6 +81,34 @@ Typst offers several advantages over standard PDF export:
2. Add this repository: `akucera/obsidian-typst-pdf-export`
3. Enable the plugin after installation
### Method 4: Developer Installation
For development or the latest changes:
1. Clone the repository to your vault's plugins folder:
```bash
cd {VaultFolder}/.obsidian/plugins/
git clone https://github.com/akucera/obsidian-typst-pdf-export.git
cd obsidian-typst-pdf-export
```
2. Install dependencies and build:
```bash
npm install
npm run build
```
3. Reload Obsidian and enable the plugin
### Troubleshooting Installation
**Plugin doesn't work after manual installation?**
- Verify the `templates/` directory exists with all `.typ` files
- Check the browser console (F12) for error messages
- Try downloading the complete ZIP package again
**Missing templates error?**
- The plugin automatically extracts embedded templates if missing
- Check Settings → Community Plugins → Obsidian Typst PDF Export for status
## Quick Start
### 1. Install Dependencies