Astlide API Reference
    Preparing search index...

    Interface AstlideOptions

    interface AstlideOptions {
        csp?: string | boolean;
        drawings?: DrawingsOption;
        favicon?: string | false;
        font?: FontOption;
        indexable?: boolean;
        injectIndexRoute?: boolean;
        notes?: "dev" | "public";
        plugins?: AstlidePlugin[];
        shikiTheme?: string;
        slideDecorators?: string[];
        slideScripts?: boolean;
        templates?: string | Record<string, string> | TemplateStore;
        toolbar?: ToolbarItem[];
    }
    Index
    csp?: string | boolean

    Content-Security-Policy configuration.

    • true (default): inject a sensible default CSP meta tag
    • false: disable CSP entirely
    • string: use a custom CSP policy string

    In a build, the default policy allows inline scripts by hash, not 'unsafe-inline': after astro build, the inline <script>s Astlide and Astro put on each page, and those of MDX slides and their components (code), are hashed into its script-src. Inline scripts in Markdown, HTML and PowerPoint slides are not (see slideScripts), nor are inline event-handler attributes or javascript: URLs — those don't run. style-src keeps 'unsafe-inline' for style attributes. A custom policy string is used as is.

    During astro dev, scripts stay on 'unsafe-inline', and worker-src 'self' blob: is added (unless the policy sets worker-src) so Vite's client can reconnect after a server restart.

    drawings?: DrawingsOption

    Pen drawings (d).

    • persist (default false): keep drawings in the browser's localStorage, so they survive reloads and come back the next time the deck is opened in the same browser. Off by default so annotations from one talk don't reappear in the next. c clears the current slide, Shift+C the whole deck.
    astlide({ drawings: { persist: true } })
    
    favicon?: string | false

    Favicon for deck pages and the deck index.

    • omitted: favicon.svg, favicon.ico or favicon.png from public/, if present; otherwise an empty icon, so browsers don't request /favicon.ico at the domain root (a 404 when deployed under a sub-path).
    • string: a root-relative path (Astro's base is added) or a URL.
    • false: no favicon link.
    astlide({ favicon: '/logo.png' })
    
    font?: FontOption

    Web font injection. Astlide injects a <link> to Google Fonts' Inter (text) and JetBrains Mono (code) by default so the built-in themes have a sane fallback. Override or disable:

    • false: do not inject any font stylesheet (use what your CSS specifies).
    • string: the href of a stylesheet — Astlide also preconnects the origin.
    • object: fine-grained control.
    astlide({ font: false })  // disable
    astlide({ font: 'https://fonts.googleapis.com/css2?family=IBM+Plex+Sans&display=swap' })
    indexable?: boolean

    Allow search engines to index the deployed slide deck. When false (default), a <meta name="robots" content="noindex, nofollow"> tag is injected. Set to true if you want the deck to be publicly discoverable.

    injectIndexRoute?: boolean

    Whether to inject Astlide's deck-index page at /.

    • unset (default): auto — inject only when you don't already have a src/pages/index.{astro,md,mdx,html}, so a custom home page never collides with the built-in index (a route collision is a hard error in future Astro).
    • false: never inject — you provide your own /.
    • true: always inject, even alongside your own index page.
    notes?: "dev" | "public"

    Where speaker notes are included.

    • "dev" (default): while running astro dev, and in the build astlide export makes (so PowerPoint exports keep them). Pages you build with astro build and deploy carry no notes; the presenter window of a deployed deck says so.
    • "public": in every page, built ones too — to present from the deployed site with notes. Anyone with the deck's URL can then read them (press n, open ?presenter, view source).
    astlide({ notes: "public" })
    
    plugins?: AstlidePlugin[]

    Astlide plugins. Each plugin can contribute themes, layout names, transition names, and Shiki languages/themes. Built-in themes/layouts/transitions are always registered.

    shikiTheme?: string

    Shiki syntax highlighting theme. Default: 'github-dark'

    slideDecorators?: string[]

    Components rendered on every slide, after the slide content — for common chrome like a logo, footer, page number, or back-to-index link, without hand-placing it in each MDX/HTML file.

    Each string is a component module specifier (resolved as a Vite import). Components can read the current slide's metadata via getDeckContext(Astro) from @astlide/core/context. Equivalent to a plugin's decorators.

    astlide({ slideDecorators: ['./src/components/DeckFooter.astro'] })
    
    slideScripts?: boolean

    Let <script>s, inline event handlers (onclick …) and javascript: URLs in Markdown, HTML and PowerPoint slides run — in astro dev and in built pages, where their hashes join the default CSP. Default false: they are removed when the slide is rendered (and the CSP wouldn't allow them either), because slide content can come from others (an imported .pptx, an HTML slide someone sent), and in astro dev such a script would run next to the slide editor. MDX slides are code and always keep their scripts. Turn it on only for decks whose content you fully trust; for a script you want on your slides, prefer an MDX slide or a component.

    templates?: string | Record<string, string> | TemplateStore

    PowerPoint templates as themes: theme name → a .pptx / .potx / .thmx file (project-relative; for Google Slides, File → Download → PowerPoint). Decks with "theme": "<name>" in _config.json get the template's colors, fonts and per-layout backgrounds and artwork, and their content goes where the template's placeholders are — the first heading into the title, the rest into the body.

    The built-in layouts map to the template's: cover → its title slide, section → section header, default → title and content, two-column → two content. Every template layout is also available by its name, as a slug (slideLayout: comparison, slideLayout: title-only …).

    Or a template store (see @astlide/core/templates): its location — a folder, s3://, gs:// or azure://<bucket>/<prefix> — or the store itself. Every stored template is then a theme of its name, in its latest version, read when the server starts or the site builds. In dev, a folder store is watched and the server restarts when a template changes; for a bucket, restart the dev server.

    astlide({ templates: { brand: './templates/brand.pptx' } })
    astlide({ templates: 's3://acme-assets/astlide/templates' })
    toolbar?: ToolbarItem[]

    Bottom navigation toolbar composition.

    Provide an ordered list of action IDs to render in the floating .slide-nav. Built-in actions: home prev counter next notes overview goto draw laser camera record presenter fullscreen print share

    goto opens the go-to-slide dialog (also bound to g): jump by slide number or search slide titles.

    draw (d) toggles a pen over the slide (c clears the current slide's drawing) and laser (l) a laser pointer. Both are mirrored between the presenter and audience windows.

    camera (v) shows your webcam in a draggable bubble; record (r) records a screen / tab of your choice plus the microphone and downloads a .webm when stopped. Both need https or localhost.

    home links back to the deck index (/) and is always reachable — the toolbar reveals on hover, keyboard focus, and stays visible on touch devices.

    download (in-browser PDF export) is experimental: it depends on the pre-1.0 optional @astlide/crispdf and its output may change. Prefer the astlide export CLI for stable output.

    Default: ['prev', 'counter', 'next'] (original behavior).