Skip to content

Commit 78b6a81

Browse files
committed
splitMarkdownClientの削除
1 parent a1fa061 commit 78b6a81

File tree

3 files changed

+4
-29
lines changed

3 files changed

+4
-29
lines changed

app/[docs_id]/splitMarkdown.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
"use server";
2-
31
import { unified } from "unified";
42
import remarkParse from "remark-parse";
53
import remarkGfm from "remark-gfm";
@@ -13,9 +11,9 @@ export interface MarkdownSection {
1311
* Markdownコンテンツを見出しごとに分割し、
1412
* 見出しのレベルとタイトル、内容を含むオブジェクトの配列を返す。
1513
*/
16-
export async function splitMarkdown(
14+
export function splitMarkdown(
1715
content: string
18-
): Promise<MarkdownSection[]> {
16+
): MarkdownSection[] {
1917
const tree = unified().use(remarkParse).use(remarkGfm).parse(content);
2018
// console.log(tree.children.map(({ type, position }) => ({ type, position: JSON.stringify(position) })));
2119
const headingNodes = tree.children.filter((node) => node.type === "heading");

app/[docs_id]/splitMarkdownClient.ts

Lines changed: 0 additions & 23 deletions
This file was deleted.

app/sidebar.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import Link from "next/link";
33
import { usePathname } from "next/navigation";
44
import useSWR from 'swr'
5-
import { splitMarkdownClient } from "./[docs_id]/splitMarkdownClient";
5+
import { splitMarkdown } from "./[docs_id]/splitMarkdown";
66

77

88

@@ -31,7 +31,7 @@ export function Sidebar() {
3131
];
3232

3333

34-
const splitmdcontent = splitMarkdownClient(data ?? "")
34+
const splitmdcontent = splitMarkdown(data ?? "")
3535
return (
3636
<div className="bg-base-200 min-h-full w-80 p-4">
3737
{/* todo: 背景色ほんとにこれでいい? */}

0 commit comments

Comments
 (0)