Ratride

repository·main·Indexed 41 days ago

https://github.com/fand/ratride

A Markdown-based slideshow engine supporting Terminal (TUI) and Web environments. It features animated transitions, Catppuccin themes, and Figlet ASCII-art headers. Available as a Rust CLI tool via Cargo or a JavaScript/Wasm package via npm with a programmatic `run()` API for web integration.

Tokens
11.7K
Snippets
63
Records
72
Agent score
50%

What's inside Ratride

  1. Use Figlet for ASCII-art Headers

    main

    The figlet option turns slide headers into ASCII-art banners. You can specify different fonts and colors.

    Figlet Fonts

    The default font is ANSI Shadow. Supported fonts include: ANSI Shadow, standard, slant, big, small, mini, smslant, block, doom, epic, graffiti, fraktur, roman, gothic, speed, script.

    Figlet Colors

    Use figlet_color to set a single color or a gradient:

    • Single Color: <!-- figlet_color: ff0000 --> (Hex code)
    • Horizontal Gradient: <!-- figlet_color: ffff66,3388ff --> (Comma-separated hex codes)
    • Vertical Gradient: <!-- figlet_color: ffff66,3388ff y --> (Add y suffix)

    Figlet on Web

    To control how Figlet is rendered on web/mobile devices, use the figlet_web option:

    • figlet_web: image: Converts headings to images (recommended for small screens).
    • figlet_web: text: Shows raw ASCII text.
    • figlet_web: original: Disables figlet.
    <!-- figlet: slant -->
    <!-- figlet_color: ff0000,00ffff -->
  2. Apply Slide Transitions

    main

    Ratride uses tachyonFX-based transitions to animate the movement between slides. Use the transition option in an HTML comment to set the effect.

    Slide Transitions

    The slide transition (default) moves content in from the left. You can specify directions:

    • slide left: Right to left
    • slide up: Bottom to top
    • slide down: Top to bottom

    Other Transitions

    • lines: Each line is revealed left-to-right with staggered timing.
    • lines-cross: Even lines reveal left-to-right, odd lines right-to-left.
    • slide-rgb: A color-cycling leading edge sweeps across the slide.
    • lines-rgb: A color-cycling version of the lines transition.
    <!-- transition: slide up -->
  3. Choose Slide Layouts

    main

    You can control how content is positioned on a slide using the layout option via HTML comments.

    Supported Layouts:

    • normal: The default layout.
    • center: Centers the content on the slide.
    • two-column: Splits the slide into two columns. Use ||| in your Markdown to separate the left and right columns.

    Example (Two-Column):

    <!-- layout: two-column -->
    
    ## Left Column
    - Item 1
    
    |||
    
    ## Right Column
    - Item 2
    <!-- layout: two-column -->
    
    ## Left Column
    - Foo
    
    |||
    
    ## Right Column
    1. Bar
  4. Configure slide metadata with comments

    main

    Ratride allows you to configure specific slide properties using HTML comments. This enables per-slide customization of layouts, transitions, themes, and background settings.

    Supported configuration keys include:

    • transition: Defines the animation effect (e.g., slide-in, dissolve, lines-rgb).
    • theme: Sets the visual theme (e.g., latte).
    • layout: Sets the content alignment (e.g., center).
    • bg_fill: A flag to fill the background.
    • figlet: Enables Figlet text rendering.
    • figlet_color: Specifies colors for Figlet text (comma-separated hex values).
    <!-- transition: slide-in -->
    <!-- theme: latte -->
    <!-- bg_fill -->
    
    # Slide Title
    
    <!-- layout: center -->
    <!-- transition: dissolve -->
    <!-- figlet -->
    <!-- figlet_color: ff6666,ff99ff,5577ff -->
    
    # Figlet Title
  5. Use the center layout

    main

    To display content at the center of the screen, use the <!-- layout: center --> directive in your markdown file. This is useful for hero sections or focused content blocks.

    <!-- layout: center -->
    
    ## Center
    Content here will be centered.
  6. Use the two-column layout

    main

    To create a split-screen or two-column layout, use the <!-- layout: two-column --> directive. Separate the left and right columns using a triple pipe delimiter |||.

    <!-- layout: two-column -->
    
    ## Left Column
    Content for the left side.
    
    |||
    
    ## Right Column
    Content for the right side.
  7. Use Figlet to convert headings to ASCII art

    main

    You can enable Figlet rendering for headings in your slides by inserting the <!-- figlet --> comment. When this comment is present, headings are converted into ASCII art, while normal text remains unchanged.

    <!-- figlet -->
    
    # This Heading Becomes ASCII Art
  8. Select a Figlet font using comments

    main

    To use a specific font for Figlet rendering, use the syntax <!-- figlet:fontname -->. This allows you to specify different fonts for different slides or sections.

    <!-- figlet:slant -->
    
    # Slant Font Heading
  9. Override the header for a specific slide using inline directives

    main

    To change or clear the header for a single slide, use an HTML comment directive <!-- header: ... --> immediately before the slide content.

    • To set a custom header: Use pipe-separated values (e.g., <!-- header: Item 1 | Item 2 -->).
    • To clear the header: Use an empty directive (e.g., <!-- header: -->).
    <!-- header: [GitHub](https://github.com) | [Docs](https://docs.rs) -->
    
    # Slide Title