SiYuan Document Tool icon

SiYuan Document Tool

Use this tool to create, read, list, and manage documents in the SiYuan knowledge base. Use "getContent" to read a document, "create" to write a new one, "listInNotebook" to browse, or "exportMd" for full markdown export.

Get Document Tree

AI-generated

Overview

This node operation retrieves the tree structure of child documents nested under a specified document in the SiYuan knowledge base. It is useful for visualizing or managing the hierarchical organization of documents within a knowledge base, such as displaying sub-documents or sections under a main document.

Use Case Examples

  1. A user wants to see all sub-documents under a main project document to understand its structure.
  2. A knowledge manager needs to fetch the document tree to display it in a custom interface or for further processing.

Properties

Name Meaning
Document ID The unique ID of the document whose child document tree is to be retrieved.

Output

JSON

  • id - The unique identifier of each document in the tree.
  • title - The title or name of each document in the tree.
  • children - An array representing the nested child documents under each document node, forming the tree structure.

Dependencies

  • SiYuan API credentials (API URL and API token) are required to authenticate and interact with the SiYuan knowledge base.

Troubleshooting

  • Ensure the provided Document ID is valid and exists in the SiYuan knowledge base; otherwise, the operation may fail or return empty results.
  • Check that the API credentials are correctly configured and have sufficient permissions to access document data.
  • If the document has no child documents, the returned tree may be empty or minimal.

Discussion