{"id":49703117,"url":"https://github.com/mlava/shortcode-embeds","last_synced_at":"2026-05-08T08:13:33.818Z","repository":{"id":78624666,"uuid":"527412581","full_name":"mlava/shortcode-embeds","owner":"mlava","description":null,"archived":false,"fork":false,"pushed_at":"2026-02-01T23:27:13.000Z","size":24,"stargazers_count":2,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-02T08:57:35.328Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mlava.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-08-22T04:37:38.000Z","updated_at":"2026-02-01T23:27:16.000Z","dependencies_parsed_at":null,"dependency_job_id":"7d3bd58a-91bc-4198-8208-7efd8560c18f","html_url":"https://github.com/mlava/shortcode-embeds","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mlava/shortcode-embeds","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mlava%2Fshortcode-embeds","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mlava%2Fshortcode-embeds/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mlava%2Fshortcode-embeds/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mlava%2Fshortcode-embeds/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mlava","download_url":"https://codeload.github.com/mlava/shortcode-embeds/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mlava%2Fshortcode-embeds/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32772219,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-08T02:36:36.067Z","status":"ssl_error","status_checked_at":"2026-05-08T02:36:07.210Z","response_time":54,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-05-08T08:13:32.438Z","updated_at":"2026-05-08T08:13:33.813Z","avatar_url":"https://github.com/mlava.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Shortcode Embeds\n\nPaste a link, Mermaid code, or Excalidraw JSON from your clipboard and get a Roam-friendly embed inserted into the focused block.\n\nThis extension is intentionally simple: it reads your clipboard, detects what you pasted, and replaces the focused block with the appropriate embed (or inserts child blocks for batches). After inserting, it also creates a new empty sibling block so the page remains easy to edit.\n\n## Commands\n\nAll commands are available in the Command Palette and can be bound in Settings \u003e Hotkeys.\n\n- Paste Embed from clipboard (auto)\n  - Detects the content type and chooses the best embed format.\n- Paste Embed from clipboard (as link)\n  - Forces a markdown link: `[url](url)`.\n- Paste Embed from clipboard (as iframe)\n  - Forces `{{iframe: url}}`.\n\n## What gets detected\n\n### Structured content\n\n- Mermaid code (fenced or plain text; literal `\\n` sequences are normalized)\n  - Inserts a `{{mermaid}}` parent and child lines.\n- Excalidraw JSON (from a .excalidraw file)\n  - Inserts a `{{excalidraw}}` block with the scene data in block props.\n\n### URLs (auto mode)\n\nThe following are recognized and converted to the preferred Roam embed where possible:\n\n- YouTube videos and Shorts -\u003e `{{youtube: url}}`\n- YouTube playlists -\u003e `{{iframe: https://www.youtube.com/embed/videoseries?...}}`\n- Vimeo -\u003e `{{[[video]]: url}}`\n- TikTok -\u003e `{{iframe: ...}}`\n- Instagram -\u003e `{{iframe: ...}}`\n- Pinterest -\u003e `{{iframe: ...}}`\n- Wikipedia -\u003e mobile Wikipedia iframe\n- Google Docs/Sheets/Slides -\u003e `/preview` iframe\n- Google Drive file preview -\u003e iframe\n- Loom -\u003e iframe\n- SoundCloud -\u003e oEmbed iframe (with fallback)\n- Google Maps -\u003e iframe\n- Twitch clips/videos -\u003e iframe (parent=roamresearch.com)\n- CodePen, JSFiddle -\u003e iframe\n- Excalidraw links -\u003e iframe\n- Figma/FigJam -\u003e iframe via official embed URL\n- GitHub blob URLs -\u003e rewritten to raw file URLs (so file handlers can apply)\n- Medium, Substack, SlideShare -\u003e iframe (best-effort)\n- Reddit -\u003e redditmedia embed\n- Audio files -\u003e `{{[[audio]]: url}}`\n- Video files -\u003e `{{[[video]]: url}}`\n- Images -\u003e `![](url)`\n- PDF files -\u003e `{{pdf: url}}`\n- Generic oEmbed via noembed.com (late-stage fallback)\n- Final fallback -\u003e `{{iframe: url}}`\n\n## Settings\n\nYou can configure these in the Roam Depot settings panel for the extension.\n\n- Preserve original block text\n  - When enabled, existing text in the focused block is moved into a child block before inserting the embed.\n  - Default: on.\n- Allow third-party oEmbed\n  - When enabled, the extension may call third-party oEmbed providers (e.g. SoundCloud oEmbed and noembed.com) to resolve richer embeds.\n  - Default: off.\n- Allow oEmbed in batch paste\n  - When enabled, batch pastes may call third-party oEmbed providers. This can be slower.\n  - Default: off.\n\n## Examples\n\n### Mermaid (fenced)\n\nPaste this into your clipboard, then run the auto command:\n\n```mermaid\nflowchart TD\n  A[Start] --\u003e B{Decision}\n  B --\u003e|Yes| C[Do thing]\n  B --\u003e|No| D[Stop]\n```\n\n### Mermaid (plain)\n\n```\nflowchart LR\n  A --\u003e B\n```\n\n### Excalidraw\n\nCopy the entire JSON from a `.excalidraw` file, then run the auto command.\n\nMinimal example:\n\n```json\n{\n  \"type\": \"excalidraw\",\n  \"version\": 2,\n  \"source\": \"https://excalidraw.com\",\n  \"elements\": [],\n  \"appState\": {\"viewBackgroundColor\": \"#ffffff\"},\n  \"files\": {}\n}\n```\n\n## Batch behavior\n\nIf the clipboard contains multiple URLs:\n\n- The focused block is set to `Embedded Links`.\n- Each URL is inserted as a child block (embed or link).\n- There is a cap of 20 URLs per paste to protect performance. If more are found, the extension uses the first 20 and shows a toast.\n- A new empty sibling block is created after insertion.\n\n## Limitations and notes\n\n- A focused block is required. The extension will warn if no block is focused.\n- The focused block is preserved by default. You can disable \"Preserve original block text\" if you prefer the original overwrite behaviour.\n- If preservation fails (for example due to a transient Roam API error), the paste is cancelled to avoid data loss.\n- After insert, the extension creates a new empty sibling block to keep the page editable.\n- Clipboard access depends on browser permissions.\n- Some sites block iframes; those embeds may not render.\n- Mermaid rendering uses Roam's bundled Mermaid (observed version 11.0.3 as of Jan 31, 2026). Newer Mermaid-only syntax may not render.\n- oEmbed requests (SoundCloud/noembed) are network calls and can fail; fallbacks are used where possible.\n- Google Maps short links (`maps.app.goo.gl`) may be resolved via a quick network request before embedding.\n- Privacy note: third-party oEmbed is off by default. When enabled, SoundCloud and noembed.com are contacted to resolve embeds, which may expose the URL being embedded to those services.\n\n## Suggestions / Requests\n\nIf you want a new URL type handled, open an issue or PR with:\n- a sample URL\n- the desired Roam shortcode (if known)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmlava%2Fshortcode-embeds","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmlava%2Fshortcode-embeds","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmlava%2Fshortcode-embeds/lists"}