Skip to content

🎥 Make videos programmatically with React

nice

Jonny Burgera2690b3175b7
diff --git a/packages/docs/components/TableOfContents/paths.tsx b/packages/docs/components/TableOfContents/paths.tsx
new file mode 100644
index 0000000000..e56db7107a
--- /dev/null
+++ b/packages/docs/components/TableOfContents/paths.tsx
@@ -0,0 +1,47 @@
+import React from "react";
+import { Grid } from "./Grid";
+import { TOCItem } from "./TOCItem";
+
+export const TableOfContents: React.FC = () => {
+ return (
+ <div>
+ <Grid>
+ <TOCItem link="/docs/paths/get-length">
+ <strong>getLength()</strong>
+ <div>Obtain length of an SVG path</div>
+ </TOCItem>
+ <TOCItem link="/docs/paths/get-parts">
+ <strong>getParts()</strong>
+ <div>Split SVG path into its parts</div>
+ </TOCItem>
+ <TOCItem link="/docs/paths/get-tangent-at-length">
+ <strong>getPointAtLength()</strong>
+ <div>Get coordinates at a certain point of an SVG path</div>
+ </TOCItem>
+ <TOCItem link="/docs/paths/get-tangent-at-length">
+ <strong>getTangentAtLength()</strong>
+ <div>
+ Gets tangents <code>x</code> and <code>y</code> of a point which is
+ on an SVG path
+ </div>
+ </TOCItem>
+ <TOCItem link="/docs/paths/reverse-path">
+ <strong>reversePath()</strong>
+ <div>Switch direction of an SVG path</div>
+ </TOCItem>
+ <TOCItem link="/docs/paths/normalize-path">
+ <strong>normalizePath()</strong>
+ <div>Replace relative with absolute coordinates</div>
+ </TOCItem>
+ <TOCItem link="/docs/paths/interpolate-path">
+ <strong>interpolatePath()</strong>
+ <div>Interpolates between two SVG paths</div>
+ </TOCItem>
+ <TOCItem link="/docs/paths/evolve-path">
+ <strong>evolvePath()</strong>
+ <div>Animate an SVG path</div>
+ </TOCItem>
+ </Grid>
+ </div>
+ );
+};
diff --git a/packages/docs/docs/paths/index.md b/packages/docs/docs/paths/index.md
index 29d3704034..b66ad0627f 100644
--- a/packages/docs/docs/paths/index.md
+++ b/packages/docs/docs/paths/index.md
@@ -2,6 +2,8 @@
title: "@remotion/paths"
---
+import {TableOfContents} from '../../components/TableOfContents/paths';
+
A package providing utility functions for dealing with SVG paths. This package includes code from [`svg-path-properties`](https://www.npmjs.com/package/svg-path-properties), [`svg-path-reverse`](https://github.com/Pomax/svg-path-reverse#readme) and [`d3-interpolate-path`](https://github.com/pbeshai/d3-interpolate-path) with the following improvements:
- Functional style APIs
@@ -49,14 +51,7 @@ yarn add @remotion/paths
## Functions
-- [`getLength()`](/docs/paths/get-length)
-- [`getParts()`](/docs/paths/get-parts)
-- [`getPointAtLength()`](/docs/paths/get-point-at-length)
-- [`getTangentAtLength()`](/docs/paths/get-tangent-at-length)
-- [`reversePath()`](/docs/paths/reverse-path)
-- [`normalizePath()`](/docs/paths/normalize-path)
-- [`interpolatePath()`](/docs/paths/interpolate-path)
-- [`evolvePath()`](/docs/paths/evolve-path)
+<TableOfContents />
## License
diff --git a/packages/docs/sidebars.js b/packages/docs/sidebars.js
index e39ffcdeaa..495dc843e2 100644
--- a/packages/docs/sidebars.js
+++ b/packages/docs/sidebars.js
@@ -356,6 +356,11 @@ module.exports = {
"miscellaneous/snippets/offthread-video-while-rendering",
],
},
+ {
+ type: "link",
+ href: "/docs/api",
+ label: "API Reference",
+ },
"3-0-migration",
"2-0-migration",
"license",
diff --git a/vercel.json b/vercel.json
index 375a96fd6e..8165439493 100644
--- a/vercel.json
+++ b/vercel.json
@@ -44,6 +44,11 @@
"source": "/paths",
"destination": "https://remotion.dev/docs/paths",
"permanent": false
+ },
+ {
+ "source": "/paths",
+ "destination": "https://remotion.dev/docs/api",
+ "permanent": false
}
]
}