NIHR logo HSMA logo - Learn, Apply, Implement
HSMA logo
NIHR logo

Module x ‘I want to do a thing, and use this to achieve something’

Session 0A: A session about a thing

Session Lead, Coauthors

A spectacular pun

QR code linking to these slides

Get the slides

Section Example

This deck’s slide content can be split into separate _SECTION_*.qmd files at the project root and pulled into slides.qmd with {{< include >}} – see the top of slides.qmd for how this file is wired in, and the “Fast iteration on a single section” note in README.md for how to preview a section like this one on its own.

Here’s a sample slide

You can see that while there are a few quirks, the separate slides can display primarily as they will in the final deck.

Section Header Example

Your Content Here

Slide Example

This is a slide with some text on it.

Code Examples

Defining code snippets in the qmd file

import plotly.express as px

px.scatter(x=[1,2,3], y=[2,3,4])

Defining and running code snippets in the qmd file

import plotly.express as px
import plotly.io as pio
pio.renderers.default = "notebook"

px.scatter(x=[1,2,3], y=[2,3,4], height=400)

Including just the output

Importing code snippets from files

print("Never gonna give you up")

Importing and running code snippets

print("Never gonna give you up")
Never gonna give you up

Embedded Streamlit

Layouts

2 col layout example

Here is column 1

Here is column 2

Incremental list reveal

This will be on the screen at the start.

  • Here’s bullet point 1
  • Here’s bullet point 2

Fragments

This will be on the screen at the start.

This won’t appear until you press a button.

Then this will appear when you’re ready.

Simple boxes 1

Value boxes

A simple value box can help convey points, especially when combined with fragments.

Complex icon box layouts with index parameter

Left Column

This appears SECOND (Index 2)

Right Column

This appears FIRST (Index 1)

Other features

Speaker notes

There are some speaker notes on this slide - but you can’t see them unless you’re in speaker view!

No box

Use the {.no-box} syntax next to your slide title to remove the background grey box.

This only works on second level slides - not # level slides.

Simple boxes 2

Value boxes

A simple value box can help convey points, especially when combined with fragments.

Value boxes

Like this!

Icon boxes

And here’s a more advanced type of box with an icon

Big text

And here’s a more advanced type of box with an icon and a value

And one without an icon

Complex icon box layouts with index parameter

Left Column

This appears SECOND (Index 2)

Right Column

This appears FIRST (Index 1)

Fade-in-then-out-lists

You can use the {.focus-list} div to auto fade in and out as you move through a list

  • First important point
  • Second important point (previous one dims!)
  • Third important point

Fade-in-then-out-lists

This works with indented lists too

  • First important point
    • And a sub-point on that matter
  • Second important point (previous one dims!)
    • And a sub-point on that matter
      • … and a really nested point
  • Third important point

Code focus

Using reunings code focus extension, we can highlight different parts of a code example.

answer = "42"
question = "What is the answer to life, the universe, and everything?"
print(f"Question: '{question}'\n Answer: '{answer}'")

When this fragment is shown, the first line of code will have the focus class added to it and it gets highlighted.

Then this line when we move through

Live code example

Custom title slide layout

The title slide (the very first slide of the deck) is generated from the title-slide.html partial and styled by title-slide.scss. It is driven entirely by YAML frontmatter keys — see the top of this file for the values used to build this deck’s title slide:

  • title, subtitle — the module/session text
  • author — as before; the author name is coloured via $hsma-title-author-color
  • tagline — short strapline, coloured via $hsma-title-tagline-color
  • partner-logo / partner-logo-alt — a logo shown on a white plate, top-right

Custom title slide layout (continued)

  • title-image — a small image/GIF (or video:) shown above the title text
  • title-media-a — a single image/video panel, top-left of the slide (position: right moves it under the partner logo; bare: true drops its shadow box)
  • title-countdown — a timer, top-left: true = 10 minutes, or give minutes / "m:ss"
  • title-media — a list of image/video panels, bottom-right of the slide
  • title-box-image — an image just above the title box, matching its width (image:/alt:, or placeholder: true)
  • title-video — a video panel, bottom-right: youtube: (video ID) or video: (file); no-controls: true hides the player UI; placeholder: true shows an empty box

Custom title slide layout (continued)

  • splash — adds a slide before the title slide with just logos over the banner (optional background: overrides the title slide’s background); each logo takes an optional position: (e.g. top-centre, bottom-right) and height:
  • title-audio — src: (and optional loop: true) for audio that starts when the title slide is shown and stops when you move off it
  • partner-logo-plate — none or dark for white logos that vanish on the white plate
  • qr-code — QR code to the hosted deck: auto works out the GitHub Pages URL, or give a URL (optional qr-code-caption:)

Every key is optional. Leave all of them out and the title slide falls back to the original centred title/author layout.

Each media slot accepts either image: (works for GIFs too) or video: (plus optional poster: and autoplay: true).

Custom Title Slide - Escape hatch

If a deck needs a hand-built title slide instead of the generated one, add data-visibility: hidden to title-slide-attributes to hide the generated slide, then reuse the same styling on a normal slide with the .hsma-title class and the .hsma-ts-* slot classes shown below:

::: {.hsma-title}

::: {.hsma-ts-text}
# My Custom Title
:::

:::