Home Applications docbook-markdown-extension

docbook-markdown-extension Awaiting Review

InterSystems does not provide technical support for this project. Please contact its developer for the technical assistance.
0
0 reviews
0
Awards
9
Views
0
IPM installs
0
0
Details
Releases (1)
Reviews
Issues
Convert InterSystems IRIS documentation pages into markdown.

What's new in this version

Initial Release

IRIS DocBook -> Markdown (Browser Extension)

This is a browser extension that converts online InterSystems IRIS DocBook documentation pages into clean, portable Markdown with an offline conversion pipeline and a safe preview, making it easy to incorporate product-specific information into modern AI assisted workflows.

By turning a live documentation page into a single Markdown artifact you can paste into ChatGPT, a custom GPT, or an agentic development tool, you can supply accurate project context such as APIs, configuration steps, ObjectScript examples, and constraints, which reduces hallucinations and improves code generation quality. The output is designed to be LLM friendly by flattening tabbed content, normalizing code blocks with language hints, promoting glossary entries and headings for better retrieval, and optionally stripping links or tables when you want a smaller prompt, so it fits well into prompt libraries, retrieval augmented generation pipelines, or project specific context packs that you reuse across sessions and teams.

What it does

When you click the extension icon on a supported DocBook page, it:

  • Extracts the main article DOM from the active tab (on-demand).
  • Converts DocBook HTML to Markdown using a custom pipeline.
  • Opens a viewer tab with:
    • Markdown output (editable textarea).
    • Sanitized preview (sandboxed iframe).
    • One-click copy/download.
    • Optional link/table stripping.

Supported pages

This extension is intentionally scoped to InterSystems IRIS documentation:

  • Host must be: docs.intersystems.com.
  • Path must include one of:
    • /csp/docbook/DocBook.UI.Page.cls.
    • /csp/docbook/Doc.View.cls.
  • URL must include a KEY=... query parameter.

If you click the icon on an unsupported page, the viewer opens with an explanatory error.

Install

Prerequisites

  • Node.js (recent LTS recommended).

Build

npm install
npm run build

Load into Chrome

  1. Open chrome://extensions.
  2. Enable Developer mode.
  3. Click Load unpacked.
  4. Select the dist/ folder produced by npm run build.

Load into Edge

  1. Open edge://extensions.
  2. Enable Developer mode.
  3. Click Load unpacked.
  4. Select the dist/ folder produced by npm run build.

Usage

Open a supported IRIS DocBook page:

  • Click the extension icon.
  • A new tab opens showing the converted Markdown.

In the viewer you can:

  • Copy Markdown
  • Download .md
  • Copy Source URL
  • Clear Session Data
  • Toggle:
    • Strip Links (Keep Text)
    • Remove HTML Tables

Output notes

The conversion pipeline does a set of targeted normalizations aimed at DocBook pages:

  • Flattens tabbed blocks into headings + content.
  • Promotes table titles and glossary entries into headings.
  • Normalizes code blocks and attempts language detection (e.g., ObjectScript/SQL/XML/JS/Python).
  • Converts admonitions (note/important/caution/tip/warning) into blockquotes with a label.
  • Removes images (replaces with a text placeholder when an alt value exists).
  • Repairs some malformed list structures.
  • Emits tables as raw HTML by default (optionally removable in the viewer).

Markdown conversion is done via Turndown with a few overrides for better fidelity.

Security & privacy

This extension is built to be conservative:

  • No network access from extension pages:
    • Extension CSP includes connect-src 'none'.
  • Runs only when you click the extension icon
  • Only extracts DOM from the active tab, and only on supported DocBook URLs.
  • Extracted content is stored in a session-scoped manner using chrome.storage.session.
    • You can clear it immediately via Clear Session Data.
  • Preview is hardened:
    • Markdown is rendered to HTML locally.
    • HTML is sanitized with DOMPurify and a tight allow-list.
    • Links are rewritten to allow only http(s) URLs on docs.intersystems.com.
    • Preview is displayed in a sandboxed iframe using srcdoc.
    • Scripts are blocked.

Development

Run a local dev server:

npm run dev

Build the unpacked extension:

npm run build

Then load dist/ via Load unpacked.

Project structure (high level)

  • src/background.ts - action click handler; validates URL; extracts page DOM; stores session payload; opens viewer.
  • src/viewer.ts - reads session payload; converts to Markdown; renders output + safe preview; copy/download actions.
  • src/convert.ts - conversion orchestrator (DOM passes + Turndown).
  • src/domPasses.ts - targeted DOM normalization passes for InterSystems DocBook HTML.
  • viewer.html - viewer UI (Markdown + Preview tabs).
  • icons/ - extension icons.
Version
0.0.111 Mar, 2026
Ideas portal
https://
Category
Developer Environment
Works with
InterSystems IRIS
First published
11 Mar, 2026
Last edited
11 Mar, 2026