@tegg/markdown
v0.2.0-preview.2
Published
Source-first Markdown reader and editor with required attribution.
Readme
Tegg Markdown
Read, edit and preserve Markdown generated by people and agents. A source-first browser SDK with Reader, Live Edit and Source modes.
Source available · free commercial use with required attribution. The custom Tegg Markdown Attribution License 1.0 requires Powered by Tegg Markdown in the relevant interface. A separate written commercial agreement can permit white-label use. This project is not offered under Apache-2.0 and does not claim OSI approval.
Status
Registry release candidate 0.2.0-preview.2, prepared for the public npm preview
dist-tag. Registry publication is pending; the existing immutable Git preview
v0.2.0-preview.1 remains available. Source, tests, types, styles and mandatory
license materials are included. See release status.
The default integration requires no Tegg account, cloud, activation or telemetry. The Host owns document identity, persistence, resources, permissions and conflicts. Capabilities and limits describe the supported boundaries.
Install the Git preview
npm install 'git+https://github.com/tegg-studio/tegg-markdown.git#v0.2.0-preview.1'The versioned Git tag identifies the reviewed preview. This does not publish or reserve an npm registry scope. For reproducible deployments, retain the resolved commit in your lockfile. Start with the integration guide and choose optional engines explicitly.
Run the example
Requires Node.js 22.12+ and npm.
npm ci
npm run check
npm run devOpen the printed localhost address. Use the formatting toolbar, outline, reading settings, Markdown file import/export, three modes, local save and reopen. The example's localStorage is demonstration persistence, not a production storage or multi-user concurrency implementation. Reopen asks before discarding an unsaved draft. Cross-tab overwrite detection is a convenience check, not atomic multi-writer storage.
Install a packed build into your project
In this repository run npm pack. In a separate project run:
npm install /path/to/tegg-markdown-0.2.0-preview.1.tgzUse a browser bundler supporting ES modules, CSS and web workers (the example uses Vite):
import {TeggMarkdownEditor} from "@tegg/markdown/editor";
import "@tegg/markdown/editor.css";
const editor = new TeggMarkdownEditor(container, {
documentId: "notes/hello.md",
revision: "1",
source: "# Hello"
}, {
onChange(change) { /* display unsaved state; your Host saves */ },
onConflict(incoming, local) { /* offer explicit resolution */ },
openLink(href) { /* apply your Host's navigation policy */ }
}, "live");
// When saving, capture the exact snapshot before starting I/O.
const saved = editor.snapshot();
// Host must atomically compare baseRevision and return its new revision.
const revision = await hostStorage.save(saved);
if (!editor.acknowledgeSaved(saved, revision)) {
// Stale completion: reconcile with Host storage. Do not mark a new document saved.
}
editor.setMode("reader");
editor.destroy();container is your HTMLElement and hostStorage is your implementation.
Host contract explains save ordering and conflict handling.
Source, Reader and Live Edit share the same document and undo session.
Use TeggMarkdownReader when editing is unnecessary.
Attribution and commercial use
Normal reading, editing, undo and saving are complete under the free license.
The default frame displays attribution outside document scrolling.
You may adapt its presentation within these rules.
The attribution: "host" option transfers display responsibility to your Host;
it does not grant a white-label exemption.
See third-party notices, contribution terms, security reporting, and release process.
No application shell, customer content, cloud credentials or private repository history is included. This repository becomes the canonical SDK source; product applications migrate by consuming tested package versions.
See Mac alignment for shared-core integration and the remaining native/visual acceptance boundaries.
The browser example supports selecting a local folder for relative images and Markdown navigation, with a document selector and a narrow-window outline/settings panel. Browser saves and exports are explicit; selected files are never overwritten. See the file access boundaries.
Integration guides
Start with getting started, then React, engines and renderers, appearance and language, security and CSP, migration and support policy. Syntax compatibility uses public standards and generic fixtures; partner-specific documents are not an acceptance prerequisite.
