Nokan Emiro | 16 Apr 2012 14:04
Picon

Markaby xhtml_strict

Hi,


I use this in Markaby to generate an html tag, but I need to add lang="lc" and
xml:lang="lc" (lc != :en).  However xhtml_strict does not accept arguments. :-/
Why not?   And then how should I generate XHTML1.0 Strict docs in other
languages?  (I always feel foolish when face with such trivial problems...)

u.

_______________________________________________
Camping-list mailing list
Camping-list@...
http://rubyforge.org/mailman/listinfo/camping-list
Jenna Fox | 16 Apr 2012 15:36
Gravatar

Re: Markaby xhtml_strict

Urgh. I just turn the validation in markaby off pretty much all of the time - like strictly typed languages, I find it gets in my way more often than it helps me find errors.

Instead of using the xhtml_strict macro you could do it yourself:

self << "<!DOCTYPE whatever blah blah>\n"
html "lang" => 'lc', "xml:lang" => 'lc' do
  ...
end

Though if you're going down to this level, why not switch over to html5? Everything you can reliably do in xhtml 1.0 is also available in html5, and the html5 doctype is simpler, while still supporting browser features using the same syntaxes you're familiar with in addition to newer compact versions. The html5 doctype is this:

self << "<!DOCTYPE html>\n"

HTML5 will become the default in a future edition of camping, as it supersedes the xhtml standard and provides compactness benefits and useful new features. Further, xml:lang is not necessary when using html5 syntax - lang is sufficient.

Have you also considered the possibility of serving the language as a header? Content-Language is a http header of similar effect, which you could even set in your markaby templates via <at> headers['Content-Language'] = 'lc'

Jenna

On Monday, 16 April 2012 at 10:04 PM, Nokan Emiro wrote:

Hi,

I use this in Markaby to generate an html tag, but I need to add lang="lc" and
xml:lang="lc" (lc != :en).  However xhtml_strict does not accept arguments. :-/
Why not?   And then how should I generate XHTML1.0 Strict docs in other
languages?  (I always feel foolish when face with such trivial problems...)

u.

_______________________________________________
Camping-list mailing list

_______________________________________________
Camping-list mailing list
Camping-list@...
http://rubyforge.org/mailman/listinfo/camping-list
Nokan Emiro | 16 Apr 2012 17:45
Picon

Re: Markaby xhtml_strict

Hi,


I do exactly this at the moment.  I mean the Content-language HTTP header line.
The problem with this is that Google can't make difference in this way between
the pages in different languages - probably because of these translations are
available under the same URL, and there's nothing in the document that describes
the language.  What's more xhtml_strict always tells that it's in English. :(

Wise SEO people use a language code somewhere (in the path or as a
subdomain, sometimes as a separate domain), but I don't want to go so far.
I just hope that Google is good enough to recognize the different translations
of the same content available under the same URL if there's something in the
document that indicates this.  At least a <HTML lang="xx">.

I would like to switch to HTML5, but I'm waiting for Camping to make it the
default :)

u.


On Mon, Apr 16, 2012 at 3:36 PM, Jenna Fox <a <at> creativepony.com> wrote:
Urgh. I just turn the validation in markaby off pretty much all of the time - like strictly typed languages, I find it gets in my way more often than it helps me find errors.

Instead of using the xhtml_strict macro you could do it yourself:

self << "<!DOCTYPE whatever blah blah>\n"
html "lang" => 'lc', "xml:lang" => 'lc' do
  ...
end

Though if you're going down to this level, why not switch over to html5? Everything you can reliably do in xhtml 1.0 is also available in html5, and the html5 doctype is simpler, while still supporting browser features using the same syntaxes you're familiar with in addition to newer compact versions. The html5 doctype is this:

self << "<!DOCTYPE html>\n"

HTML5 will become the default in a future edition of camping, as it supersedes the xhtml standard and provides compactness benefits and useful new features. Further, xml:lang is not necessary when using html5 syntax - lang is sufficient.

Have you also considered the possibility of serving the language as a header? Content-Language is a http header of similar effect, which you could even set in your markaby templates via <at> headers['Content-Language'] = 'lc'

Jenna

On Monday, 16 April 2012 at 10:04 PM, Nokan Emiro wrote:

Hi,

I use this in Markaby to generate an html tag, but I need to add lang="lc" and
xml:lang="lc" (lc != :en).  However xhtml_strict does not accept arguments. :-/
Why not?   And then how should I generate XHTML1.0 Strict docs in other
languages?  (I always feel foolish when face with such trivial problems...)

u.

_______________________________________________
Camping-list mailing list


_______________________________________________
Camping-list mailing list
Camping-list-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org
http://rubyforge.org/mailman/listinfo/camping-list

_______________________________________________
Camping-list mailing list
Camping-list@...
http://rubyforge.org/mailman/listinfo/camping-list

Gmane