从 XML 生成 Powerpoint 或 Keynote(或通过 Ruby gem?)

发布于 2024-11-18 09:09:45 字数 1204 浏览 4 评论 0原文

我正在寻找一种好方法来从 XML 生成 Keynote 文件或 Powerpoint 文件,然后将其导入到 Keynote。基本上,我正在寻找一种可以导出到幻灯片中的简单的人类可写标记格式(以便于编写脚本)。

我在当地一家非营利组织做志愿者,任何技术性的事情都由我负责。我会定期收到有关活动的信息,并在 Word 中制作一个漂亮的打印程序,尽管大部分相同的材料也会进入 Keynote 的幻灯片中。 (使用 Keynote 而不是 PowerPoint,以便可以使用 Keynote Remote。)

无论如何,我需要通过电子邮件发送大量文本,并且必须同时包含在 Keynote 演示文稿和 Word 文档中,并且需要各种奇怪的手动格式,以免在奇怪的时候破坏页面或幻灯片,还需要大量的手动重新设计,因为我不会允许我所做的事情看起来像 20 世纪 90 年代的草率东西。

我的希望是编写一个 Ruby 脚本,我可以将源文本输入其中,它会为我完成所有处理,至少对于 Powerpoint 或 Keynote 来说是这样。我通常很幸运地找到了适合我想要使用的任何格式或服务的宝石,但我还没有找到任何可以与 Powerpoint 或 Keynote 一起使用的东西。

我的下一个想法是让 Ruby 代码生成适当的 XML,因为 Office 和 I Work 据称都打开 Office XML 格式,但我找不到任何实际的友好文档人类可写的 XML 代码。

想要能够做下面这样的事情是不是一厢情愿?

<SLIDE FORMAT="Title & Bullets">
  <SLIDE_TITLE>
    Lorem Ipsum
  </SLIDE_TITLE>
<PARAGRAPH>
    [etc.]

就转换器脚本而言,我能找到的所有内容都与图表和表格相关(此处使用为零),通常围绕从 Powerpoint 或 Keynote 打开或转换而不是创建,而且通常似乎适用于使用 OLE 的 Windows或 VBScript。这需要在他们拥有的 Mac 上运行,因此 Visual Studio 的东西、Windows 相关的脚本等都无法工作。我不必在 Ruby 中执行此操作,但这是我在 Mac 端最满意的操作。

那么,是否有关于 Powerpoint 或 Keynote 的稍微友好的 XML 格式的文档,或者甚至更好的 Ruby gem 格式?

I'm looking for a nice way to generate either a Keynote file from XML or a Powerpoint file that I can then import to Keynote. Basically, I'm looking for a simple human-writable markup format (for easy scripting) that can be exported into slides.

I volunteer with a local nonprofit, where anything remotely technical falls to me. On a fairly regular basis, I'm sent information for events and produce a nice looking printed program in Word, though much of the same material also goes into slides in Keynote. (Keynote is used rather than PowerPoint so that Keynote Remote can be used.)

Anyway, there's a large volume of text I work with that I'm sent via email, and it has to go in both a Keynote presentation and a Word document, and requires all sorts of odd manual formatting to not break pages or slides at odd times, also requiring a good deal of manual restyling, since I'm not going to allow something I do to come out looking like something sloppy from the 1990s.

My hope is to write up a Ruby script that I can feed the source text to, and it'll go do all the processing for me, at least for Powerpoint or Keynote. I've normally had fantastic luck finding a gem for just about any format or service I've wanted to work with, but I haven't found anything that works with Powerpoint or Keynote.

My next thought was to have the Ruby code generate appropriate XML since both Office and I Work allegedly open the Office XML format, but I couldn't find any actual friendly documentation for human-writable XML code.

Is it wishful thinking to want to be able to do something like the following?

<SLIDE FORMAT="Title & Bullets">
  <SLIDE_TITLE>
    Lorem Ipsum
  </SLIDE_TITLE>
<PARAGRAPH>
    [etc.]

All I can find as far as converter scripts is all related to charts and tables and such which is of zero use here), usually revolves around opening or converting FROM Powerpoint or Keynote rather than creating, and furthermore generally seems to be for Windows using OLE or VBScript. This needs to run on the Macs they have there, so no Visual Studio stuff, Windows related scripting, etc will work. I don't HAVE to do it in Ruby, but that's what I'd be most comfortable with on the Mac end of things.

So is there documentation out there on a marginally friendly XML format for Powerpoint or Keynote, or even better, a Ruby gem for either?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

記憶穿過時間隧道 2024-11-25 09:09:45

如果您需要做的只是标题+项目符号点幻灯片,则只需创建一个 ascii 文本文件。每行文本都将成为新幻灯片的标题。但是,如果一行文本中的第一个字符是制表符,则该行将成为与上一个标题相同的幻灯片上的一级项目符号点。如果有两个选项卡,它将文本缩进到第二级项目符号点,依此类推。

This becomes the title on slide one
This becomes the title on slide two
<tab>This is a bullet point, first level
<tab><tab>And this is a bullet point, second level
<tab>Back to first level bullet point
And another new slide

获得文本文件后,您可以在 PPT 中打开文件并将文件类型强制为所有文件.,然后选择您的 .TXT 文件。或者,您可以使用“从文件插入幻灯片”将 .TXT 文件引入现有演示文稿中。

像这样一次性创建的幻灯片数量是有限的;也许是100?

另请注意,VBA 在 Mac Office 2008 中消失,但在 Mac Office 2011 中又重新出现,因此,如果您可以找到可实现您想要的功能的 VB/VBA 代码示例,则可以在 Mac 上使用它们,只要它不必发生在 Office 2008 中。

If all you need to do is title + bullet point slides, you simply need to create an ascii text file. Each line of text will become the title of a new slide. But if the first character in a line of text is a tab, the line will become a first level bullet point on the same slide as the previous title. If two tabs, it indents the text to a second level bullet point and so on.

This becomes the title on slide one
This becomes the title on slide two
<tab>This is a bullet point, first level
<tab><tab>And this is a bullet point, second level
<tab>Back to first level bullet point
And another new slide

Once you have the text file, you can do File Open in PPT and force files of type to all files . and select your .TXT file. Or you can use Insert Slide From File to bring the .TXT file into an existing presentation.

There's a limit to the number of slides you can create at one go like this; 100 perhaps?

Note also that VBA disappeared in Mac Ofice 2008 but is back in Mac Office 2011, so if you can find examples of VB/VBA code that do what you want, you can use them on Mac, so long as it doesn't have to happen in Office 2008.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文