Skip to content
jupyter-notebook-testing logo

Jupyter Notebook Testing for EDS Blocks

jupyter-notebook-testing

Create and manage Jupyter notebooks for testing Adobe Edge Delivery Services (EDS) blocks interactively in the browser using the ipynb-viewer block. Interactive JavaScript execution, overlay previews with backdrop, direct ES6 imports. Use when creating notebooks, testing blocks with ipynb files i...

SKILL.md

Full skill instructions

Jupyter Notebook Testing for EDS Blocks

Interactive testing environment for EDS blocks using Jupyter notebooks in the browser via the ipynb-viewer block.

When to Use This Skill

Use this skill when:

  • Creating new Jupyter notebooks (.ipynb files) for EDS block testing
  • Using direct imports for helper functions (testBlock, showPreview)
  • Testing blocks in browser environment with ipynb-viewer block
  • Generating overlay previews with showPreview()
  • Debugging blocks with different content structures
  • Creating executable documentation for blocks
  • Working with minimal DOM structure requirements
  • Troubleshooting preview styling or decoration issues

Overview

Test EDS blocks rapidly with Jupyter notebooks using browser execution:

  • Browser execution only: Notebooks run via ipynb-viewer block on your EDS site
  • Direct imports: Each cell imports what it needs independently
  • Helper functions: testBlock and showPreview via ES6 imports
  • Overlay previews: Full-screen overlays with backdrop (no popup blockers)
  • Minimal DOM: Critical EDS-compatible structure (block decoration)

Key Benefits

  • Browser-native: Uses native browser APIs directly
  • No build steps: Test blocks immediately without compilation
  • Visual previews: Overlay with full styling (no popup blockers)
  • No initialization: Each cell imports what it needs
  • EDS-compatible: Follows EDS block decoration patterns
  • Executable docs: Share interactive notebooks with end users

Technology Stack

  • ipynb-viewer: EDS block for executing notebooks in browser
  • Browser native APIs: Direct DOM manipulation
  • scripts/​ipynb-helpers.js: External helper module with browser functions

Quick Start

1. Create or Open Notebook

Option A: Copy existing template

cp test.ipynb my-block-tests.ipynb
# View on EDS site using ipynb-viewer block

Option B: Create from scratch

  • Create new .ipynb file
  • Copy the first code cell from test.ipynb
  • Add to EDS page via ipynb-viewer block

2. View Notebook on EDS Site

Add ipynb-viewer block to your page:

| IPynb Viewer |
|--------------|
| /​test.ipynb |

3. Test Your Block

Simple pattern - import what you need:

// Any cell: Test a block
const { testBlock } = await import('/​scripts/​ipynb-helpers.js');
const block = await testBlock('accordion', `
  <div>
    <div>Question 1</​div>
    <div>Answer 1</​div>
  </​div>
`);
console.log('✓ Block created');
return block.outerHTML;

Note: Just write your code naturally with await and return - it runs in async context.

4. Generate Visual Preview

Opens overlay:

// Any cell: Visual preview in overlay
const { showPreview } = await import('/​scripts/​ipynb-helpers.js');
const content = `
  <div>
    <div>Question 1</​div>
    <div>Answer 1</​div>
  </​div>
`;

// Opens overlay with backdrop
await showPreview('accordion', content);

return '✓ Preview overlay opened';

Browser Execution

Purpose

End-user interaction and presentations with executable notebooks.

Features

  • Native browser APIs
  • Direct JavaScript execution
  • Console output display
  • Overlay previews (no popup blockers)
  • Interactive block decoration
  • No file system access

When to Use

  • Sharing executable demos
  • Interactive tutorials
  • Client presentations
  • Live coding examples
  • Block testing and experimentation

Helper Functions

All helper functions are in scripts/​ipynb-helpers.js, imported in each cell as needed.

Available Helper Functions

Import what you need in each cell:

FunctionPurposeBehavior
testBlock()Test block decorationUses native browser DOM
showPreview()Visual previewOpens overlay with backdrop

Usage Pattern:

// Import what you need in each cell
const { testBlock, showPreview } = await import('/​scripts/​ipynb-helpers.js');

// Use the functions
const block = await testBlock('accordion', '<div>content</​div>');
await showPreview('accordion', '<div>content</​div>');

// Use document directly
const div = document.createElement('div');

return block.outerHTML; // Return value to display in output

Overlay Preview System

Live previews use full-screen overlays - no popup blockers!

How It Works

  1. Creates overlay: Full-screen overlay with semi-transparent backdrop
  2. Responsive preview buttons: Switch between Mobile (375×667), Tablet (768×1024), and Desktop (95%×95vh) views
  3. Minimal DOM (EDS-compatible): Block decorated properly with CSS/​JS
  4. Auto-decoration: Dynamically imports and executes block JavaScript

Key Benefits

✅ No popup blockers | ✅ Responsive testing | ✅ Better UX (stays on page) | ✅ Clean DOM | ✅ EDS-compatible | ✅ Full styling

Responsive Preview Controls

Test blocks across different device sizes with one click:

  • 📱 Mobile (375px × 667px) - iPhone SE/​8 size
  • 📱 Tablet (768px × 1024px) - iPad size
  • 🖥️ Desktop (95% × 95vh) - Full desktop view (default)

Switch between views interactively with smooth transitions to test block responsiveness!

DOM Structure Requirements

Minimal Structure

Block is decorated properly within overlay content area:

<div class="ipynb-preview-content">
  <div class="blockname block"><!-- content rows --></​div>
</​div>

Why This Matters

EDS blocks iterate over block.children directly. The overlay system ensures proper structure for decoration.

Benefits: No wrapper interference | Proper block decoration | Full CSS/​JS support

Troubleshooting

Preview Shows Unstyled Content

Cause: CSS not loading or block decoration failed. Check DevTools Console + Network tab for 404s and errors. Fix: Verify block CSS exists.

Overlay Not Appearing

Symptom: showPreview() runs but no overlay appears. Cause: JavaScript error during execution. Fix: Check browser console for errors.

Import Errors

Symptom: Cells fail with import errors. Cause: Incorrect import path. Fix: Use absolute path /​scripts/​ipynb-helpers.js

When to Use Notebooks

✅ Use For: Quick validation, content experimentation, debugging, prototyping, executable documentation, showPreview() testing, interactive demos

❌ Don't Use For: Complex interactions requiring Node.js, file system operations, automated testing, CI/​CD pipelines

Best Practices

  1. Import what you need: Each cell imports helper functions independently
  2. Write async code naturally: Use await directly - cells run in async context
  3. Return values: Use return to display results in output cell
  4. Use direct imports: const { testBlock, showPreview } = await import(...)
  5. Test visual output: Always use showPreview() for verification
  6. No initialization required: Run any cell at any time
  7. Structure notebooks: Clear, focused cells with markdown documentation

Integration with ipynb-viewer Block

The ipynb-viewer EDS block executes notebooks in browser:

| IPynb Viewer |
|--------------|
| /​path/​to/​notebook.ipynb |

Features: Interactive execution (async/​await support), console capture, markdown rendering (tables, code blocks, lists), error handling

Key Points: No initialization required | Each cell imports independently | Browser uses native APIs | Helper functions via ES6 imports

Reference Files

For detailed information, see:

Related Documentation

Summary

Jupyter notebooks with browser execution provide an interactive testing environment for EDS blocks that:

  • Browser-native execution: Direct browser APIs, no Node.js complexity
  • No initialization required: Each cell imports what it needs
  • Helper functions: testBlock, showPreview via direct imports
  • Overlay previews: Visual feedback (no popup blockers)
  • Minimal DOM structure: EDS-compatible block decoration
  • ipynb-viewer integration: End-user executable notebooks
  • Instant feedback: No server or build overhead
  • Shareable: Create interactive demos and documentation

Use this skill whenever you need to rapidly test, debug, or document EDS blocks in the browser without the ceremony of traditional development environments.


Skill Status: ✅ Complete - Browser-only execution Line Count: < 500 lines Progressive Disclosure: Detailed content in reference files

More skills from majiayu000

xiaohongshu logo
majiayu000/claude-arsenal

xiaohongshu

xiaohongshu

286 148
View
agent-task-conductor logo
majiayu000/claude-skill-registry

agent-task-conductor

Conduct multi-agent task orchestration and workflow coordination.

663 1
View
conductor-setup logo
majiayu000/claude-skill-registry

conductor-setup

Initialize project with Conductor artifacts (product definition,

663 1
View
animation-designer logo
majiayu000/claude-skill-registry

animation-designer

Expert in web animations, transitions, and motion design using Framer Motion and CSS

663 1
View
diagramming logo
majiayu000/claude-skill-registry

diagramming

Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...

663 1
View
h3-pg logo
majiayu000/claude-skill-registry-data

h3-pg

PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.

23 1
View
conductor-development logo
majiayu000/claude-skill-registry

conductor-development

Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...

663 1
View
conductor-status logo
majiayu000/claude-skill-registry

conductor-status

Display project status, active tracks, and next actions

663 1
View
dockerization logo
majiayu000/claude-skill-registry

dockerization

Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.

663 1
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View