谷歌文档数据结构

2022-01-24 11:05:37 浏览数 (1)

查看了谷歌文档的介绍,发现谷歌的文档数据竟然是json对象。

一个document对象下第一层是以下几个属性

代码语言:javascript复制
document: {
    body: ... ,
    documentStyle: ... ,
    lists: ... ,
    documentId: ... ,
    namedStyles: ... ,
    revisionId: ... ,
    title: ...
}

意思就是说,我们所看到的谷歌文档 都是以json数据存储的。 真是不可思议

示意图

正文内容基本上是只是一个序列 StructuralElement 对象。每个StructuralElement对象通过其内容元素的个性化,如图所示,下图中:

结构元素和它们的内容对象包含文档的所有文字,内嵌图像,等等

类型 页眉, 页脚,和 脚注 具有同样包含结构元件的序列内容元素。

段落包含一个名为元素的一种特殊类型的 ParagraphElement中 的作品就像一个StructuralElement:它是由它自己的一套的内容类型的个性化,如图所示,如下图:

正文内容中的大多数元素具有startIndexendIndex性质。这些指示偏移的元件的开始和结束,相对于其包围段的开始的。

许多元素是可以修改的使用BatchUpdate方法。例如,使用 InsertTextRequest 请求类型,则可以修改包含任何文本元素的内容; 同样,你可以使用 UpdateTextStyleRequest 格式设置应用到包含在一个或多个元素的文本范围。

Scope

Meaning

Usage

https://www.googleapis.com/auth/drive.appfolder

Allows access to the Application Data folder.

Recommended

https://www.googleapis.com/auth/drive.file

Per-file access to files created or opened by the app. File authorization is granted on a per-user basis and is revoked when the user deauthorizes the app.

Recommended

https://www.googleapis.com/auth/drive.install

Special scope used to let users approve installation of an app, and scope needs to be requested.

Recommended

https://www.googleapis.com/auth/drive.apps.readonly

Allows read-only access to installed apps.

Sensitive

https://www.googleapis.com/auth/drive.metadata

Allows read-write access to file metadata (excluding downloadUrl and contentHints.thumbnail), but does not allow any access to read, download, write or upload file content. Does not support file creation, trashing or deletion. Also does not allow changing folders or sharing in order to prevent access escalation.

Restricted

https://www.googleapis.com/auth/drive

Full, permissive scope to access all of a user's files, excluding the Application Data folder.

Restricted

https://www.googleapis.com/auth/drive.activity

Allows read and write access to the Drive Activity API.

Restricted

https://www.googleapis.com/auth/drive.activity.readonly

Allows read-only access to the Drive Activity API.

Restricted

https://www.googleapis.com/auth/drive.readonly

Allows read-only access to file metadata and file content.

Restricted

https://www.googleapis.com/auth/drive.metadata.readonly

Allows read-only access to file metadata (excluding downloadUrl and contentHints.thumbnail), but does not allow any access to read or download file content.

Restricted

https://www.googleapis.com/auth/drive.scripts

Allows access to Apps Script files.

Restricted

0 人点赞