issues: Difference between revisions

From Microformats Wiki
Jump to navigation Jump to search
(→‎Bloated Format: Examples added)
m (Correcting Page Layout Errors)
Line 1: Line 1:
Issues which apply to more than one microforamt.
Issues which apply to more than one microforamt.


Line 17: Line 16:


If we think a little bit back about '''css''', one of the main reasons of its development was:
If we think a little bit back about '''css''', one of the main reasons of its development was:
* to separate content from style
* to separate content from style
** page code becomes more easy to '''understand'''
** page code becomes more easy to '''understand'''
** and to '''maintain'''
** and to '''maintain'''
Line 53: Line 52:
New Tags:
New Tags:
* '''<struct> ... </struct>''': like the C/C++ struct, will define the microformats structure
* '''<struct> ... </struct>''': like the C/C++ struct, will define the microformats structure
* '''<var> ... </var>''': will define the part inside ''struct'' that should be replaced
* '''<v> ... </v>''': will define the variable (part inside) ''struct'' that should be replaced
* '''<var ... />''': similarly to point above, but NOT displayed by browser
* '''<v ... />''': similarly to point above, but NOT displayed by browser
** '''<var>''' could be shortend to '''<v>''', to further reduce file size
** '''<v>''' is a shorthand for '''var''', to further reduce file size


=== Examples ===
=== Examples ===


Lets take this code:
Lets take this code:
<pre><nowiki>
  <div class="hcite">
  <div class="hcite">
   <div class="book">
   <div class="book">
Line 68: Line 68:
   </div>
   </div>
  </div>
  </div>
</nowiki></pre>


We would define this in the header like this:
We would define this in the header like this:
<pre><nowiki>
  <struct>
  <struct>
  MyName{
  MyName{
   <div class="hcite">
   <div class="hcite">
   <div class="book">
   <div class="book">
     <span class="fn"><var /></span>
     <span class="fn"><v /></span>
     <div class="chapter">
     <div class="chapter">
       <span class="fn"><var /></span>
       <span class="fn"><v /></span>
     </div>
     </div>
   </div>
   </div>
Line 82: Line 84:
  }
  }
  </struct>
  </struct>
</nowiki></pre>


or in a separate microformats file (NO struct needed):
or in a separate microformats file (NO struct needed):
<pre><nowiki>
  MyName{
  MyName{
   <div class="hcite">
   <div class="hcite">
   <div class="book">
   <div class="book">
     <span class="fn"><var /></span>
     <span class="fn"><v /></span>
     <div class="chapter">
     <div class="chapter">
       <span class="fn"><var /></span>
       <span class="fn"><v /></span>
     </div>
     </div>
   </div>
   </div>
   </div>
   </div>
  }
  }
</nowiki></pre>


Inside the web page we use:
Inside the web page we use:
<pre><nowiki>
  <struct class="MyName">
  <struct class="MyName">
   <var>This is the first variable</var>
   <v>1st variable</v>
   <var>This text is put in the 2nd variable</var>
   <v>2nd variable</v>
  </struct>
  </struct>
</nowiki></pre>


IF, one variable should NOT be displayed by the browser, we would use <var val="..." /> instead, e.g.:
IF, one variable should NOT be displayed by the browser, we would use <var val="..." /> instead, e.g.:
<pre><nowiki>
  <div class="geo">
  <div class="geo">
   <abbr class="latitude" title="37.408183">N 37° 24.491</abbr>  
   <abbr class="latitude" title="37.408183">N 37° 24.491</abbr>  
   <abbr class="longitude" title="-122.13855">W 122° 08.313</abbr>
   <abbr class="longitude" title="-122.13855">W 122° 08.313</abbr>
  </div>
  </div>
</nowiki></pre>


Would become:
Would become:
* the microformats definition page
* the microformats definition page
<pre><nowiki>
  MyGeoStructure{
  MyGeoStructure{
   <div class="geo">
   <div class="geo">
   <abbr class="latitude" title=var><var /></abbr>  
   <abbr class="latitude" title=v><v /></abbr>  
   <abbr class="longitude" title=var><var /></abbr>
   <abbr class="longitude" title=v><v /></abbr>
   </div>
   </div>
  }
  }
</nowiki></pre>


* the web page
* the web page
<pre><nowiki>
  <struct class="MyGeoStructure">
  <struct class="MyGeoStructure">
   <var "37.408183" /><var>N 37° 24.491</var>
   <v "37.408183" /><v>N 37° 24.491</v>
   <var "-122.13855" /><var>W 122° 08.313</var>
   <v "-122.13855" /><v>W 122° 08.313</v>
  </struct>
  </struct>
</nowiki></pre>




  - discussion opened by [[discoleo|Leonard Mada]]
  - discussion opened by [[discoleo|Leonard Mada]]

Revision as of 11:46, 23 November 2006

Issues which apply to more than one microforamt.

Bloated Format

The Problem

Unfortunately, current microformats implementation consume a vast amount of space. The complexity will increase even more, when wanting to solve/add more complex issues. A direct consequence of this is a bloated format:

  • some of the markup is really bloated
    • instead of a number, we end sometimes with a whole new paragraph of markup
    • however, in order to be complete, the markup might need to be so
    • nevertheless, having a page with 1000 data points will be a horror scenario


Therefore, I proposed to open this new brainstorming session/page on how to efficiently implement the microformats in web pages.

Ideas/ Solutions

If we think a little bit back about css, one of the main reasons of its development was:

  • to separate content from style
    • page code becomes more easy to understand
    • and to maintain
    • and often the size shrinks significantly

We must learn this lesson when dealing with microformats. Specifically, the following issues are important:

  • extensive microformat markup inside the page code will significantly reduce the readability of the code
  • repeating the markup will increase page size
  • it will become more difficult to maintain/change the page

Solution

  • define microformat classes
    • e.g. in the page header, or
    • in a separate file (see later)
  • define abbreviations (qasi tags) to those classes
    • use actually only the abbrevioations inside the web page, instead of the whole paragraph of markup


  • define the microformat classes inside a separate file (similarly to the css)
    • this file needs NOT to be downloaded automatically
      • you do NOT need it for displaying the data
      • it is only needed when wanting to import the data somewhere
      • most viewers, however, only view the data
    • let the browser automatically download this file, only IF:
      • there is enough bandwidth
      • the user wants to copy that data
      • the user wants to explicitly save the whole page
    • when the user wants to copy an item
      • the web browser should acces that microformats additional page and
      • download only the relevant class (NO need to actually download the whole page)
      • EXTEND html protocol to be able to download web-file/class-defined-inside-file without beeing necessary to download the whole file

Requirements

New Tags:

  • <struct> ... </struct>: like the C/C++ struct, will define the microformats structure
  • <v> ... </v>: will define the variable (part inside) struct that should be replaced
  • <v ... />: similarly to point above, but NOT displayed by browser
    • <v> is a shorthand for var, to further reduce file size

Examples

Lets take this code:

 <div class="hcite">
  <div class="book">
   <span class="fn">Book Title</span>
   <div class="chapter">
      <span class="fn">Chapter Title</span>
   </div>
  </div>
 </div>

We would define this in the header like this:

 <struct>
 MyName{
  <div class="hcite">
   <div class="book">
    <span class="fn"><v /></span>
    <div class="chapter">
       <span class="fn"><v /></span>
    </div>
   </div>
  </div>
 }
 </struct>

or in a separate microformats file (NO struct needed):

 MyName{
  <div class="hcite">
   <div class="book">
    <span class="fn"><v /></span>
    <div class="chapter">
       <span class="fn"><v /></span>
    </div>
   </div>
  </div>
 }

Inside the web page we use:

 <struct class="MyName">
   <v>1st variable</v>
   <v>2nd variable</v>
 </struct>

IF, one variable should NOT be displayed by the browser, we would use instead, e.g.:

 <div class="geo">
  <abbr class="latitude" title="37.408183">N 37° 24.491</abbr> 
  <abbr class="longitude" title="-122.13855">W 122° 08.313</abbr>
 </div>

Would become:

  • the microformats definition page
 MyGeoStructure{
  <div class="geo">
   <abbr class="latitude" title=v><v /></abbr> 
   <abbr class="longitude" title=v><v /></abbr>
  </div>
 }
  • the web page
 <struct class="MyGeoStructure">
   <v "37.408183" /><v>N 37° 24.491</v>
   <v "-122.13855" /><v>W 122° 08.313</v>
 </struct>


- discussion opened by Leonard Mada