Skill

Add Markstream markdown renderer to Angular 20+ apps

Adds Markstream's streaming markdown renderer to Angular 20+ with standalone components, signal bindings, and safe rendering defaults.

Works with angularkatexmermaid

80
Spark score
out of 100
Updated 3 days ago
Version 15.3.0

Add to Favorites

Why it matters

Integrate a streaming-capable markdown renderer into Angular 20+ standalone applications with signal-friendly bindings, safe HTML defaults, and support for live chat typewriter effects while preserving modern Angular patterns.

Outcomes

What it gets done

01

Install markstream-angular package and configure CSS imports for base styles and optional math rendering

02

Import MarkstreamAngularComponent into standalone components and bind content signals with streaming controls

03

Configure typewriter effects, fade transitions, and completion states for live chat interfaces

04

Validate safe HTML policy and strict Mermaid rendering to prevent untrusted content execution

Install

Add it to your toolbox

Run in your project directory:

curl -fsSL https://spark.entire.vc/get/ag-markstream-angular | bash

Overview

Markstream Angular

Integrates Markstream's streaming markdown renderer into an Angular 20+ standalone-component app, using signal-driven bindings and safe HTML/Mermaid defaults. Use for Angular 20+ standalone-component apps adding Markstream streaming markdown; not for pre-20 Angular or apps that can't accept an alpha renderer API.

What it does

This skill adds Markstream to Angular 20+ while preserving standalone-component patterns, signal-friendly bindings, safe rendering defaults, and explicit optional dependencies. It's meant to be used after markstream-install has already selected the framework and Angular is confirmed. Its workflow: before changing dependencies or source files, inspect the existing package manager and project conventions, preview the intended edits, and obtain explicit user approval; confirm Angular 20+ and record that markstream-angular is currently an alpha package; install the package plus only the specifically requested peers, importing markstream-angular/index.css and adding KaTeX CSS only when math rendering is needed; import MarkstreamAngularComponent into the standalone component's imports array; start with the content input and smoothStreaming set to 'auto', reaching for nodes plus final only when another layer already owns the AST; for live chat use fade set to false and opt into typewriter set to true, then on completion set final to true, disable pacing/cursor, and enable fade only if desired; use customHtmlTags and customComponents only for trusted tag workflows; keep htmlPolicy set to 'safe' and Mermaid in strict mode unless a narrowly scoped trusted legacy surface requires otherwise; and validate with the smallest available Angular build, typecheck, or dev command.

Documented limitations: it requires Angular 20+ and an alpha package, browser-heavy peers may need bundler or client-boundary work, and the skill does not design the host chat architecture or visual system. A security note: review dependency changes before installation, and never broaden HTML or Mermaid trust settings for untrusted model output.

When to use - and when NOT to

Use for Angular-specific standalone imports, CSS, signals, custom tags or components, streaming state, and optional peers. Do not use below Angular 20, or when the application cannot accept an alpha renderer API.

Inputs and outputs

Input is an Angular 20+ standalone-component application. Output is a working MarkstreamAngularComponent integration bound to signal-driven content, streaming, and completion state, with HTML/Mermaid trust kept at safe defaults.

import { Component, signal } from '@angular/core'
import { MarkstreamAngularComponent } from 'markstream-angular'
import 'markstream-angular/index.css'

@Component({
  selector: 'app-answer',
  standalone: true,
  imports: [MarkstreamAngularComponent],
  template: `
    <markstream-angular
      [content]="markdown()"
      [final]="done()"
      [fade]="done()"
      [typewriter]="!done()"
      [smoothStreaming]="done() ? false : 'auto'"
      [htmlPolicy]="'safe'"
    />
  `,
})
export class AnswerComponent {
  markdown = signal('# Streaming answer')
  done = signal(false)
}

Who it's for

Angular 20+ developers integrating Markstream's streaming markdown renderer into a standalone-component, signal-driven codebase who need safe rendering defaults and correct alpha-package handling.

Source README

Markstream Angular

Overview

Add Markstream to Angular 20+ while preserving standalone-component patterns, signal-friendly bindings, safe rendering defaults, and explicit optional dependencies. Use markstream-install for framework selection; use this skill once Angular is confirmed.

When to Use

Use for Angular-specific standalone imports, CSS, signals, custom tags or components, streaming state, and optional peers. Do not use below Angular 20 or when the application cannot accept an alpha renderer API.

Workflow

Before changing dependencies or source files, inspect the existing package manager and project conventions, preview the intended edits, and obtain explicit user approval.

  1. Confirm Angular 20+ and record that markstream-angular is alpha.
  2. Install the package plus only requested peers. Import markstream-angular/index.css; add KaTeX CSS only for math.
  3. Import MarkstreamAngularComponent into the standalone component's imports.
  4. Start with [content] and [smoothStreaming]="'auto'". Use nodes plus final only when another layer owns the AST.
  5. For live chat use [fade]="false" and opt into [typewriter]="true". On completion set [final]="true", disable pacing/cursor, and enable fade only if desired.
  6. Use [customHtmlTags] and [customComponents] only for trusted tag workflows.
  7. Keep [htmlPolicy]="'safe'" and Mermaid strict mode unless a narrowly scoped trusted legacy surface requires otherwise.
  8. Validate with the smallest Angular build, typecheck, or dev command.

Example

import { Component, signal } from '@angular/core'
import { MarkstreamAngularComponent } from 'markstream-angular'
import 'markstream-angular/index.css'

@Component({
  selector: 'app-answer',
  standalone: true,
  imports: [MarkstreamAngularComponent],
  template: `
    <markstream-angular
      [content]="markdown()"
      [final]="done()"
      [fade]="done()"
      [typewriter]="!done()"
      [smoothStreaming]="done() ? false : 'auto'"
      [htmlPolicy]="'safe'"
    />
  `,
})
export class AnswerComponent {
  markdown = signal('# Streaming answer')
  done = signal(false)
}

Limitations

  • Requires Angular 20+ and an alpha package.
  • Browser-heavy peers may need bundler or client-boundary work.
  • This skill does not design the host chat architecture or visual system.

Security & Safety Notes

Review dependency changes before installation. Never broaden HTML or Mermaid trust settings for untrusted model output.

Discussion

Questions & comments ยท 0

Sign In Sign in to leave a comment.