Iframe - triplecanopy/b-ber GitHub Wiki

Iframe

Iframes can be added to a project using either the iframe or iframe-inline directives.

Directives

The b-ber iframe element must be declared with an id and source attribute. The source attribute should be the URL of the remote resource. The iframe can also include a poster attribute which points to an image in the _project/_images directory.

Iframe

::: iframe:my-id source:https://example.com poster:my-placeholder.jpg

Iframe-inline

The iframe-inline directive, when rendered into XHTML, will add the iframe directly into the flow of the project.

::: iframe-inline:my-id source:https://example.com

Supported attributes

The iframe directive supports all of the same attributes as the HTML Iframe element.

Note: Using the src attribute will conflict with b-ber's file management. Do not use that attribute.

Markdown extensions

The iframe directive also supports an optional caption. Captions are added by enclosing a line of text within two colons directly underneath the iframe.

Samples

::: iframe:my-id source:https://example.com
:: Here is the *caption* for my iframe.<br/>Inline HTML is also supported here.
::

Epub support

Adding iframes in Epubs is not allowed according to the Epub spec. Durin the Epub build, b-ber will replace the iframe element with placeholder text.

⚠️ **GitHub.com Fallback** ⚠️