[uf-discuss] hCode microformat proposal

anders conbere aconbere at gmail.com
Thu Jan 25 13:15:00 PST 2007


On 1/25/07, Jonathan C Williams <jonathan.williams at nyu.edu> wrote:
> On Jan 24, 2007, at 10:30 PM, anders conbere wrote:
>
> > All over the web there are code snippets and code examples, and just
> > plain people showing of little programs they've written.  This data is
> > typical acompanied by an author or list of authors, a lisence, the
> > language type and version and various other bits of meta data.  This
> > seems to me to be an excelent place for microformats.
>
> It seems like this would be an interesting place to suggest an
> (optional) extension of this proposal to create a standard for class
> based syntax highlighting. It may too ambitious but marking up stuff
> inside <code> with class names corresponding to what is is (variable,
> function, array indirection, operator, etc) could lead the way
> towards making things that could, for example, find all `php` code
> with calls to the `function` named `ldap_connect`.

I think this is a grand idea, but somewhat more than I'm willing to
bite off, and I worry that it would muddle the waters of actual
digestion of the code.  Say for instance you wanted to store all of
your code samples in a local sql-light database application, then
search them, and test them.  Would the code-samples be stored in html
or plain-text?  If they are in html they would have to be rendered or
stripped of tags first and then passed to whatever application might
parse them.  If they are in plain text this task becomes substantially
easier.

>
> Also, we should keep in mind that <code> isn't always procedural
> programming code can be examples of CSS, XML, HTML, YAML, TeX, etc.
> Would we want to consider methods of categorizing code in a rich
> taxonomy -- distinguishing between `markup`, `functional`
> `procedural`, `object-oriented` <code> above the level of language?
> I'm guessing this approach is not a good idea.

In my mind there would be little distinction made for those kinds of
granularities.  It would seem like a list of standard names for
languages would be nice as it would greatly ease the ability to make
distinctions.  (while some might have PHP others might have Php, etc
or C# versus C-sharp).  Those categories might fit into a list of
rel=tag's, but when considering digesting of code samples, the type of
code shouldn't matter nearly as much as the actual language itself.

>
> --
> Jonathan Williams
> NYU Steinhardt
> jonathan.williams at nyu.edu
> +1 212 998 5308
> _______________________________________________
> microformats-discuss mailing list
> microformats-discuss at microformats.org
> http://microformats.org/mailman/listinfo/microformats-discuss
>


More information about the microformats-discuss mailing list