Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fddcd9c584 | ||
|
|
62738c35b2 | ||
|
|
cf4de4ce36 |
No files matched your search
@@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
## [1.4.1] - 2025-01-09
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- Windows path handling in Typst template variables - backslashes now normalized to forward slashes to prevent Typst syntax errors (OS error 123: "The syntax for the filename, directory name or volume label is incorrect")
|
||||||
|
|
||||||
## [1.4.0] - 2025-01-09
|
## [1.4.0] - 2025-01-09
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ Export Obsidian notes to PDF using the Typst typesetting system. Supports custom
|
|||||||
- [Requirements](#requirements)
|
- [Requirements](#requirements)
|
||||||
- [Templates](#templates)
|
- [Templates](#templates)
|
||||||
- [Advanced Usage](#advanced-usage)
|
- [Advanced Usage](#advanced-usage)
|
||||||
|
- [Known Limitations](#known-limitations)
|
||||||
- [Troubleshooting](#troubleshooting)
|
- [Troubleshooting](#troubleshooting)
|
||||||
- [Development](#development)
|
- [Development](#development)
|
||||||
- [Contributing](#contributing)
|
- [Contributing](#contributing)
|
||||||
@@ -253,6 +254,32 @@ JB
|
|||||||
```
|
```
|
||||||
````
|
````
|
||||||
|
|
||||||
|
## Known Limitations
|
||||||
|
|
||||||
|
This plugin works by converting your Markdown notes to PDF through a static conversion pipeline (Markdown → Typst → PDF). Due to this design, certain Obsidian features that generate or modify content dynamically cannot be exported:
|
||||||
|
|
||||||
|
### Dynamic Content Plugins
|
||||||
|
|
||||||
|
**DataView Plugin**: Queries and dynamically generated tables/lists from DataView will not appear in the exported PDF. DataView evaluates queries at runtime within Obsidian, but the plugin exports the raw Markdown source before this evaluation occurs.
|
||||||
|
|
||||||
|
**Database/Query Plugins**: Similar to DataView, any plugin that generates content through database queries or dynamic rendering will not be included in the export. This includes:
|
||||||
|
- Core Properties/Bases plugin
|
||||||
|
- Database folder plugin
|
||||||
|
- Any query-based content generation
|
||||||
|
|
||||||
|
### Custom Syntax & Styling
|
||||||
|
|
||||||
|
**Plugin-Specific Syntax**: Plugins that introduce custom Markdown syntax extensions will not translate to the PDF unless Pandoc explicitly supports that syntax. The conversion pipeline relies on Pandoc's understanding of Markdown, which may not recognize plugin-specific extensions.
|
||||||
|
|
||||||
|
**Custom Styling**: Visual styling applied by themes or plugins (such as callout styling, custom CSS classes, or plugin-specific formatting) will not be preserved. The PDF output uses Typst templates for styling, which are independent of Obsidian's rendering engine.
|
||||||
|
|
||||||
|
### Workarounds
|
||||||
|
|
||||||
|
For content you need in the exported PDF:
|
||||||
|
1. **Manual Inclusion**: Copy DataView query results into static Markdown before exporting
|
||||||
|
2. **Preprocessing**: Create a separate note with materialized content for export
|
||||||
|
3. **Alternative Formatting**: Use standard Markdown features that Pandoc and Typst support natively
|
||||||
|
|
||||||
## Troubleshooting
|
## Troubleshooting
|
||||||
|
|
||||||
### Common Issues
|
### Common Issues
|
||||||
|
|||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"id": "typst-pdf-export",
|
"id": "typst-pdf-export",
|
||||||
"name": "Typst PDF Export",
|
"name": "Typst PDF Export",
|
||||||
"version": "1.4.0",
|
"version": "1.4.1",
|
||||||
"minAppVersion": "1.9.12",
|
"minAppVersion": "1.9.12",
|
||||||
"description": "Exports a note or collection of notes to a pretty Typst PDF.",
|
"description": "Exports a note or collection of notes to a pretty Typst PDF.",
|
||||||
"author": "Alexander Kucera",
|
"author": "Alexander Kucera",
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "obsidian-typst-pdf-export",
|
"name": "obsidian-typst-pdf-export",
|
||||||
"version": "1.4.0",
|
"version": "1.4.1",
|
||||||
"description": "Exports a note or collection of notes to a pretty Typst PDF.",
|
"description": "Exports a note or collection of notes to a pretty Typst PDF.",
|
||||||
"main": "main.js",
|
"main": "main.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -285,35 +285,39 @@ export class PandocCommandBuilder {
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
private async addTemplateConfiguration(args: string[], pandocOptions: PandocOptions): Promise<void> {
|
private async addTemplateConfiguration(args: string[], pandocOptions: PandocOptions): Promise<void> {
|
||||||
// Use universal wrapper with --template and pass actual template as template_path variable
|
// Use universal wrapper with --template and pass actual template as template_path variable
|
||||||
if (pandocOptions.template) {
|
if (pandocOptions.template) {
|
||||||
const pathUtils = new PathUtils(this.plugin.app);
|
const pathUtils = new PathUtils(this.plugin.app);
|
||||||
const absolutePluginDir = pandocOptions.pluginDir || '';
|
const absolutePluginDir = pandocOptions.pluginDir || '';
|
||||||
const wrapperPath = pathUtils.joinPath(absolutePluginDir, 'templates', 'universal-wrapper.pandoc.typ');
|
const wrapperPath = pathUtils.joinPath(absolutePluginDir, 'templates', 'universal-wrapper.pandoc.typ');
|
||||||
|
|
||||||
// Verify wrapper exists
|
// Verify wrapper exists
|
||||||
if (!(await pathUtils.fileExists(wrapperPath))) {
|
if (!(await pathUtils.fileExists(wrapperPath))) {
|
||||||
throw new Error(`Universal wrapper template not found at: ${wrapperPath}`);
|
throw new Error(`Universal wrapper template not found at: ${wrapperPath}`);
|
||||||
}
|
|
||||||
|
|
||||||
args.push('--template', wrapperPath);
|
|
||||||
|
|
||||||
// Add plugin templates directory as a resource path so Typst can find template files
|
|
||||||
const templatesDir = pathUtils.joinPath(absolutePluginDir, 'templates');
|
|
||||||
// Path quoting handled automatically by spawn
|
|
||||||
args.push('--resource-path', templatesDir);
|
|
||||||
|
|
||||||
// Pass the actual template path as a variable
|
|
||||||
// Use relative path from vault root for Typst import
|
|
||||||
let templatePathForTypst = pandocOptions.template;
|
|
||||||
if (path.isAbsolute(templatePathForTypst) && pandocOptions.vaultBasePath) {
|
|
||||||
// Make template path relative to vault for Typst import
|
|
||||||
templatePathForTypst = path.relative(pandocOptions.vaultBasePath, templatePathForTypst);
|
|
||||||
}
|
|
||||||
|
|
||||||
args.push('-V', `template_path=${templatePathForTypst}`);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
args.push('--template', wrapperPath);
|
||||||
|
|
||||||
|
// Add plugin templates directory as a resource path so Typst can find template files
|
||||||
|
const templatesDir = pathUtils.joinPath(absolutePluginDir, 'templates');
|
||||||
|
// Path quoting handled automatically by spawn
|
||||||
|
args.push('--resource-path', templatesDir);
|
||||||
|
|
||||||
|
// Pass the actual template path as a variable
|
||||||
|
// Use relative path from vault root for Typst import
|
||||||
|
let templatePathForTypst = pandocOptions.template;
|
||||||
|
if (path.isAbsolute(templatePathForTypst) && pandocOptions.vaultBasePath) {
|
||||||
|
// Make template path relative to vault for Typst import
|
||||||
|
templatePathForTypst = path.relative(pandocOptions.vaultBasePath, templatePathForTypst);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Normalize to forward slashes for Typst (Typst uses forward slashes on all platforms)
|
||||||
|
// This prevents Windows backslashes from being interpreted as escape characters in Typst
|
||||||
|
templatePathForTypst = templatePathForTypst.replace(/\\/g, '/');
|
||||||
|
|
||||||
|
args.push('-V', `template_path=${templatePathForTypst}`);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds all Typst template variables mapped from export configuration.
|
* Adds all Typst template variables mapped from export configuration.
|
||||||
|
|||||||
+2
-1
@@ -6,5 +6,6 @@
|
|||||||
"1.2.1": "1.9.12",
|
"1.2.1": "1.9.12",
|
||||||
"1.3.0": "1.9.12",
|
"1.3.0": "1.9.12",
|
||||||
"1.3.1": "1.9.12",
|
"1.3.1": "1.9.12",
|
||||||
"1.4.0": "1.9.12"
|
"1.4.0": "1.9.12",
|
||||||
|
"1.4.1": "1.9.12"
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user