Skip to content

Commit 3481dd7

Browse files
authored
Merge pull request #92 from 01-binary/fix-list
Fix list
2 parents 57013bc + eea19de commit 3481dd7

File tree

15 files changed

+14678
-7367
lines changed

15 files changed

+14678
-7367
lines changed

.changeset/wide-jobs-go.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'notion-to-jsx': patch
3+
---
4+
5+
reimplement list rendering with ListGroup component for nested lists / add empty rich text component

apps/renderer-storybook/scripts/fetchNotionBlocks.ts

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

apps/renderer-storybook/scripts/fetchNotionPage.ts

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ const __dirname = dirname(__filename);
1212
dotenv.config({ path: resolve(__dirname, '../.env.local') });
1313

1414
// 페이지 ID
15-
const PAGE_ID = '76318ec3-9f83-4cc2-af54-7d81daab0131';
15+
const PAGE_ID = '2149c6bf2b17802a9b75db1f01b9cbe7';
1616

17-
// ? using this script : pnpx tsx scripts/fetchNotionProperties.ts
18-
async function fetchNotionPage() {
17+
// ? using this script : pnpx tsx scripts/fetchNotionBlocks.ts
18+
async function fetchAndSaveBlocks() {
1919
try {
2020
// Notion API 키 확인
2121
let apiKey = process.env.NOTION_API_KEY;
@@ -45,24 +45,26 @@ async function fetchNotionPage() {
4545
process.exit(1);
4646
}
4747

48-
console.log('Notion API에서 페이지 속성 데이터를 가져오는 중...');
48+
console.log('Notion API에서 블록 데이터를 가져오는 중...');
4949

5050
// Notion 클라이언트 생성
5151
const client = new Client({ auth: apiKey });
5252

53+
// 페이지 블록 가져오기
5354
const blocks = await client.getPageBlocks(PAGE_ID);
54-
5555
// JSON 파일로 저장
5656
const outputPath = join(__dirname, '../src/sample-data/notionPage.json');
5757
console.log(`저장 경로: ${outputPath}`);
5858
writeFileSync(outputPath, JSON.stringify(blocks, null, 2), 'utf8');
5959

60-
console.log(`페이지 데이터가 성공적으로 저장되었습니다: ${outputPath}`);
60+
console.log(`블록 데이터가 성공적으로 저장되었습니다: ${outputPath}`);
61+
console.log(`총 ${blocks.length}개의 블록을 가져왔습니다.`);
62+
process.exit(0);
6163
} catch (error) {
62-
console.error('페이지 데이터 가져오기 실패:', error);
64+
console.error('블록 데이터 가져오기 실패:', error);
6365
process.exit(1);
6466
}
6567
}
6668

6769
// 스크립트 실행
68-
fetchNotionPage();
70+
fetchAndSaveBlocks();

0 commit comments

Comments
 (0)