Showing posts with label HTML5. Show all posts
Showing posts with label HTML5. Show all posts

Saturday, August 13, 2011

.htm for Mini Mobile and .html for aLL eLse Larger?

2014 might not be too late to achieve this simple option:

  htM for Mobile web content

  htmL for Laptop and aLL other Layout

Luckily, we never had an "xhtml" file extention - and we were permitted both SHTM and SHTML for server-side includes.

The reason to consider HTM for mini displays is that it would not require typing by users to shorten or lengthen the extension if browsers would agree on a hot-key combination.  A smart browser would check at any site offering an HTML whether there was an HTM if the last URL used was HTM by user choice and so offer the option visually to the user for the current site.  It would be a simple browser  configuration option for those devices, the format of which, was neither Large nor Mini.

Lately I have been using htm for 4.01 HTML and html for XHTML and also for HTML5.  As the web moves to the latter, we should be able to set a meta value to flag that, say,  this .html file has a sibling .htm file for constrained display and vice versa.  And ditto for .shtm and .shtml and whatever might follow from 2014 until we achieve 20/20 hindsight.

Sunday, January 16, 2011

Microsoft WebMatrix

Although an install of Microsoft WebMatrix is free, it is not at all clear to me why I would want to install it for personal use.  Do I want to use SQL Server ?  I have Joomla, MySQL5, SQLite3, Moodle and WordPress now at my hosted site - which is running on shared linux - what advantage accrues to me by moving to Windows at my host?  What could induce me to make that move?

But suppose that I have volunteered to set up a web site for a non-profit group.  If I know enough to know what they need and that a hosted site will suffice, how is it that I would still need WebMatrix to accomplish the tasks involved?

Here is what they say:
Start from open source web applications, built-in web templates or just start writing code yourself


So, if in their words, I can just start writing code, why would I use WebMatrix?  Is Silverlight now open-source? What they appear to be plugging is Visual Studio in the 2010 Express version and whatever we are supposed to call MS "Expression" [ possibly Microsoft Expression Studio 4 Web Professional ]  They have one word right: "web" as in near invisible trap woven so as not to be noticed.

Is this how HTML5 will somehow appear to mean Microsoft HTML5 ?

Tuesday, September 7, 2010

Google Chrome browser and Google's BlogSpot blogger.com

This blogging service keeps reminding me how much better off I would be using Chrome (removed from this PC and no longer permitted to update on my Ubuntu netbook. Ahem.)

I get this little tickle at the back of my neck when I read their suggestion: how long before some essential blogger function here will be an exclusive Chrome feature (HTML 5 being what it is ?)

So why remain with blogger.com instead of uisng WordPress wherever else? Well, I do - some - but I prefer blogger when it comes down to it.  But I could not say why. The templates are annoying. At least one important feature is completely daft.  Write it off as habit and a lean towards the familiar.

But today I may have unwittingly nibbled at the bait - I clicked into the invite to try http://draft.blogger.com/home - but only in my default browser.  A browse of the source code for that page reveals nothing sinister ... the doctype and dtd are HTML4 ...

The Chrome blog itself is here.

Thursday, October 15, 2009

curlgen with Groovy BuilderSupport: CurlBuilder for Curl web content markup

Because the Groovy MarkupBuilder has a private method which hardcodes the markup delimiters, a CurlBuilder must extend BuilderSupport just as does MarkupBuilder itself.

What follows looks to be roughly a builder candidate for Curl web content markup using "{" and "}" as the delimiters.  As with XHTML, the Curl content may require a 'prolog' and a few non-hierarchical items comparable to the !DOCTYPE of XML.  Web markup is often more than simply a hierarchy of nested nodes.
/**
* A helper class for creating Curl markup
* borrowed from http://docs.codehaus.org/display/GROOVY/Make+a+builder
* original MarkupBuilder by James Strathan
* mods by RS
*/
public class CurlBuilder extends BuilderSupport {

private IndentPrinter out;
private boolean nospace;
private int state;
private boolean nodeIsEmpty = true;

public CurlBuilder() {
  this(new IndentPrinter());
}

public CurlBuilder(PrintWriter writer) {
  this(new IndentPrinter(writer));
}

public CurlBuilder(Writer writer) {
  this(new IndentPrinter(new PrintWriter(writer)));
}

public CurlBuilder(IndentPrinter out) {
  this.out = out;
}

protected void setParent(Object parent, Object child) {
}

protected Object createNode(Object name) {
  toState(1, name);
  return name;
}

protected Object createNode(Object name, Object value) {
  toState(2, name);
// out.print(">");
  out.print(value.toString());
  return name;
}

protected Object createNode(Object name, Map attributes, Object value) {
  toState(1, name);
  for (Iterator iter = attributes.entrySet().iterator(); iter.hasNext();) {
    Map.Entry entry = (Map.Entry) iter.next();
    out.print(" ");
    print(transformName(entry.getKey().toString()));
    out.print("='");
    print(transformValue(entry.getValue().toString()));
    out.print("'");
  }
  if (value != null)
  {
    nodeIsEmpty = false;
    out.print(" " + value + "}");
  }
  return name;
}

protected Object createNode(Object name, Map attributes) {
  return createNode(name, attributes, null);
}

protected void nodeCompleted(Object parent, Object node) {
  toState(3, node);
  out.flush();
}

protected void print(Object node) {
  out.print(node == null ? "null" : node.toString());
}

protected Object getName(String methodName) {
  return super.getName(transformName(methodName));
}

protected String transformName(String name) {
  if (name.startsWith("_")) name = name.substring(1);
    return name.replace('_', '-');
}

protected String transformValue(String value) {
  return value.replaceAll("\\'", """); }

protected void toState(int next, Object name) {
  switch (state) {
    case 0:
      switch (next) {
        case 1:
        case 2:
          out.print("{");
          print(name);
          break;
        case 3:
         throw new Error();
      }
      break;
    case 1:
      switch (next) {
        case 1:
        case 2:
          out.print(" ");
          if (nospace) {
            nospace = false;
          } else {
            out.println();
            out.incrementIndent();
            out.printIndent();
          }
          out.print("{");
          print(name);
          break;
        case 3:
          if (nodeIsEmpty) {
            out.print(" }");
          }
          break;
        }
        break;
      case 2:
        switch (next) {
          case 1:
          case 2:
            throw new Error();
          case 3:
            out.print(" }");
            break;
        }
        break;
      case 3:
        switch (next) {
          case 1:
          case 2:
            if (nospace) {
              nospace = false;
            } else {
              out.println();
              out.printIndent();
            }
            out.print("{");
            print(name);
            break;
          case 3:
            if (nospace) {
              nospace = false;
            } else {
              out.println();
              out.decrementIndent();
              out.printIndent();
            }
            out.print(" }");
            break;
        }
        break;
     }
     state = next;
   }
}
That could have been so elegant if the MarkupBuilder class had understood markup itself as a pattern rather than hard-coding the SGML-style tag delimiters and assuming the tagging style (close before content, reopen after content.)

The ability to inject a markup builder for non-SGML markup for an entire site is lost: we still have to look into such things as 404 and 500 errors because we have only covered where we explicitly instantiate a builder.  DI should have solved that web container-wide.

As I never tire of saying, when we get beyond HTML5 and the mere browser, this SGML-bias will look like an unquestioned assumption as curious as any other in the history of data format oddities and over-sights.

To get from   <br/>  to {br} should not be a coding intervention task of this magnitude or this nature.