@commonpub/explainer
@commonpub/explainer
Interactive explainer runtime and Vue 3 components. Build section-by-section explorable explanations with quizzes, interactive sliders, checkpoints, and rich content blocks.
Two layers:
@commonpub/explainer— Pure TypeScript engine (types, schemas, progress tracking, quiz scoring, HTML export). Zero UI dependencies.@commonpub/explainer/vue— Vue 3 components (viewer, editor, block renderers, composables). Zero Nuxt dependencies. Works in any Vue 3 app.
Install
pnpm add @commonpub/explainer vue
Quick Start — Viewer
<script setup>
import { ExplainerViewer } from '@commonpub/explainer/vue';
import '@commonpub/explainer/vue/theme';
const content = {
title: 'My Explainer',
content: [
['sectionHeader', { tag: '§ 01', title: 'Introduction', body: 'Welcome.' }],
['text', { html: '<p>Start learning here.</p>' }],
['quiz', {
question: 'What is 2 + 2?',
options: [
{ text: '3', correct: false },
{ text: '4', correct: true },
],
}],
['checkpoint', { label: 'Section complete' }],
],
author: { displayName: 'Jane', username: 'jane' },
};
</script>
<template>
<ExplainerViewer :content="content" />
</template>
Quick Start — Editor
<script setup>
import { ExplainerEditor, useBlockEditor } from '@commonpub/explainer/vue';
import '@commonpub/explainer/vue/theme';
const blockEditor = useBlockEditor();
const metadata = ref({ slug: '', description: '', tags: [], difficulty: 'beginner' });
</script>
<template>
<ExplainerEditor
:block-editor="blockEditor"
:metadata="metadata"
@update:metadata="metadata = $event"
/>
</template>
Playground
Run the development playground to see all components in action:
cd packages/explainer
pnpm playground
Opens at http://localhost:4200 with four tabs: Individual Blocks, Block Renderer, Editor, Full Viewer.
For full documentation, see:
- vue/README.md — Vue component API, theming, customization, adding blocks
- src/README.md — TypeScript engine API, progress tracking, quiz scoring, HTML export
Related Packages
markdown-it-multiple-choice
A markdown-it plugin that converts todo lists into interactive multiple choice q...
1,250
1
Version History
| Version | Released | Vue | License |
|---|---|---|---|
| 0.9.3 | ^3.4.0 | AGPL-3.0-or-later | |
| 0.9.2 | ^3.4.0 | AGPL-3.0-or-later | |
| 0.9.1 | ^3.4.0 | AGPL-3.0-or-later | |
| 0.9.0 | ^3.4.0 | AGPL-3.0-or-later | |
| 0.8.2 | ^3.4.0 | AGPL-3.0-or-later | |
| 0.8.1 | ^3.4.0 | AGPL-3.0-or-later | |
| 0.8.0 | ^3.4.0 | AGPL-3.0-or-later | |
| 0.7.15 | ^3.4.0 | AGPL-3.0-or-later | |
| 0.7.14 | ^3.4.0 | AGPL-3.0-or-later | |
| 0.7.13 | ^3.4.0 | AGPL-3.0-or-later | |
| 0.7.12 | ^3.4.0 | AGPL-3.0-or-later | |
| 0.7.11 | ^3.4.0 | AGPL-3.0-or-later | |
| 0.7.10 | ^3.4.0 | AGPL-3.0-or-later | |
| 0.7.9 | ^3.4.0 | AGPL-3.0-or-later | |
| 0.7.8 | ^3.4.0 | AGPL-3.0-or-later | |
| 0.7.7 | ^3.4.0 | AGPL-3.0-or-later | |
| 0.7.6 | ^3.4.0 | AGPL-3.0-or-later | |
| 0.7.5 | ^3.4.0 | AGPL-3.0-or-later | |
| 0.7.4 | ^3.4.0 | AGPL-3.0-or-later | |
| 0.7.3 | ^3.4.0 | AGPL-3.0-or-later | |
| 0.7.2 | ^3.4.0 | AGPL-3.0-or-later | |
| 0.7.1 | ^3.4.0 | AGPL-3.0-or-later | |
| 0.7.0 | ^3.4.0 | AGPL-3.0-or-later | |
| 0.6.4 | ^3.4.0 | AGPL-3.0-or-later | |
| 0.6.3 | ^3.4.0 | AGPL-3.0-or-later | |
| 0.6.2 | ^3.4.0 | AGPL-3.0-or-later | |
| 0.6.1 | ^3.4.0 | AGPL-3.0-or-later | |
| 0.6.0 | ^3.4.0 | AGPL-3.0-or-later | |
| 0.5.3 | ^3.4.0 | AGPL-3.0-or-later | |
| 0.5.2 | ^3.4.0 | AGPL-3.0-or-later |
Showing the latest 30 of 39. See every release on npm