以 HTML 格式获取 Google 文档 [英] Get Google Document as HTML

查看:23
本文介绍了以 HTML 格式获取 Google 文档的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个疯狂的想法,我可以使用 Google Drive Documents 为不熟练的用户朋友建立一个网站博客.我能够创建一个编译文档列表的 contentService.但是,我看不到将文档转换为 HTML 的方法.我知道 Google 可以在网页中渲染文档,所以我想知道是否有可能获得渲染版本以用于我的内容服务.

I had a wild idea that I could build a website blog for an unsophisticated user friend using Google Drive Documents to back it. I was able to create a contentService that compiles a list of documents. However, I can't see a way to convert the document to HTML. I know that Google can render documents in a web page, so I wondered if it was possible to get a rendered version for use in my content service.

这可能吗?

推荐答案

在 GAS 中没有直接的方法来获取文档的 HTML 版本,这是一个相当古老的增强请求最初由 Henrique Abreu 描述的解决方法 效果很好,我都用了时间...

There is no direct method in GAS to get an HTML version of a doc and this is quite an old enhancement request but the workaround described originally by Henrique Abreu works pretty well, I use it all the time...

授权过程中唯一令人讨厌的事情需要从脚本编辑器中调用,这使得它在共享应用程序中难以使用(脚本无法"用户),但这只会发生一次;).

The only annoying thing in the authorization process that needs to be called from the script editor which makes it uneasy to use in a shared application (with "script unable" users) but this only happens once ;).

还有一个图书馆Romain Vialard 创建,使事情(有点)更容易......并添加了一些其他有趣的功能.

There is also a Library created by Romain Vialard that makes things (a bit) easier... and adds a few other interesting functions.

这篇关于以 HTML 格式获取 Google 文档的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆