@remark-embedder/transformer-oembed
Advanced tools
+1
-1
@@ -6,3 +6,3 @@ import type { Transformer } from '@remark-embedder/core'; | ||
| endpoints: Array<{ | ||
| schemes?: Array<string>; | ||
| schemes?: string[]; | ||
| discovery?: boolean; | ||
@@ -9,0 +9,0 @@ url: string; |
+2
-2
| { | ||
| "name": "@remark-embedder/transformer-oembed", | ||
| "version": "1.0.0", | ||
| "version": "1.0.1", | ||
| "publishConfig": { | ||
@@ -51,3 +51,3 @@ "access": "public" | ||
| "peerDependencies": { | ||
| "@remark-embedder/core": ">=1" | ||
| "@remark-embedder/core": "^1.0.0" | ||
| }, | ||
@@ -54,0 +54,0 @@ "eslintConfig": { |
+25
-17
@@ -22,11 +22,12 @@ <div align="center"> | ||
| You're using [`@remark-embedder/core`](https://github.com/remark-embedder/core) | ||
| to automatically convert URLs in your markdown to the embedded version of those | ||
| URLs and want to have a transform for providers that support an oEmbed API. | ||
| [Learn more about oEmbed from oembed.com](https://oembed.com) | ||
| You're using [`@remark-embedder/core`][@remark-embedder/core] to automatically | ||
| convert URLs in your markdown to the embedded version of those URLs and want to | ||
| have a transform for providers that support an oEmbed API. [Learn more about | ||
| oEmbed from oembed.com][oembed.com] | ||
| ## This solution | ||
| This is a `@remark-embedder` transform for supported oembed API providers. Find | ||
| the list of supported providers on [oembed.com](https://oembed.com). | ||
| This is a [`@remark-embedder`][@remark-embedder/core] transform for supported | ||
| oembed API providers. Find the list of supported providers on | ||
| [oembed.com][oembed.com]. | ||
@@ -64,8 +65,8 @@ ## Table of Contents | ||
| ```typescript | ||
| import remark from 'remark' | ||
| import html from 'remark-html' | ||
| import remarkEmbedder from '@remark-embedder/core' | ||
| import oembedTransformer from '@remark-embedder/transformer-oembed' | ||
| // or, if you're using CJS: | ||
| // or, if you're using CommonJS require: | ||
| // const {default: oembedTransformer} = require('@remark-embedder/transformer-oembed') | ||
| import remark from 'remark' | ||
| import html from 'remark-html' | ||
@@ -121,3 +122,3 @@ const exampleMarkdown = ` | ||
| ```javascript | ||
| ```typescript | ||
| // ... | ||
@@ -147,4 +148,4 @@ import type {Config} from '@remark-embedder/transformer-oembed' | ||
| That results in (notice the `data-` attributes which are specific to | ||
| [twitter's oEmbed API](https://developer.twitter.com/en/docs/twitter-api/v1/tweets/post-and-engage/api-reference/get-statuses-oembed)): | ||
| That results in (notice the `data-` attributes which are specific to [twitter's | ||
| oEmbed API][twitter-oembed-docs]): | ||
@@ -167,3 +168,3 @@ ```html | ||
| This could also be used to provide an access token for providers that require | ||
| this (like [Instagram](https://developers.facebook.com/docs/instagram/oembed/)). | ||
| this (like [Instagram][instagram-oembed-docs]). | ||
@@ -192,8 +193,8 @@ ### Config as a function | ||
| It's a long story... Check out the inspiration on | ||
| [`@remark-embedder/core`](https://github.com/remark-embedder/core) | ||
| [`@remark-embedder/core`][@remark-embedder/core] | ||
| ## Other Solutions | ||
| - [remark-oembed](https://npm.im/remark-oembed): This one requires client-side | ||
| JS to work which was unacceptable for our use cases. | ||
| - [`remark-oembed`][remark-oembed]: This one requires client-side JS to work | ||
| which was unacceptable for our use cases. | ||
@@ -227,3 +228,4 @@ ## Issues | ||
| <tr> | ||
| <td align="center"><a href="https://kentcdodds.com"><img src="https://avatars.githubusercontent.com/u/1500684?v=3" width="100px;" alt="Kent C. Dodds"/><br /><sub><b>Kent C. Dodds</b></sub></a><br /><a href="https://github.com/remark-embedder/transformer-oembed/commits?author=kentcdodds" title="Code">π»</a> <a href="https://github.com/remark-embedder/transformer-oembed/commits?author=kentcdodds" title="Documentation">π</a> <a href="#infra-kentcdodds" title="Infrastructure (Hosting, Build-Tools, etc)">π</a> <a href="https://github.com/remark-embedder/transformer-oembed/commits?author=kentcdodds" title="Tests">β οΈ</a></td> | ||
| <td align="center"><a href="https://kentcdodds.com"><img src="https://avatars.githubusercontent.com/u/1500684?v=3?s=100" width="100px;" alt=""/><br /><sub><b>Kent C. Dodds</b></sub></a><br /><a href="https://github.com/remark-embedder/oembed/commits?author=kentcdodds" title="Code">π»</a> <a href="https://github.com/remark-embedder/oembed/commits?author=kentcdodds" title="Documentation">π</a> <a href="#infra-kentcdodds" title="Infrastructure (Hosting, Build-Tools, etc)">π</a> <a href="https://github.com/remark-embedder/oembed/commits?author=kentcdodds" title="Tests">β οΈ</a></td> | ||
| <td align="center"><a href="https://michaeldeboey.be"><img src="https://avatars3.githubusercontent.com/u/6643991?v=4?s=100" width="100px;" alt=""/><br /><sub><b>MichaΓ«l De Boey</b></sub></a><br /><a href="https://github.com/remark-embedder/oembed/commits?author=MichaelDeBoey" title="Code">π»</a> <a href="https://github.com/remark-embedder/oembed/commits?author=MichaelDeBoey" title="Documentation">π</a></td> | ||
| </tr> | ||
@@ -267,2 +269,8 @@ </table> | ||
| [good-first-issue]: https://github.com/remark-embedder/transformer-oembed/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen+sort%3Areactions-%2B1-desc+label%3Aenhancement+label%3A%22good+first+issue%22 | ||
| [@remark-embedder/core]: https://github.com/remark-embedder/core | ||
| [instagram-oembed-docs]: https://developers.facebook.com/docs/instagram/oembed | ||
| [oembed.com]: https://oembed.com | ||
| [remark-oembed]: https://github.com/sergioramos/remark-oembed | ||
| [twitter-oembed-docs]: https://developer.twitter.com/en/docs/twitter-api/v1/tweets/post-and-engage/api-reference/get-statuses-oembed | ||
| <!-- prettier-ignore-end --> |
15843
3.93%269
3.07%