Skip to content

feat: add Sheet document type support#68

Open
talka123456 wants to merge 4 commits into
yuque:mainfrom
talka123456:main
Open

feat: add Sheet document type support#68
talka123456 wants to merge 4 commits into
yuque:mainfrom
talka123456:main

Conversation

@talka123456

Copy link
Copy Markdown

What does this PR do?

Add support for reading Yuque Sheet (电子表格) documents and properly handle non-Doc types (Sheet, Table, Board, Thread) across document tools.

  • yuque_get_doc auto-detects Sheet documents and formats body_sheet JSON as Markdown table
  • New doc-type utility for type detection and write guards
  • yuque_create_doc / yuque_update_doc block unsupported body operations on non-Doc types with clear errors
  • Added type and body_sheet fields to YuqueDoc interface
  • Graceful degradation on Sheet formatting failure

Related Issues
N/A

Type of Change

  • ✨ New feature

Checklist

  • Tests added / updated
  • Changelog entry added (if user-facing)
  • No breaking changes (or documented in description)

Added

  • Support reading Sheet documents via yuque_get_doc with automatic Markdown table formatting
  • New doc-type utility module for document type detection and write guards
  • type and body_sheet fields added to YuqueDoc interface
  • yuque_create_doc rejects lakesheet format with clear error
  • yuque_update_doc blocks body writes on Sheet/Table/Board/Thread types; metadata updates still work
  • Graceful degradation when Sheet JSON→Markdown conversion fails

talka123456 and others added 4 commits June 4, 2026 18:12
- Add formatSheet() to convert Sheet JSON to Markdown table
- Update get_doc to auto-format Sheet documents
- Add graceful degradation on format failure
- Support mixed document types (Doc, Sheet, Board) in knowledge base
- Add doc-type utility for document type detection
Previously formatSheet() only read data[0], silently dropping all
subsequent sheet tabs. Now iterates over every entry in body_sheet.data
and concatenates each sheet's Markdown table output.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
When multiple sheets lack a name field (all defaulting to 'Sheet1') or
have identical names, append a numeric suffix so each tab is
distinguishable in the Markdown output: Sheet1, Sheet1 (2), Sheet1 (3).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant