Skip to content

Commit

Permalink
embed -> embedio
Browse files Browse the repository at this point in the history
  • Loading branch information
coatless committed Feb 8, 2024
1 parent 2f27bd0 commit 23a389d
Show file tree
Hide file tree
Showing 11 changed files with 164 additions and 20 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/.luarc.json
*_site
30 changes: 15 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
# Quarto Extension Development with Lua in a Devcontainer

This repository houses a devcontainer that setups a [Quarto extension development environment](https://quarto.org/docs/extensions/lua.html). The container is setup to work with [GitHub Codespaces](https://github.com/features/codespaces) to instantly have a cloud-based developer workflow.
The `embedio` shortcode extension allows you to incorporate different file types into Quarto HTML documents by using Quarto's shortcode mechanism.

You can try out the Codespace by clicking on the following button:

[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/coatless-devcontainer/quarto-extension-dev?quickstart=1)
[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/coatless-quarto/embedio?quickstart=1)

**Note:** Codespaces are available to Students and Teachers for free [up to 180 core hours per month](https://docs.github.com/en/education/manage-coursework-with-github-classroom/integrate-github-classroom-with-an-ide/using-github-codespaces-with-github-classroom#about-github-codespaces) through [GitHub Education](https://education.github.com/). Otherwise, you will have [up to 60 core hours and 15 GB free per month](https://github.com/features/codespaces#pricing).
## Installation

The devcontainer contains:
To install the `embedio` shortcode extension, follow these steps:

- The latest [pre-release](https://quarto.org/docs/download/prerelease) version of Quarto.
- [Quarto VS Code Extension](https://marketplace.visualstudio.com/items?itemName=quarto.quarto).
- [Lua LSP VS Code Extension](https://marketplace.visualstudio.com/items?itemName=sumneko.lua) for Lua code intelligence.
- [GitHub copilot VS Code Extension](https://marketplace.visualstudio.com/items?itemName=GitHub.copilot).
- `R` and `Python`
- `knitr` and `jupyter`
1. Open your terminal.

## References
2. Execute the following command:

- [Quarto: Lua API Reference](https://quarto.org/docs/extensions/lua-api.html)
- [Quarto: Lua Development](https://quarto.org/docs/extensions/lua.html)
- [Pandoc: Lua Filters](https://pandoc.org/lua-filters.html)
- [Lua: Manual](https://www.lua.org/manual/5.4/)
```bash
quarto add coatless-quarto/embedio
```

This command will download and install the shortcode extension under the `_extensions` subdirectory of your Quarto project. If you are using version control, ensure that you include this directory in your repository.

## Usage

Add more details
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: embed
name: embedio
title: Embedded different kinds of files
author: James Joseph Balamuta
version: 0.0.0-dev.1
quarto-required: ">=1.4.0"
quarto-required: ">=1.4.549"
contributes:
shortcodes:
- countdown.lua
- embedio.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
return {

["embed-pdf"] = function(args, kwargs, meta)
["pdf"] = function(args, kwargs, meta)

-- Supported options for now
local pdf_file_name = pandoc.utils.stringify(kwargs["file"])
Expand Down
1 change: 1 addition & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/.quarto/
1 change: 1 addition & 0 deletions docs/_extensions
34 changes: 34 additions & 0 deletions docs/_quarto.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
project:
type: website

website:
title: "embedio"
reader-mode: true
repo-url: https://github.com/coatless-quarto/embedio/
repo-actions: [edit, issue]
sidebar:
style: "floating"
search: true
tools:
- icon: github
href: https://github.com/coatless-quarto/embedio/
contents:
- text: "Home"
file: index.qmd
- section: "Demos"
contents:
- text: "PDF"
href: qembedio-embed-pdf.qmd
- text: "HTML"
- text: "Audio"
- text: "Maps"
- text: "Social"
- section: "Support"
contents:
- text: "FAQ"
href: qembedio-faq.qmd
- text: "Submit an issue"
href: https://github.com/coatless-quarto/embedio/issues/new/choose
- section: "Extra"
contents:
- qembedio-release-notes.qmd
5 changes: 5 additions & 0 deletions docs/index.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
title: "Home"
---

The `embedio` shortcode extension allows you to incorporate different file types into Quarto HTML documents by using Quarto's shortcode mechanism.
14 changes: 14 additions & 0 deletions docs/qembedio-embed-pdf.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
title: "Embed PDF"
---

The `pdf` short code generates an embedded PDF object for HTML websites. You can use it with:

```{=markdown}
{{< pdf file="assets/test.pdf" >}}
```

For example, we can show the `test.pdf` with:

{{< pdf file="assets/test.pdf" >}}

70 changes: 70 additions & 0 deletions docs/qembedio-faq.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
---
title: "Frequently Asked Questions"
date: "02-06-2024"
date-modified: last-modified
engine: markdown
format:
html:
toc: true
---

# General Information

## What is the embedio shortcode extension for Quarto?

The `embedio` short code extension for Quarto is a tool designed to improve the embedding experience of various file types within various Quarto HTML formats. It focuses on seamlessly integrating HTML slides, PDFs, audio files, and more, providing users with a versatile and enriched content embedding experience.

# Installation

## How do I install the embedio shortcode Extension?

See the [home page](index.qmd) for details.

## Is the embedio shortcode extension compatible with all Quarto versions?

The `embedio` short code extension requires Quarto v1.4.549 or later.

# Supported File Types

## What file types does the embed shortcode extension for Quarto support for embedding?

The embed shortcode extension for Quarto supports a wide range of file types, including but not limited to HTML slides, PDFs, audio files, and more. Refer to the documentation for a comprehensive list of supported file types.

## Can I embed interactive content with the embed shortcode extension for Quarto?

Yes, the embed shortcode extension for Quarto enables the embedding of interactive content, such as HTML slides with dynamic elements. Explore the documentation for details on incorporating interactive features into your embedded content.

# Usage and Customization:

## How do I embed an HTML slide using the embedio shortcode extension for Quarto?

Embedding an HTML slide is straightforward. Please use:

```{=markdown}
{{< embed-slides file="path-to-slides" >}}
```


# Troubleshooting

## I'm encountering issues with embedding files. What should I do?

If you're experiencing difficulties with file embedding, first ensure that your Quarto project has the `embedio` shortcode extension installed by looking in the `_extensions` folder.

Next, make sure that the resource is specified in the `resources` key under the publishing format:

```yaml
---
title: Example resource inclusion
format:
html:
resources:
- path/to/file.pdf
---
```

## Are there known compatibility issues with certain browsers?

The are no known compatible with major browsers. However, if you encounter issues, please feel free to raise them in the project's issue tracker and consider updating your browser to the latest version.

For additional support, bug reports, or feature requests, please visit the embed shortcode extension for Quarto community forum or contact our support team through the official channels outlined in the documentation.
18 changes: 18 additions & 0 deletions docs/qembedio-release-notes.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
title: "Release Notes"
date: "02-07-2024"
date-modified: last-modified
engine: markdown
format:
html:
toc: true
---


# 0.0.0-dev.1: ??? (??-??-??) [DEV]

## Features

- `embed` shortcode options to add different pieces of content to Quarto HTML websites, documents, and books.
- `embed-pdf`: Include a PDF
- `embed-slides`: Include HTML based slides

0 comments on commit 23a389d

Please sign in to comment.