GPT Pages Importer

by DLeung
5
4
3
2
1
Score: 50/100

Description

Import ChatGPT Pages into Obsidian with portable HTML visualizations, verified figure pairing, and automatic cleanup.

Reviews

No reviews yet.

Stats

0
stars
180
downloads
0
forks
38
days
28
days
28
days
15
total PRs
0
open PRs
0
closed PRs
15
merged PRs
3
total issues
0
open issues
3
closed issues
64
commits

Latest Version

a month ago

Changelog

What's changed

Images now survive more Pages Markdown exports

  • Restore standalone Base64 data URI images, including reference-style exports such as ![caption][image1], into the note's GPT Pages Assets folder. PNG, JPEG, GIF and WebP use the same MIME/signature checks, size limits and content-addressed filenames as portable image payloads.
  • Match internal library-file: and project-file: image destinations ending in #display=full to their original asset references. Other fragments and query strings remain significant.
  • Remove a Base64 reference definition only after its image has been restored and no remaining image or ordinary link uses it. Conflicting, duplicate or ambiguous content is preserved.
  • Automatic folder cleanup now also recognizes notes containing data URI images without figure markers or asset footers. Existing backup, binary readback and note-conflict protection still apply.

Catch incomplete Pages before export

  • The updated visualization skill adds a whole-document completeness validator. It inventories every native visualization and portable raster image, including visuals with missing markers.
  • Validate one-to-one v3 figure/source pairs, native references, exact HTML SHA-256 values and image payload bindings. Missing, duplicate, orphaned or mismatched content fails validation.
  • Compare the actual Markdown download with verified Page readback to detect stale exports and omitted figures. Validation reports runtime rendering as untested rather than treating a source check as an Obsidian rendering test.

Using this update

Update the plugin to 0.2.6, then import the original Markdown export again or run cleanup in your configured watched folder. If re-import reports local changes, preserve or merge those edits before replacing the note.

AI agents authoring Pages should also update the visualization skill and its validation tools. Updating the plugin alone does not change an existing Page or add a missing HTML source. Raster image restoration does not require HTML execution trust; interactive HTML still requires explicit trust and an enabled renderer.

The minimum supported Obsidian version remains 1.5.0.

Validation

  • 526 Vitest tests and 15 Python export-verifier tests passed.
  • Lint, type checks, public-fixture checks, build and reproducible-build verification passed.
  • A read-only conversion check of an actual Pages export restored four figure pairs and one 30,811-byte JPEG, removing its unused Base64 definition. This is conversion evidence; real Obsidian rendering of these changes remains untested.

Full changelog: 0.2.5...0.2.6

README file from

Github

Keep your ideas in Pages and bring their visualizations into Obsidian. GPT Pages Importer connects exported Markdown with complete, portable HTML sources: it verifies figure pairings, moves footer sources back to their chart positions, and removes verified markers and native image references.

Current release: 0.2.5. Available in the Obsidian Community directory and through manual installation. See the compatibility record for the actual scope of device testing. Interactive HTML requires the optional Polyglot Renderer and explicit user trust. On Obsidian 1.8.7 and later, the English, Traditional Chinese and Simplified Chinese interface follows Obsidian's language. Unsupported languages and older supported Obsidian versions use English; the minimum supported version remains 1.5.0.

New in 0.2.5

  • More reliable MathBox exports: the authoring skill embeds the complete matching MathBox CSS, including its license, in the exported HTML. Charts no longer depend on a separate stylesheet request.
  • JavaScript CDN fallback: compatible, version-pinned Three.js, OrbitControls and MathBox scripts load from a primary CDN, then a backup if needed. Finite timeouts and clear failure messages replace indefinite loading. JavaScript dependencies still require network access and WebGL where used.
  • Update the skill too: update the skill in your AI agent to generate charts with the improved template. Updating the Obsidian plugin alone does not rewrite existing Pages or exported HTML. Regenerate affected charts with the updated skill, then export and import again.

New in 0.2.4

  • Formula cleanup fix: automatic cleanup now accepts CommonMark spaces or tabs between a fence delimiter and latex, matching manual import. Exact backups, repeat processing and HTML trust behavior remain unchanged.
  • Export guidance: the formula checklist now checks the bare latex blocks produced by the updated skill, before Obsidian delimiters are added during import.

New in 0.2.3

  • Pages formulas in Obsidian: convert complete standalone latex blocks containing bare TeX into native $$ display math. Supports manual import and folder cleanup, including formula-only notes with HTML rendering off. Preview and cleanup summaries show the converted count; source backups and conflict protection remain in place.
  • Corrected math skill: author Page formulas as bare latex blocks without dollar wrappers. Intentional source examples can use tex, text or latex source. Nested, unclosed, wrapped and recognized document/preamble blocks are preserved. Math workflow and validation limits.

New in 0.2.2

  • Visualization skill: use Plotly.js by default for charts and MathBox for mathematical geometry and concept animations, with fixed-version CDN dependencies. New templates include loading/error states and adjustable controls. CDN-backed charts require network access; offline dependency checks remain optional.
  • Skill cleanup: removed the obsolete generate-portable-page alias. Use $gpt-pages-obsidian-visualizations and update the skill in your AI agent separately from the Obsidian plugin. The new templates have automated static/mock coverage; fresh Pages and Obsidian runtime checks remain outstanding.

New in 0.2.1

  • Simplified Chinese interface: commands, import forms, previews, settings, renderer status and diagnostics now follow Obsidian’s 简体中文 setting. On Obsidian 1.8.7 or later, select 简体中文 and reload as prompted. The plugin recognizes zh, zh-CN, zh-Hans and zh-SG, alongside existing English and Traditional Chinese support.

New in 0.2.0

  • Portable images: restore PNG, JPEG, GIF and WebP from image source blocks included in a single Markdown export. Verified files are saved beside the note in GPT Pages Assets/ and linked locally; matching images are reused on repeat imports. Supports manual import and folder cleanup, with limits of 1 MiB per image, 4 MiB total and 32 image source blocks. Image authoring and recovery guide.
  • Cross-Page links: the updated skill resolves internal Page links to tool-confirmed HTTPS destinations before export. These remain online links requiring access to the target Page; they do not become local notes. Unresolved links are preserved and reported. Link preflight guide.
  • Math authoring: the current source skill uses bare latex formula blocks for Pages and converts eligible blocks to Obsidian display math. This requires importer 0.2.3 or later; 0.2.2 and earlier retain these blocks as code. Math workflow.

Update the Obsidian plugin and your AI agent's skill separately. Images and native math need neither HTML trust nor Polyglot Renderer. Manual tests passed for the linked-Page and multi-image examples. Formula rendering was checked in a corrected local note; an unmodified Page math export still needs separate end-to-end validation.

Why use it?

Features
Portable visuals Preserve complete HTML, CSS, JavaScript and data so interactive charts have portable source code.
Compact pairing v3 uses short IDs in the body and keeps references and SHA-256 in the footer. Verified HTML returns to its chart position.
Folder cleanup Watch one folder and all its subfolders. Add multiple Markdown exports for automatic cleanup in place.
Protected writes Preview as plain text, back up before changes, skip identical imports and stop when local edits conflict.
Explicit trust Manual imports default to html-source. Executable html requires explicit confirmation.
AI authoring workflow Use the included skill to prepare export-ready Pages with paired HTML sources before importing. Includes templates, marker generators and an export-source verifier.

Quick start

You need three components for interactive charts:

Component Purpose
Pages + authoring skill Prepare the Page with complete HTML, v3 pairing and portable sources before export.
GPT Pages Importer Verify and restore the exported content in your Obsidian vault.
Polyglot Renderer Render trusted interactive HTML. Not required for restored images or native math.

1 · Use the authoring skill in your AI agent

Prerequisite: enable and connect the Pages plugin in your AI agent, then select @Pages. The agent needs Pages' read/write and native visualization tools. This skill requires Pages tools for creating or updating a Page; if they are unavailable or cannot access the target Page, resolve that dependency before continuing.

Add the complete skills/gpt-pages-obsidian-visualizations/ folder to your agent's skill library, including its scripts, references and assets. If your agent loads instructions from files, point it to the folder's SKILL.md and keep the linked resources available. Use the skill with Pages to prepare the Page before exporting.

Install the skill helper's locked parser dependencies with npm ci --ignore-scripts --prefix <skill-dir>. Its cross-Page link preflight replaces resolvable internal Page links with tool-confirmed HTTPS destinations before export, preserving labels and reporting unresolved targets. Links still require account access; the importer remains offline.

Ask the agent:

Use @Pages and $gpt-pages-obsidian-visualizations to create or update a GPT Page about [your topic] for Markdown export to Obsidian. Use Pages tools to write the Page and create its native visualizations. Default to Plotly.js for charts and MathBox for mathematical animations, with fixed compatible CDN versions and explicit network requirements. Keep compact v3 ID-only markers in the body and matching complete HTML sources, dependency URLs, native references and SHA-256 in the footer. Do not fall back to v2.
Include portable image source blocks for any images, resolve cross-Page links before export, and use standalone latex blocks containing bare TeX formulas, with no dollar wrappers. Confirm that the installed importer supports converting them to Obsidian math.

The skill prepares native charts, short figure IDs and footer HTML with matching references and SHA-256 checksums. This is the required authoring step in this workflow: a normal Page export may contain only native image references, which do not carry portable HTML. The importer cannot reconstruct missing sources. The skill runs in your AI agent; GPT Pages Importer handles the resulting Markdown in Obsidian.

From 0.1.6, the skill and its generator require v3, even if the target importer version is unknown. The importer still supports older v1/v2 exports. Ordinary Pages keep html source fences; for an automatic-cleanup trust test, use a separate html-source Markdown copy with identical HTML bytes and checksums. Confirm folder trust and select Save settings before testing conversion. Update the skill folder in your agent separately from the Obsidian plugin.

2 · Install the plugin

Open the Obsidian Community listing, select Add to Obsidian, and install and enable GPT Pages Importer in Obsidian.

For manual installation, download main.js, manifest.json and styles.css from GitHub Releases. Create the plugin folder and place those three files in:

your vault/
└── .obsidian/
    └── plugins/
        └── gpt-pages-importer/
            ├── main.js
            ├── manifest.json
            └── styles.css

License and third-party notices are embedded in main.js. Enable the plugin under Settings → Community plugins. Reload it after replacing files for a manual update.

Requires Node.js 24 and npm:

git clone https://github.com/DLeungDL/obsidian-gpt-pages-importer.git
cd obsidian-gpt-pages-importer
npm ci
npm run check

Copy dist/gpt-pages-importer/ into your vault's .obsidian/plugins/ directory. You can also download the gpt-pages-importer build artifact from a successful GitHub Actions run.

3 · Export the prepared Page

  1. Open the skill-prepared Page and click the page title menu in the upper-left corner.
  2. Select Download, marked by the red arrow below, to save the Page as a Markdown (.md) file.

The Pages title menu with a red arrow pointing to Download

Confirm that the downloaded Markdown includes the figure markers and each visualization's complete fenced html source in the footer. If any source is missing, ask the agent to correct the Page using the skill, then export again.

For images, also check that the export includes gpt-pages-asset source blocks: native image references alone do not contain image bytes. For formulas, confirm that the export contains complete standalone latex blocks with bare TeX and no dollar wrappers; the importer adds the Obsidian math delimiters. Validate the actual exported file before enabling HTML rendering.

4 · Import your first note

  1. Run GPT Pages Importer: Import Pages Markdown, then select or drop a file.
  2. Review the destination, verified figure count and warnings in the text-only preview.
  3. Confirm the import. The destination note opens automatically.

When importing the same Page again, reuse its source name. The default destination for a new source is GPT Pages/; later imports reuse the saved destination. See the detailed usage guide for other entry points, re-imports and recovery.

To use interactive charts, install Polyglot Renderer, inspect the HTML and explicitly confirm trust as described under Rendering and trust.

Import or automatic cleanup

Manual import Automatic folder cleanup
Best for Previewing before creating or updating a destination note Dropping a batch of exports into a watched folder
Location Creates a destination under GPT Pages/ by default Modifies the original file, preserving its path and name
Repeat processing Skips identical content and stops on conflicting local edits Skips unchanged content without creating another backup
HTML fences Defaults to html-source; trusted imports can use html Preserves existing fence languages by default; folder rendering trust is optional
Backups Before replacing an existing destination Before each modification in place

In the plugin settings, enter an existing vault folder under Watched folder. Turn on Enable automatic cleanup and select Save settings. Saving and enabling scans existing Markdown and then handles files added, modified or moved into the folder or any subfolder.

Cleanup removes only verified figure markers and native image references. A verified footer source moves to its original figure position. Backups and destination notes tracked by the manual importer are excluded. Cleanup backups are stored under GPT Pages Backups/cleanup. See the settings and trust guide for details.

From Page to note

flowchart LR
    A["Pages<br/>Native visuals + short figure IDs"] --> B["Markdown export<br/>Body markers + complete footer HTML"]
    B --> C["Verify pairing<br/>ID · reference · SHA-256"]
    C --> D["Obsidian<br/>HTML returns to each chart position"]

The importer reads HTML from the exported Markdown. It removes a figure's marker and native image reference only when its unique ID, exact reference, complete source and SHA-256 all verify. Ambiguous pairings stay unchanged and produce warnings. Older v1 and v2 formats remain supported.

Read the pairing contract → · English authoring format reference →

Rendering and trust

Manual imports keep HTML in html-source fences by default. For interactive rendering, inspect the source, explicitly trust it, and use the separately installed Polyglot Renderer to render html fences.

The import dialog and the cleanup HTML rendering option show whether Polyglot Renderer is not installed, disabled or enabled. Use Recheck renderer (繁體中文: 重新檢查 renderer) after installing or changing its enablement. Detection reads this vault's installation files and saved enabled-plugin list; it does not verify successful loading or renderer settings. Unreadable or incomplete configuration shows "Unable to determine". Status checks never grant trust, install or enable plugins, or block importing and cleanup.

  • Manual import trust covers all HTML blocks in the document.
  • Folder trust covers all current and future HTML blocks in the folder and its subfolders, including unpaired blocks.
  • Automatic cleanup preserves existing fence languages by default. Disabling rendering stops future conversions; it does not revert existing html blocks.
  • Changes are backed up before writing. Trusted JavaScript may execute and make network requests. A matching SHA-256 establishes source consistency, not code safety.

To enable rendering after cleanup, turn on Enable HTML rendering after cleanup , read and confirm the folder trust dialog, then save settings. Changing the watched folder requires confirming trust again. The importer does not install or enable a renderer automatically.

Rendering options, backups and recovery →

Privacy and access

The plugin is free, requires no account, payment or API key, collects no telemetry and sends no network requests. Manual import reads the external Markdown file you select through the file picker. Writes stay within the current vault: destination notes, backups and plugin settings. Automatic cleanup processes only the configured vault folder and its subfolders.

HTML rendering is provided by the separately installed Polyglot Renderer. If trusted HTML or JavaScript includes external images, fonts, libraries or requests, the renderer may contact those services. Inspect the complete source before enabling trust.

The importer does not download Page assets or provide cloud or bidirectional sync. Since 0.2.0, portable image support lets the authoring skill include original PNG/JPEG/GIF/WebP bytes as Base64 in a single Markdown file. Verified images are saved beside the note in GPT Pages Assets/ and linked locally. This requires explicit gpt-pages-asset sources; plain native image references cannot be reconstructed. Limits and recovery behavior are documented in the linked contract.

Documentation and resources

The guides and examples below default to English. Each includes a link to its Traditional Chinese version.

Task Resource
Installation, importing, watched folders, re-imports and recovery Detailed usage guide
v3, v2 and v1 pairing rules Format contract
Author portable Pages for Obsidian English skill and tools · English format reference
Check validation scope Compatibility record · Round-trip evidence summary
Try authored sample data Static example · Interactive example
Prepare images, Page links and formulas Portable images · Cross-Page links · Math example
Report a bug or request a feature GitHub Issues

Community and feedback

Share your experience in the Obsidian Forum showcase topic. Feedback on skill setup, first imports, repeat image imports and folder trust is especially useful. A Simplified Chinese introduction has also been submitted to the Chinese forum and is awaiting moderator approval.

For reproducible bugs, open a GitHub issue with your OS, Obsidian/plugin/renderer versions, reproduction steps and a small sanitized sample. Keep private Pages and personal data out of public reports.

Development

npm run typecheck   # Strict TypeScript
npm run build       # Bundle, package and smoke-test loading
npm test            # Vitest regression tests
npm run check       # Public-data check + build + tests

The skill's Python verifier also has standard-library tests:

python -B -m unittest discover -s tests -p 'test_skill_export.py' -v

Conversion logic lives in src/convert.ts, importing and conflict protection in src/importer.ts, and automatic cleanup in src/cleanup.ts. Public fixtures use fictional identifiers. Private Pages, original exports and screenshots stay outside Git.

Why do I only have native image references, without portable interactive charts?

A visualize: reference does not contain complete HTML. Use the authoring skill to include matching sources in the Page footer before exporting Markdown.

Can I process multiple documents at once?

Place multiple Markdown files into the watched folder or its subfolders for automatic cleanup. The manual import dialog accepts one file at a time.

Does the plugin download from Pages or sync automatically?

Import and cleanup use Markdown you provide. They do not connect to Pages to download attachments or offer cloud or bidirectional sync.

Support development

License

This project uses the MIT License, covering the plugin source, documentation and bundled Page authoring skill. Bundled dependencies retain their own licenses. Complete third-party notices are embedded in main.js; source builds and CI installation artifacts also include readable license files.