用 HTML 表示舞台脚本的最佳方式是什么? [英] What's the best way to represent a stage script in HTML?

查看:23
本文介绍了用 HTML 表示舞台脚本的最佳方式是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个草图想放在我的网站上,我还打算在某个时候写一个短剧,我也想免费提供.

我正在尝试找出在 HTML 中表示这一点的最佳方式.我基本上需要两栏 - 一栏用于人物说话,一栏用于文本.显然,每次演讲都需要与演讲者保持一致.换句话说,是这样的:

<前>杰夫 这确实是我们现在拥有的一个不错的网站.乔尔 当然是.顺便说一句,在 FogCreek 岩石工作.杰夫 当然有.你玩过摇滚乐队吗?它是多开心.

(嗯,它比 lorem ipsum 好...)

我知道如何使用 HTML 表格(每个演讲一个表格行)做到这一点,但这看起来很丑陋,而且每个人似乎都热衷于使用 CSS 来表示非表格数据.我看不出这到底是如何计算表格数据的 - 我之前使用的行"和列"是与布局有关,而不是与基本数据有关.

那么,有什么想法吗?我认为我见过的大多数脚本网站(当然不是很多)要么像我上面的例子一样使用 <pre> ,要么不费心去尝试保持正常的脚本格式,而只是在每个段落前面加上说话者的名字.(有关这种风格的示例,请参阅 podcast wiki.)坦率地说,我什至无法确定我应该使用哪些 HTML 元素来表示这一点 - 一个字典定义列表,以演讲者为术语,以演讲为定义可能是我想到的最接近的,但这感觉就像虐待.

解决方案

我支持异端 :-)

在使用表格之前考虑 CSS 总是好的 - 但通常表格确实是最合适的.在这种情况下看起来是这样.

唯一的额外考虑是可访问性.我听说表格使文本阅读器软件更难处理表格​​,但我不明白为什么会这样(如果您了解更多,请随时在此处发表评论).

另一件事 - 我想你会先以其他格式保存原始数据 - 可能是数据库、xml 或其他一些结构化文本?

在任何情况下,将其转换为 xml 格式并使用 xslt 将其转换为 html 在玩这些东西时会非常自由.

I have a sketch that I want to put up on my website, and I also intend to write a short play at some point which I'd also want to make freely available.

I'm trying to work out the best way of representing this in HTML. I basically need two columns - one for the character speaking, and one for the text. Each speech obviously needs to line up with the speaker though. In other words, something like this:

    Jeff        This sure is a nice website we've got now.

    Joel        It certainly is. By the way, working at FogCreek rocks.

    Jeff        Of course it does. Have you played Rock Band yet? It's
                 a lot of fun.

(Well it's better than lorem ipsum...)

I know how I could do this with HTML tables (with one table row per speech) but that seems pretty ugly, and everyone certainly seems to be keen on using CSS to represent non-tabular data. I can't see how this really counts a tabular data - my use of "row" and "column" earlier was to do with the layout rather than the fundamental data.

So, any ideas? I think most of the script websites I've seen (not many, admittedly) either use <pre> like my example above, or don't bother trying to keep the normal script format, instead just prefixing each paragraph with the speaker's name. (See the podcast wiki for an example of this style.) I'm having trouble working out even what HTML elements I should be using to represent this, frankly - a dictionary definition list with the speaker as the term and the speech as the definition is probably the closest I've thought of, but that feels like abuse.

解决方案

I second the heresy :-)

Always good to consider CSS before resorting to tables - but often tables really are the best fit. It looks like it in this case.

The only additional consideration would be accessibility. I've heard that tables make it harder for text reader software to process tables, but I don't see why this would be the case (feel free to comment here if you know more).

One other thing - I presume you'd be holding the raw data in some other format first - perhaps a database, or xml or some other structured text?

In any case, getting it into an xml format and tranforming that to html with xslt can be quite liberating when it comes to playing with this stuff.

这篇关于用 HTML 表示舞台脚本的最佳方式是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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