Meme Literals

Meme literals create renderable meme images using the @ prefix.

Syntax

// Quick form — template name and a single text string
@template "text"

// Full form — with dimensions, style, and named text slots
@template [WIDTHxHEIGHT] [styleName] {
    top: "Top text"
    bottom: "Bottom text"
    center: "Center text"
}

Quick Form

A template name followed by a string creates a meme with that text as the top line.

@blank "Hello, World!";
@two_panel "Before coffee" "After coffee";
@bottom_text "When the code works";

Multi-string memes fill top, bottom, center in order depending on the template.

Full Form

Use { } for explicit text slot assignment.

@blank {
    top: "Mac Language"
    bottom: "Meme as Code"
}

Dimensions

Specify output size with WIDTHxHEIGHT before the text block.

@blank 1080x1080 {
    top: "HD Meme"
}

Default dimensions depend on the template (typically 720x720).

Custom Images

Use a file path instead of a template name.

@"photos/cat.jpg" "Caption text";

String template paths (@"path") resolve relative to the script's directory.

Saving

Memes are saved with the => operator or save() function.

@blank "Hello" => "hello.png";

var m = @two_panel "Top" "Bottom";
save(m, "meme.jpg");

Output files are written to ~/mac/output/ by default. Explicit relative and absolute save paths are respected unless MAC_OUTPUT_DIR is set by the host.

With Styles

Apply a named style for text customization.

style red_bold {
    color: "#FF0000"
    fontWeight: "bold"
}

@blank 720x720 red_bold {
    top: "Styled Text"
}

With Effects

Pipe memes through effect functions.

@blank "Vintage" |> sepia |> vignette => "vintage.png";

With Positioned Text

Use text: followed by x: and y: to place text at absolute pixel coordinates. Multiple positioned entries are allowed and can mix with the named positions (top:, bottom:, center:).

@blank 720x720 {
    top: "HEADER"
    text: "label A" x: 120 y: 200 fontSize: "sm"
    text: "label B" x: 520 y: 200 fontSize: 64
    bottom: "footer"
}

fontSize accepts either a pixel number or one of the size tier strings "sm", "md", "lg", "xlg". If omitted, the meme's default sizing applies.

All positioned text on a single meme shares the meme's outer style (color, outline, weight, etc.). Per-entry colors are not currently supported — use beside, stack, or grid to combine memes with different styles.

Meme Assets

The @meme.<name> syntax resolves to a built-in meme asset image.

@meme.shrek_smirk "When your code compiles" => "shrek.png";
@meme.girl_side_eye { bottom: "QA finds a bug" } => "qa.png";

Available assets: shrek_smirk, shrek_side_eye, girl_side_eye, king_bach_stare, jordan_crying, kid_crying, window_despair, guy_crying, idk_about_that, distracted_boyfriend, will_smith_presenting, thousand_yard_stare, height_chart_lineup, horse_head_wedding, bliss_ferret_stare, cat_explosion, drake_reaction_grid, cow_dolphin_jump, kcat_stare, evil_cat_throne, shrek_sun_donkey, shaq_timeout, cat_hill_peek, dog_earbuds_bliss, breaking_news_alert, shrek_xp_hill, fallon_staring, bubbles_chopsticks, blossom_angry_fire, this_is_fine_empty_room, window_bars, empty_stage_spotlight, kpop_shush, cardi_blue_hair, t_rex_car_window, stonks_arrow, breaking_news_mic, bathroom_throne, empty_press_conference, bright_sun_day, many_bald_men, pepe_clouds, empty_oval_office, windows_xp_bliss, spongebob_flower_hills, krusty_krab_red_chair, barbie_car_fire, guy_holding_rose, sid_closeup, spongebob_group_stare, squidward_window_stare, rock_bliss_peek, bubbles_unimpressed, bubbles_scheming, gary_disguise, spongebob_houses_sunset, spongebob_war_room, beach_dog_sitting, mona_lisa_side_eye, three_matching_guys, lonely_desk_worker, peanuts_crosswalk, angry_alarm_clock, krusty_krab_kitchen, doge_windows_hill, tube_dogs_hill.

See Also