šŸŽ Get the FREE AI Skills Starter Guide — Subscribe →
BytesAgainBytesAgain
šŸ¦€ ClawHub

Slide Generation

by @hh23333

Generate Marp teaching slides from source content for teachers. Use when: (1) Generating Marp-compatible markdown slides from a .md file or folder for teachi...

Versionv1.0.0
Downloads507
TERMINAL
clawhub install slide-generation

šŸ“– About This Skill


name: slide-generation description: >- Generate Marp teaching slides from source content for teachers. Use when: (1) Generating Marp-compatible markdown slides from a .md file or folder for teaching/presentations, (2) Creating course slides with specific themes (am_blue_course), headers (logo), footers (ę•¬äøšä¹ē¾¤), and presenter info, (3) Converting educational content (chapters, notes, multiple sources) into slide format, (4) Synthesizing multiple sources into a unified slide deck. NOT for: general document editing, non-Marp presentations.

Slide Generation Skill

Generate Marp slides from source content following the AM Blue Course theme and workflow rules.

Quick Start

1. Identify sources: Read all source .md files (or all .md files in a folder) 2. Read references: Load references/rules.md and references/marp-guide.md before generating 3. Design structure: Plan slide sections from source content 4. Generate: Output .md file with Marp format

Input Modes

Single File

User: ē”Ÿęˆå…³äŗŽ"č®°åæ†äøŽę£€ē“¢"ēš„å¹»ēÆē‰‡ļ¼ŒåŸŗäŗŽē¬¬å…«ē« .md
→ Read 第八章.md, generate slides

Multiple Files / Folder

User: ęŠŠčæ™äøŖę–‡ä»¶å¤¹é‡Œēš„å†…å®¹ę•“åˆęˆäø€ē»„ę•™å­¦å¹»ēÆē‰‡
→ Read all .md files in the folder, merge by topic/chapter, generate unified slides

When multiple sources are provided:

  • Merge content by topic or chapter sequence
  • Avoid duplicate content across sources
  • If sources conflict, prefer the more recent or comprehensive one
  • Output Target

    When user specifies an output path (e.g. chapter8/memory-slide.md): 1. Create the output folder (e.g. chapter8/) 2. Copy all used images to chapter8/images/ 3. Write the slide markdown to chapter8/memory-slide.md

    Image path mapping:

  • Source path: ../images/xxx.png → Output path: ./images/xxx.png
  • Copy source images to the output images/ folder alongside the slide file
  • Marp YAML Header (Required)

    Always use this exact header:

    ---
    marp: true
    size: 16:9
    theme: am_blue_course
    paginate: true
    headingDivider: [2,3]
    footer: '*ę•¬äøšä¹ē¾¤*'
    

    Required Slide Structure

    1. Cover Page (First Slide)

    
    
    
    

    ###### [Subtitle]

    [Main Title]

    @PresenterName

    Subtitle format: use ###### (level 6 heading) Main title: use # (level 1 heading)

    2. Table of Contents (Second Slide)

    ## ęœ¬čŠ‚å†…å®¹

  • Topic 1
  • Topic 2
  • ...
  • 3. Content Slides

    Use ## (level 2 heading) for main section titles. The headingDivider: [2,3] setting automatically splits pages at ## and ### headings.

    For content-heavy pages, apply text-size classes:

  • — 0.9x font size
  • — 0.8x font size
  • For narrow/wide images, avoid left-right layouts; use full-width instead.

    Core Rules

    Must Follow

  • āœ… Content must come ONLY from source files — do not add external knowledge
  • āœ… Keep content rich but within source bounds
  • āœ… Preserve original images from source; copy to output images/ folder
  • āœ… Use logo.png as header image (path: images/logo.png in output)
  • āœ… Presenter name and email as specified by user
  • āœ… Use or for dense content
  • āœ… Inline math: wrap in $...$ (e.g. $f(x) = y$)
  • āœ… Convert code to pseudocode if it aids comprehension
  • āœ… Section numbering: use 2.2 not 10.2.2; omit chapter prefix
  • Must NOT

  • āŒ Use classes not defined in theme files
  • āŒ Use transition slides ()
  • āŒ Use --- for manual page breaks (headingDivider already handles this)
  • āŒ Title encoding like 10.2.2 — use 2.2 instead
  • āŒ Generate images — only use images from source content
  • Layout Decision Rules

    Based on image/table shape:

    | Content Shape | Recommended Layout | |---|---| | Wide image (aspect < 1:1) | Full-width, no columns | | Tall image (aspect > 1:1) | Left-right columns possible | | Square image | Flexible, consider columns | | Tables | Full-width or right-aligned; avoid narrow columns | | Code blocks | Full-width, consider tinytext | | Mixed text + image | Use cols-2 (äŗ”äŗ”åˆ†) or cols-2-64 (六四分) |

    Image scaling: use !#c w:700 or !#c h:300 to adjust size dynamically.

    Column Layout Examples

    Two columns (äŗ”äŗ”åˆ†):

    
    

    Left column content

    Right column content

    Two columns (六四分, image on left):

    
    

    !#c

    Right column text

    fig-top layout (image on top):

    
    

    Content text

    Available Classes

    Reference: assets/example_file/AwesomeMarp_blue.md and assets/example_file/slide.md

    Page layout: cols-2, cols-2-64, cols-2-73, cols-2-46, cols-2-37, cols-3, rows-2, pin-3

    Text size: tinytext, smalltext, largetext, hugetext

    Special: toc_a, cover_c, fig-top, fglass, caption, fixedtitleA, fixedtitleB

    Callouts: bq-purple, bq-blue, bq-green, bq-red, bq-black

    Image Handling

    1. Scan source for ![]() image syntax 2. Copy each image file to output images/ folder 3. In slide markdown, reference images relative to output location: ![](images/filename.png) 4. Map original paths (e.g. ../images/8-figures/8-1.png) to new paths (images/8-1.png)

    For logos and theme images, use: images/logo.png (copied from assets/images/logo.png)

    Multi-Source Synthesis

    When synthesizing from multiple sources:

    1. Read all sources first — get full picture of content 2. Identify overlap — note repeated topics across files 3. Deduplicate — consolidate overlapping content 4. Merge by structure: - If sources are chapters of the same book → follow chapter order - If sources are different perspectives → create unified section structure - If sources have conflicting info → prefer user's stated preference or most recent 5. Generate one coherent slide deck — unified structure, consistent style

    Quality Checklist

    Before finishing, verify:

  • [ ] YAML header matches required format exactly
  • [ ] Cover page has all: main title, subtitle, presenter name, email, logo, footer, no page number
  • [ ] TOC page links to correct slide numbers
  • [ ] All images from source are included and copied to images/ folder
  • [ ] No Marp classes used beyond what's in theme files
  • [ ] No --- page breaks (headingDivider handles it)
  • [ ] Inline math uses $...$ syntax
  • [ ] No title encodings like 10.2.2 — use 2.2
  • [ ] Content stays within source material bounds
  • [ ] Logo path is images/logo.png
  • šŸ’” Examples

    1. Identify sources: Read all source .md files (or all .md files in a folder) 2. Read references: Load references/rules.md and references/marp-guide.md before generating 3. Design structure: Plan slide sections from source content 4. Generate: Output .md file with Marp format