@meimfhd/notebook
v0.0.3
Published
Make documentation simpler with notion and notebook
Downloads
5
Maintainers
Readme
Notebook
npm install @meimfhd/notebook
import { notionToNextra } from "@meimfhd/notebook";
export default async function Home() {
return (
<form
className="flex flex-col gap-2 h-screen w-full justify-center items-center"
action={async (formdata: FormData) => {
"use server";
const { msg } = await notionToNextra({
pageId: formdata.get("pageId") as string,
rootRouteName: (formdata.get("routeRouteName") as string) ?? "docs",
rootRouteTitle: (formdata.get("title") as string) ?? "docs",
token: process.env.token!,
});
console.log(msg);
}}
>
<input
type="text"
name="pageId"
id="pageId"
placeholder="Enter your notion page Id"
className="text-blue-700 px-2 py-1"
/>
<input
type="text"
name="rootRouteName"
id="rootRouteName"
placeholder="Enter route name e.g.(docs) "
className="text-blue-700 px-2 py-1"
/>
<input
type="text"
name="title"
id="title"
placeholder="Enter title for your index page"
className="text-blue-700 px-2 py-1"
/>
<button
className=" bg-blue-700 px-2 py-1 hover:translate-y-[-1px] active:translate-y-[1px] focus:ring-2 border "
type="submit"
>
Start Generating Docs
</button>
</form>
);
}