Skip to main content

贡献你自己的演示

使你的自定义演示文稿可以在 @remotion/transitions 包中被他人访问。

🌐 Make your custom presentation accessible for others in the @remotion/transitions package.

设置 Remotion 项目

🌐 Setup the Remotion project

如果这是你的第一次贡献,请先查看主要说明

🌐 If this is your first contribution, see the main instructions first.

如何进行

🌐 How to proceed

创建自定义过渡。查看 自定义演示文稿 文档以了解如何操作。


将你的演示文稿添加到 remotion 单一代码库中的 packages/transitions/src/presentations 下。
3
bundle.ts 文件中,将你的演示文稿添加到 presentations 数组 中。


  const presentations = ['slide', 'flip', 'wipe', 'fade', ..., 'yourPresentation'];

将你的演示添加到 packages/transition/package.json 中的 package.jsonexports,以及 typesVersions 中,这样它就可以在其他 Remotion 项目中正确导入。

"exports": {
  "./yourPresentation": {
    "types": "./dist/presentations/yourPresentation.d.ts",
    "module": "./dist/presentations/yourPresentation.js",
    "import": "./dist/presentations/yourPresentation.js",
    "require": "./dist/cjs/presentations/yourPresentation.js"
    },
  },
"typesVersions": {
  ">=1.0": {
    "yourPresentation": [
      "dist/presentations/yourPresentation.d.ts"
      ],
    },
  }

确保在 remotion/packages/transitionspnpm build,这样你的过渡在你的 remotion 仓库中就可用了。

🌐 Make sure to pnpm build in remotion/packages/transitions so your transition gets usable in your remotion repository.

为你的演示文稿撰写文档。请参考 演示文稿 文档中链接的演示文稿。文档应包含以下部分:

  • short description 是你的演示所做的事情。
  • 你演示文稿的 demo。有关说明,请查看 contributing to the documentation 页面中的 demo 段,或查看其他演示文稿文档的源代码([presentationType].mdx 文件)。
  • 一个 example code snippet 展示如何使用你的演示文稿。请参阅 类型安全代码片段 文档以获取类型安全代码片段的使用说明。
  • 你演示文稿的API

     如需有关如何编写文档的更多帮助,请参阅贡献文档页面。

通过创建一个包含指向你的文档的链接的<TOCItem>、显示你的演示文稿的<PresentationPreview>以及一句话描述你的演示文稿功能的内容,将你的演示文稿添加到 docs/transitions/presentations 的目录中。

Example TOCItem
<TOCItem link="/docs/transitions/presentations/yourPresentation"> <div style={row}> <PresentationPreview durationRestThreshold={0.001} effect={yourPresentation()} /> <div style={{flex: 1, marginLeft: 10}}> <strong> <code>{'yourPresentation()'}</code> </strong> <div>Insert one-liner describing your presentation</div> </div> </div> </TOCItem>

可以在 这里找到包含所有必要步骤和文件更改的参考拉取请求。

另请参阅

🌐 See also