Appearance
Leaf
A leaf schema is a self-closing schema with no primary attribute. They are typically used to render HTML tags that are supposed to be self-closing and use attributes as a way to make the so special things.
The ones that fall into this category are.
- source
- hr
- br
- track
- img
- wbr
iframe
You can use an iframe as well it's a tag that allows you to display a website inside of another website. It's a Leaf Schema with the following attributes.
md
{% iframe
src="https://forastro-docs.onrender.com/libraries/utilities/content-collection-helpers"
/%}| attribute | type | required |
|---|---|---|
| src | SourceAttribute | true |
| allow | AllowAttribute | false |
Allow Attribute
The AllowAttribute is an attribute that looks for and object with types trequired are one or more of the following words.
- camera
- display-capture
- fullscreen
- gamepad
- geolocation
- microphone
- web-share
The values of each property must be either
- A "*".
- A string that starts with either
'src'or'self'and ends with a http url.
Beware
src and self must be written with quotes,
It will then transform that object into a string that places all types and required side by side.
This code will transform
md
{% iframe
allow={
camera:"'src' http://example.com"
microphone:"'src' http://example.com"
}
/%}into this code.
html
<iframe
allow="camera 'src' http://example.com microphone 'src' http://example.com"
/>| attribute | type | required | matches |
|---|---|---|---|
| name | SourceAttribute | false | |
| loading | String | false | eager lazy |
| sandbox | String | false | allow-top-navigation-to-custom-protocols allow-top-navigation-by-user-activation allow-top-navigation allow-scripts allow-same-origin allow-popups-to-escape-sandbox allow-popups allow-pointer-lock allow-orientation-lock allow-modals allow-forms allow-downloads |
| width | IntegerAttribute | false | |
| height | IntegerAttribute | false |
img
A schema that allows the use of the img tag in Markdoc.
md
{%img src="flower.jpg" /%}This schema has supports the following global attributes.
track
A schema that allows the use of the track tag in Markdoc.
md
{% video %}
{%track src="/media/examples/friday.vtt" /%}
{% /video %}md
{% audio %}
{%track src="track.mp4" /%}
{% /audio %}| attribute | type | required | reference | matches |
|---|---|---|---|---|
| src | true | |||
| srclang | Boolean | false | lang | |
| default | Boolean | false | ||
| label | String | false | ||
| kind | String | false | captions chapters descriptions metadata subtitles |
wbr
This schema allows wbr tags to be rendered in markdoc.
md
{% wbr /%}br
This schema allows br tags to be rendered in markdoc.
md
{% br /%}hr
This schema allows hr tags to be rendered in markdoc.
md
{% hr /%}