[Mapcss] meta

Kal Conley kcconley at gmail.com
Tue May 1 16:11:30 BST 2012

Am 5/1/12 12:08 PM, schrieb Paul Hartmann:
> On 05/01/2012 11:39 AM, Kal Conley wrote:
>> Am 5/1/12 11:14 AM, schrieb Komяpa:
>>> 1) meta{}.
>>> That thing was used as josm's standard way to store info about
>>> stylesheet, like its name and author.
>>> I think it's worth it - even if most will just ignore its content, it
>>> can be used to store mapcss revision number and be used by something
>>> like libmagic to guess that it's mapcss file at all.
>> I would suggest maybe something like @meta{} instead of meta{}. As its
>> not really a selector and should be handled specially. The @ symbol
>> makes it more obvious that this is the case. What do people think?
> Much like canvas it is a selector that applies to an additional
> (abstract) object that holds the meta information of the style sheet.
> I'm not sure if adding an @ sign in front would ease implementation or
> improve the understanding.
> More complete example, cascading can be used for easy internationalization.
> meta {
>   title: "Parking lanes";
>   description: "Parking lanes along roads and parking/stopping
> restrictions.";
>   link: "http://wiki.openstreetmap.org/wiki/Key:parking:lane";
>   author: "Sebastian Klemm, Kay Drangmeister";
>   version: "0.8_2012-03-06";
>   mapcss: ">=0.2";
>   extensions: "layer,offset";
> }
> meta[lang=de]
> {
>   title: "Parkstreifen";
>   description: "Parkstreifen/Parkplätze entlang von Straßen und
> Park-/Halteverbote.";
> }
> Paul
> _______________________________________________
> Mapcss mailing list
> Mapcss at openstreetmap.org
> http://lists.openstreetmap.org/listinfo/mapcss

Interesting. I hadn't thought of selecting attributes on meta but I
guess it makes sense.

I think metadata should ALWAYS be safe to ignore though. Perhaps @rules
should be used for things that may change how the stylesheet is
parsed/interpreted (similarly to the @charset rule in normal CSS). These
@rules should also be well defined in the standard spec.

Consider "mapcss-version:" for example (other examples are "mapcss:",
"text-interprettation:", etc.). A parser may not be able to ignore this
so it shouldn't go in the "meta" rule. Furthermore, it doesn't make
sense to be able to select different values for this. For example, the
following is bizarre:

meta {
  mapcss-version: ">=0.2";

meta[lang=de] {
  mapcss-version: ">=0.3";

Instead of this, I propose something like:

@version ">=0.2"


@version-min "0.2"
@version-max "0.3"


More information about the Mapcss mailing list