Skip to content

Commit

Permalink
Add audio example
Browse files Browse the repository at this point in the history
  • Loading branch information
coatless committed Apr 22, 2024
1 parent ca57ae9 commit 376bd5e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions _extensions/embedio/audio.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ local function audio(args, kwargs, meta)

if not quarto.doc.is_format("html") then
return
end
end

-- Start of HTML tag
local htmlTable = {"<figure "}
Expand Down Expand Up @@ -57,7 +57,7 @@ local function audio(args, kwargs, meta)

-- Add download link if provided
if download == "true" then
table.insert(htmlTable, '<a href="' .. input ..'"> Download audio </a>')
table.insert(htmlTable, '<br /><a href="' .. input ..'"> Download audio </a>')
end

-- Add closing figure tag
Expand Down
Binary file added docs/assets/my-audio.mp3
Binary file not shown.
6 changes: 3 additions & 3 deletions docs/qembedio-embed-audio.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ title: "Embed Audio"
The `audio` short code generates an embedded audio object for HTML websites. You can use it with:

```markdown
{{{< audio file="assets/test.mp3" >}}}
{{{< audio file="assets/my-audio.mp3" download="true">}}}
```

For example, we can show the `test.mp3` with:
For example, we can embed the `my-audio.mp3` in the `assets/` with:

{{< audio file="assets/test.mp3" >}}
{{< audio file="assets/my-audio.mp3" download="true" >}}

## Options

Expand Down

0 comments on commit 376bd5e

Please sign in to comment.