Skip to content

Documentation for embeds #59

@jon-dez

Description

@jon-dez

This is not an issue; this is documentation.

Formatting an embed

![[<embed_arguments>]]

There are three embed_arguments, and they must appear in the order listed below. Each argument must be separated by the pipe character |.

  • Required: <tldraw_markdown_file>: This must be a valid tldraw file you created.
  • Optional: <alt_text>: Controls the appearance of the tldraw file
  • Optional: <embed_size>: Controls the size of the embed without affecting the tldraw file bounds

Thus, we have the following configurations possible:

![[<tldraw_markdown_file>]]

![[<tldraw_markdown_file>|<alt_text>]]

![[<tldraw_markdown_file>|<embed_size>]]

![[<tldraw_markdown_file>|<alt_text>|<embed_size>]]

Do not include the < and > brackets in the arguments

Using <alt_text>

  • size, pos, showBg, page fields are available to use in the "alt" text of the embed,
  • size=<width>,<height>: Sets the bounds of the embed within the tldraw file
  • pos=<x_offset>,<y_offset>: Sets the position to start the embed within the tldraw file
  • pos field is optional when size is provided
  • showBg=<value>: Controls whether to show the solid color background of the tldraw file
    • <value> is either yes, no, true, or false
  • page=<pageId> see comment
  • separate each field with ;, e.g. size=1280,720;pos=500,20;showBg=yes

Example:

If you have an embed called my-embed.md you could do ![[my-embed.md|pos=525,185;size=100,120]] where the "alt" text is pos=525,185;size=100,120. Note that there is a semicolon separating the two fields.

Using <embed_size>

  • <width>x<height>

Example:

If you have an embed called my-embed.md you could do ![[my-embed.md|200x100]]. Note that there is an x separating the two numbers.

Feature demos

Live updates

Screencast.from.2024-10-13.08-40-46.mp4

Set embed size

Screencast.from.2024-10-13.08-53-12.mp4

Set bounds on embed

Automatically via the interactive mode

Screencast.From.2024-11-11.17-39-36.mp4

Manually setting bounds

  1. Show embed menu and enter interactive mode (right click or tap and hold on mobile)
  2. Adjust the embed
  3. Exit interact mode
  4. Show embed menu and select "Copy bounds"
  5. Paste into the alt text portion of the embed link
Screencast.from.2024-10-13.08-54-40.mp4

Control showing the background of an embed

Screencast.from.2024-10-13.09-44-25.mp4

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions