Advanced Slides

repository·main·Indexed 20 days ago

https://github.com/mszturc/obsidian-advanced-slides

An Obsidian plugin for creating, previewing, and exporting professional slide presentations using Markdown. Built on reveal.js, it integrates with the Obsidian ecosystem and supports various reveal.js plugins including Chalkboard for drawing, custom controls, menu systems, and Chart.js integration for data visualization.

Tokens
48K
Snippets
154
Records
243
Agent score
77%

What's inside obsidian-advanced-slides

  1. Overview of Advanced Slides for Obsidian

    main

    Advanced Slides is an Obsidian extension designed to transform your Markdown notes into professional slide decks. It leverages reveal.js to provide a presentation experience directly within Obsidian.

    Key Capabilities:

    • Markdown Integration: Full support for Obsidian's Markdown syntax, allowing you to embed your existing notes into slides.
    • Live Preview: View changes to your slides in real-time while editing the Markdown source.
    • Customization: Use themes to modify the visual appearance and annotations to adjust styles.
    • Export Options: Export your presentations as PDF documents or standalone HTML presentations.
  2. Structure of a reveal.js theme SCSS file

    main

    A theme file must follow a specific four-step sequence to ensure variables and mixins are correctly applied. The order of operations is:

    1. Include mixins: Import /css/theme/template/mixins.scss for shared utility functions.
    2. Include settings: Import /css/theme/template/settings.scss. This declares the custom variables required by the template. You can override these variables in the next step.
    3. Override: Define your custom styles. This includes overriding variables from settings.scss or adding custom CSS selectors and styles.
    4. Include template: Import /css/theme/template/theme.scss. This template file generates the final CSS output based on the variables and styles defined in the previous steps.
  3. Define slide titles for the menu

    main

    The menu generates titles for slides using the following priority:

    1. data-menu-title attribute: Use <section data-menu-title="My Title">.
    2. .menu-title class: Use an element with the class menu-title inside the section.
    3. titleSelector: The plugin selects the first element matching the titleSelector option (default: headings).
    4. Fallback: If no title is found, it uses the slide number (e.g., 'Slide 12'), unless hideMissingTitles: true is set.
  4. How slide templates work in Advanced Slides

    main

    Slide templates allow you to define unique layouts and structures that can be reused across a presentation, reducing boilerplate code.

    Core Concepts:

    • Template Files: Templates are regular .md notes stored anywhere in your Obsidian vault.
    • Variables: Templates use <% variable_name %> syntax to define placeholders.
    • Content Variable: Every template must contain a <% content %> variable, even if it is not explicitly used, to receive the main slide content.
    • Data Injection: You populate template variables from your slide note using block comments (e.g., ::: variable_name ... :::).
    • Optional Variables: By default, if a variable is defined in a template but not provided in the slide, dummy text is displayed. To make a variable truly optional (where the markup is hidden unless the variable is provided), append a ? to the variable name in the template (e.g., <%? footer %>).
  5. Define slides using horizontal and vertical delimiters

    main

    To create a slideshow within a single Markdown file, use specific delimiters to separate slides. This project supports both horizontal and vertical slide navigation:

    • Horizontal Slides: Use three dashes (---) to denote the start of a new horizontal slide.
    • Vertical Slides: Use three underscores (___) to denote the start of a vertical slide (typically used to present sub-information below a top-level horizontal slide).

    By combining these, you can create complex navigation structures.

  6. Use the Grid component for slide layouts

    main

    The <grid> tag allows you to layout slide content in specific parts using a drag-and-drop mental model. You define the size of a content block with drag and its position with drop.

    Basic Syntax: <grid drag="width height" drop="x y">

    • drag: Defines the width and height of the area. If omitted, it defaults to 50 100.
    • drop: Defines the position. Values are percentages by default; append px for pixel sizes.

    Coordinate System for drop:

    • Positive x: Relative to the left edge.
    • Negative x: Relative to the right edge.
    • Positive y: Relative to the top edge.
    • Negative y: Relative to the bottom edge.
    <grid drag="60 55" drop="5 10" bg="red">
    60 x 55
    </grid>
  7. How Multiplex works for synchronized presentations

    main

    The Multiplex plugin allows a 'Master' presentation to control multiple 'Client' presentations in real time. As the presenter navigates slides on the Master, all connected Clients update automatically. This requires three components:

    1. Master presentation: The controller, ideally served from a local machine to ensure stability if internet fails.
    2. Client presentations: The audience view, served from a publicly accessible static file server (e.g., GitHub Pages, S3).
    3. Socket.io server: A central hub that receives slideChanged events from the Master and broadcasts them to the Clients.

    You must generate a unique secret and id pair from your Socket.io server's token endpoint (e.g., http://your-server.com/token) to link the presentations.