$ show longbridge/feishu-pages
feishu-pages is a monorepo application that exports Feishu (Lark) wiki knowledge base to Markdown for static site generators. It consists of three workspaces: feishu-docx (a library for converting Feishu Docx documents to Markdown), feishu-pages (the main CLI tool that orchestrates the export process), and website (a VitePress documentation site). The CLI authenticates with the Feishu Open API, fetches wiki space structure, converts document blocks to Markdown, downloads and rewrites asset URLs, generates YAML frontmatter for static site generators, and outputs a structured directory of Markdown files with SUMMARY.md and docs.json for navigation. The architecture features clear separation of concerns with dedicated modules for API interactions, document processing, asset handling, and summary generation.
The LLM identified 4 files worth highlighting for reuse:
Implements a file-based cache for API responses with validation using obj_edit_time to prevent stale data. Includes rate limiting handling via p-limit. This self-contained module can be extracted for any project needing to cache API responses with freshness checks.
Contains utilities for rewriting Feishu internal asset URLs to relative paths or a base URL, and for normalizing strings into URL slugs. These functions are independent, have no internal dependencies, and solve common problems in web applications that process external content.
A simple, efficient string builder class that avoids the performance pitfalls of string concatenation in loops. It is self-contained, dependency-free, and can be used in any TypeScript/JavaScript project requiring efficient string construction.
Converts Feishu Docx document block AST into Markdown string. Handles diverse block types (text, headings, tables, images, callouts, grids) with specialized rendering. While Feishu-specific, the pattern of traversing a document AST and dispatching block-type-specific renderers is a reusable approach for document conversion tools.