=====h-entry===== **h-entry** 是一个简单的开放格式, 用作WEB上的松散片段或者有日期戳的内容。h-entry经常用作打算联合发表的内容。例如blog贴子。h-entry是几个开放的 [[microformats|microformat]]标准之一用来内嵌数据在HTML中。 h-entry 是[[hAtom]]各式的[[microformats2]]升级版。 特别是"hentry" 根类本身就是基于 [[Atom]]的 "entry" 元素。对于"hfeed"的更新参见 [[h-feed]]. ====状态==== 这是一个 **活规范**,但已经足够成熟,鼓励更多的实现和 [[mf>h-entry-issues|反馈]]。 该规范有部分是稳定的、草案和建议。 除非有明确的标为草案或提议,其它功能是稳定的。草案和提议的功能可能发生实质性的改变。不期望对稳定的功能特征进行改变,但作为一个活规范,可以根据实施经验 对问题和勘误进行实质性更改,这需要参与实施人员达到共识,作为明确的[[#change_control|更改控制]] 过程的一部分。 ===参与=== [[https://github.com/microformats/h-entry/issues|Open Issues]] [[h-entry-issues|Resolved issues before 2012-246]] [[IRC]]: [[irc://irc.freenode.net/microformats|#microformats on Freenode]] === 编辑 === [[mf>User:Tantek|Tantek Çelik]] 中文翻译 [[User:eureka|Eureka Chen]] === 许可证 === cc0 owfat ===== 例子Example == 这里是简单的blog贴子例子:

Microformats are amazing======

Published by W. Developer on

In which I extoll the virtues of using microformats.

Blah blah blah

解析为 JSON: { "items": [[ { "type": [[ "h-entry" ]], "properties": { "name": [[ "Microformats are amazing" ]], "author": [[ { "value": "W. Developer", "type": [[ "h-card" ]], "properties": { "name": [[ "W. Developer" ]], "url": [[ "http://example.com" ]] } } ]], "published": [[ "2013-06-13 12:00:00" ]], "summary": [[ "In which I extoll the virtues of using microformats." ]], "content": [[ { "value": "Blah blah blah", "html": "

Blah blah blah

" } ]] } } ]] }
===== 开始 ==== 类 **''h-entry''** 是 //根类名 // 表示存在一个 h-entry. **p-name**, **p-author**, **dt-published** 和其它的列在 h-entry 下面的 h-entry 属性类名在下面进行定义。 注:一个entry的目的在里面写一些明确的内容(在内容属性或非文本内容或响应的其他特定属性)以及任何其它该内容上下文,包括该内容什么时候发布和/或更新,创建它的人,标签或分类,以及链接到该内容的(可能带有引用摘录的)响应和/或链接到联合副本。 ===== 属性 ==== h-entry 属性,在带有类 **h-entry** 的元素。所有属性是可选的。 * 参见 [[mf>microformats2-parsing]] 了解更多类名属性。 ==== 核心属性 === 以下//核心//h-entry属性具有广泛的共识,并且广泛地可互操作地发布和使用: * **''p-name''** - 条目名称/标题 * **''p-summary''** - 短的条目摘要 * **''e-content''** - 条目的完整内容 * **''dt-published''** - 条目的发布时间 * **''dt-updated''** -条目更新时间 * **''p-author''** - 谁写的条目,可选嵌入 [[h-card]](多个) * **''p-category''** - 条目分类/标签 * **''u-url''** - 条目永久链接 * **''u-uid''** - 通用唯一标识符,通常是规范的条目URL * **''p-location''** - 条目发贴地址,可选嵌入 [[h-card]], [[h-adr]], 或者 [[h-geo]] * **''u-syndication''** - 该贴子的联合副本URL(s) ,该属性等价于[[rel-syndication]] ([[http://erinjo.is/2014/checked-into-rockit-colabs-23|example]]) * **''u-in-reply-to''** - 该URL的h-entry被认为是回复 (例如,没有下文则没有意义,可以在显示在评论中),可选嵌入 [[h-cite]] ([[http://indiewebcamp.com/reply-context|reply-context]]) ([[http://waterpigs.co.uk/notes/4V2DjG/|example]]) * **''p-rsvp''** (枚举, 使用 元素或者 [[mf>value-class-pattern]]) * "yes", "no", "maybe", "interested". 不区分大小写的值, 规范到小写。例如: * ''... is going to ...'', 或者 * ''... might go to ...'' * ''... unable to go to ...'' * ''... am interested/tracking/watching ...'' * **''u-like-of''** - h-entry被认为是 “喜欢” (喜爱,追星) 的URL。可选嵌入 [[h-cite]] * **''u-repost-of''** - 该h-entry被认为是 “转发”的条目。可选嵌入 [[h-cite]]. ==== 草案属性 ==== 以下草案属性正在自然(已发布和正在使用)中使用,并在重点考虑中,但尚未成为核心的一部分: * **''p-comment''** - 可选嵌入(或嵌套?) [[h-cite]](s), 它们中的每个都是评论/回复父 h-entry. 参见 [[mf>comment-brainstorming]] ([[http://waterpigs.co.uk/notes/4V2DjG/|example]]) * **''u-photo''** - 一个或多个被认为是该条目的主要内容的照片,除非存在''p-location p-card'', 仍然被认为是“签入”(有一张照片)。 否则,u-photo的出现意味着该条目的名称应该被解释为照片上的标题,并且摘要/内容应该被解释为照片的描述。 * **''u-video''** - 专门 u- 解析规则用于''