您是否在Web项目中使用微格式?

时间:2023-01-12 17:36:44

Do you use microformats in your web projects?

您是否在Web项目中使用微格式?

If yes then why? If no then why?

如果是,那为什么呢?如果没有那么为什么?

If yes then for which things do you use?

如果是,那么你使用哪些东西?

Is there any alternate of microformats in HTML 5 ?

HTML 5中是否还有其他微格式?

I haven't used microformats yet. Should i start to use now or not much need?

我还没有用过微格式。我现在应该开始使用还是不需要?

3 个解决方案

#1


11  

I’ve used microformats fairly extensively. The benefits I see are

我已经相当广泛地使用了微格式。我看到的好处是

  • access to data for robots like Google Rich Snippets
  • 访问Google Rich Snippets等机器人的数据

  • access to data for users via µF-comsuming tools like H2VX
  • 通过像H2VX这样的μF-comsuming工具访问用户的数据

  • (some) data validation
  • (一些)数据验证

  • more meaningful markup, which makes me happy
  • 更有意义的标记,这让我很开心

(minor) disadvantages are

(次要)缺点是

  • time; hand-coding these things can be a pita. Either add programmatically (e.g. generate from data in CMS) or make a bunch of snippets. If doing via a CMS then it’s (for me) a no-brainer
  • 时间;手工编码这些东西可以是皮塔饼。以编程方式添加(例如,从CMS中的数据生成)或制作一堆代码段。如果通过CMS进行,那么(对我而言)是一个明智的选择

  • require extra attention to UI to do well (best if exposed, but that often involves custom icon etc)
  • 需要特别注意UI才能做好(如果暴露最好,但通常涉及自定义图标等)

Microformats work fine as-is in HTML5. There are new HTML5 elements that map well to some µF functions, notably <time>, but be warned that current µF tools generally can’t cope with HTML5’s new elements (“Tool support” slide).

微格式在HTML5中可以正常工作。有一些新的HTML5元素很好地映射到某些μF函数,特别是

Your other alternatives are HTML5’s microdata, and RDFa. Microdata is pretty nice, but quite new so doesn’t have many tools available. You can represent microformats in microdata, and the HTML5 spec has microdata versions of vCard and vCal. There’s also HTML5’s data- attribute, but that’s for private use and doesn’t encode visible data, so is probably not what you’re after.

您的其他选择是HTML5的微数据和RDFa。 Microdata相当不错,但很新,所以没有很多工具可用。您可以在微数据中表示微格式,HTML5规范具有vCard和vCal的微数据版本。还有HTML5的数据属性,但这是私人使用的,不编码可见数据,所以可能不是你想要的。

I perceive these three as a continuum from easy but specific (microformats) to hard but capable of anything (RDFa), with microdata (for me) occupying a sweet spot in the middle. Google Rich Snippets can read data in any of these, but user tools are still playing catchup. The main benefit of any of these is making your content more usable by exposing more of the information, and for me that’s generally worth the time.

我认为这三者是一个连续体,从简单但具体(微格式)到坚硬但能够做任何事情(RDFa),微观数据(对我而言)占据了中间的最佳位置。 Google Rich Snippets可以读取其中的任何数据,但用户工具仍在追赶。任何这些的主要好处是通过公开更多的信息使您的内容更有用,而对我来说,这通常是值得的。

For completeness I’ve used

为了完整性我已经习惯了

  • hCard
  • hCalendar
  • hEvent
  • hAtom
  • hReview (once? :)
  • hReview(一次?:)

  • XFN
  • plus some rels like rel-license
  • 再加上像rel-license这样的rel

EDIT: I’ve written these articles on HTML5Doctor with everything you need to know ;)

编辑:我已经在HTML5Doctor上写了这些文章,你需要知道的一切;)

HTH

#2


6  

You should ask Jeff Atwood.

你应该问Jeff Atwood。

#3


5  

HTML5 defines various semantic tags to mark your data:

HTML5定义了各种语义标记来标记您的数据:

It also allows for custom data attributes starting with "data-" within elements.

它还允许以元素内的“data-”开头的自定义数据属性。

There is support for microdata which is based on microformats to provide more semantic structure to individual and groups of elements.

支持基于微格式的微数据,以为个体和元素组提供更多的语义结构。

And to answer your main question:

并回答你的主要问题:

No, I don't microformats because I didn't see the advantages until I gave your question a serious thought. I am using the newer HTML5 elements such as time, and custom data attributes, but not microformats because the data was already structured on the backend, and for more structured and semantic access, I'd would've used RSS feeds with specific extensions and include a link to the feed within the document itself.

不,我没有微格式,因为在我认真考虑你的问题之前,我没有看到优势。我正在使用较新的HTML5元素,如时间和自定义数据属性,但不使用微格式,因为数据已经在后端构建,并且为了更加结构化和语义访问,我将使用具有特定扩展的RSS源和包含文档本身内部Feed的链接。

That said, here's why I still support microformats and believe they are awesome and will most likely start using it in the very near future. For me, it serves a very specific purpose and has to do with programmatic access to the elements within my web applications. RSS and Atom feeds provide the same data in a very structured manner, but it's an alternative view. Microformats, or any other homegrown standards can be used effectively to enhance applications.

也就是说,这就是为什么我仍然支持微格式并相信它们很棒并且很可能在不久的将来开始使用它。对我来说,它有一个非常特定的目的,并且与我的Web应用程序中的元素的编程访问有关。 RSS和Atom提要以非常结构化的方式提供相同的数据,但它是另一种视图。微格式或任何其他本土标准可以有效地用于增强应用。

As long as the elements are structured in a standard manner, I can build upon a shared library of reusable code across all applications that deals with commonly occurring data items such as names, addresses, contact details, telephone numbers, etc. to enhance all applications. For example, automatically linking addresses to Google Maps, or linkifying telephone numbers to use a native protocol such as tel: on the fly for mobile devices and various other enhancements that I can do.

只要元素以标准方式构建,我就可以在所有应用程序上构建可重用代码的共享库,这些应用程序处理常见数据项,如名称,地址,联系方式,电话号码等,以增强所有应用程序。例如,自动将地址链接到谷歌地图,或链接电话号码以使用本机协议,如电话:动态移动设备和我可以做的各种其他增强功能。

#1


11  

I’ve used microformats fairly extensively. The benefits I see are

我已经相当广泛地使用了微格式。我看到的好处是

  • access to data for robots like Google Rich Snippets
  • 访问Google Rich Snippets等机器人的数据

  • access to data for users via µF-comsuming tools like H2VX
  • 通过像H2VX这样的μF-comsuming工具访问用户的数据

  • (some) data validation
  • (一些)数据验证

  • more meaningful markup, which makes me happy
  • 更有意义的标记,这让我很开心

(minor) disadvantages are

(次要)缺点是

  • time; hand-coding these things can be a pita. Either add programmatically (e.g. generate from data in CMS) or make a bunch of snippets. If doing via a CMS then it’s (for me) a no-brainer
  • 时间;手工编码这些东西可以是皮塔饼。以编程方式添加(例如,从CMS中的数据生成)或制作一堆代码段。如果通过CMS进行,那么(对我而言)是一个明智的选择

  • require extra attention to UI to do well (best if exposed, but that often involves custom icon etc)
  • 需要特别注意UI才能做好(如果暴露最好,但通常涉及自定义图标等)

Microformats work fine as-is in HTML5. There are new HTML5 elements that map well to some µF functions, notably <time>, but be warned that current µF tools generally can’t cope with HTML5’s new elements (“Tool support” slide).

微格式在HTML5中可以正常工作。有一些新的HTML5元素很好地映射到某些μF函数,特别是

Your other alternatives are HTML5’s microdata, and RDFa. Microdata is pretty nice, but quite new so doesn’t have many tools available. You can represent microformats in microdata, and the HTML5 spec has microdata versions of vCard and vCal. There’s also HTML5’s data- attribute, but that’s for private use and doesn’t encode visible data, so is probably not what you’re after.

您的其他选择是HTML5的微数据和RDFa。 Microdata相当不错,但很新,所以没有很多工具可用。您可以在微数据中表示微格式,HTML5规范具有vCard和vCal的微数据版本。还有HTML5的数据属性,但这是私人使用的,不编码可见数据,所以可能不是你想要的。

I perceive these three as a continuum from easy but specific (microformats) to hard but capable of anything (RDFa), with microdata (for me) occupying a sweet spot in the middle. Google Rich Snippets can read data in any of these, but user tools are still playing catchup. The main benefit of any of these is making your content more usable by exposing more of the information, and for me that’s generally worth the time.

我认为这三者是一个连续体,从简单但具体(微格式)到坚硬但能够做任何事情(RDFa),微观数据(对我而言)占据了中间的最佳位置。 Google Rich Snippets可以读取其中的任何数据,但用户工具仍在追赶。任何这些的主要好处是通过公开更多的信息使您的内容更有用,而对我来说,这通常是值得的。

For completeness I’ve used

为了完整性我已经习惯了

  • hCard
  • hCalendar
  • hEvent
  • hAtom
  • hReview (once? :)
  • hReview(一次?:)

  • XFN
  • plus some rels like rel-license
  • 再加上像rel-license这样的rel

EDIT: I’ve written these articles on HTML5Doctor with everything you need to know ;)

编辑:我已经在HTML5Doctor上写了这些文章,你需要知道的一切;)

HTH

#2


6  

You should ask Jeff Atwood.

你应该问Jeff Atwood。

#3


5  

HTML5 defines various semantic tags to mark your data:

HTML5定义了各种语义标记来标记您的数据:

It also allows for custom data attributes starting with "data-" within elements.

它还允许以元素内的“data-”开头的自定义数据属性。

There is support for microdata which is based on microformats to provide more semantic structure to individual and groups of elements.

支持基于微格式的微数据,以为个体和元素组提供更多的语义结构。

And to answer your main question:

并回答你的主要问题:

No, I don't microformats because I didn't see the advantages until I gave your question a serious thought. I am using the newer HTML5 elements such as time, and custom data attributes, but not microformats because the data was already structured on the backend, and for more structured and semantic access, I'd would've used RSS feeds with specific extensions and include a link to the feed within the document itself.

不,我没有微格式,因为在我认真考虑你的问题之前,我没有看到优势。我正在使用较新的HTML5元素,如时间和自定义数据属性,但不使用微格式,因为数据已经在后端构建,并且为了更加结构化和语义访问,我将使用具有特定扩展的RSS源和包含文档本身内部Feed的链接。

That said, here's why I still support microformats and believe they are awesome and will most likely start using it in the very near future. For me, it serves a very specific purpose and has to do with programmatic access to the elements within my web applications. RSS and Atom feeds provide the same data in a very structured manner, but it's an alternative view. Microformats, or any other homegrown standards can be used effectively to enhance applications.

也就是说,这就是为什么我仍然支持微格式并相信它们很棒并且很可能在不久的将来开始使用它。对我来说,它有一个非常特定的目的,并且与我的Web应用程序中的元素的编程访问有关。 RSS和Atom提要以非常结构化的方式提供相同的数据,但它是另一种视图。微格式或任何其他本土标准可以有效地用于增强应用。

As long as the elements are structured in a standard manner, I can build upon a shared library of reusable code across all applications that deals with commonly occurring data items such as names, addresses, contact details, telephone numbers, etc. to enhance all applications. For example, automatically linking addresses to Google Maps, or linkifying telephone numbers to use a native protocol such as tel: on the fly for mobile devices and various other enhancements that I can do.

只要元素以标准方式构建,我就可以在所有应用程序上构建可重用代码的共享库,这些应用程序处理常见数据项,如名称,地址,联系方式,电话号码等,以增强所有应用程序。例如,自动将地址链接到谷歌地图,或链接电话号码以使用本机协议,如电话:动态移动设备和我可以做的各种其他增强功能。