[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: (off topic?) Docbook? Re: manlint?
From: |
John Gardner |
Subject: |
Re: (off topic?) Docbook? Re: manlint? |
Date: |
Wed, 16 Sep 2020 03:25:54 +1000 |
>
> this *isn't* the same to me: attributes are for metadata and tag contents
> are for data
That's what I mean: there isn't always an obvious distinction between data
and metadata. For structured HTML-like documents, it's common to see
attributes used for anything not seen by readers (i.g., "metadata"). For
general purpose data serialisation, things aren't as clear-cut. In both
cases, the decision to use attributes is still an arbitrary one.
Which brings me to my next point: the more bells-and-whistles attached to a
data format, the more confusing and hostile it becomes to users. For
example, YAML has 6 fucking ways <https://stackoverflow.com/a/21699210> to
write a multi-line string, none of which I'm able to remember when I need
to add a multi-line string to a YAML file. Conversely, tab- and
newline-delimited lists are the simplest data format that's also the
easiest to parse:
# Extract the second, third, and fifth columns from data.tsv
$ grep -v ^# < data.tsv | cut -f2,3,5
// Even in JavaScript, it's still pretty trivial:
let data = tsv.replace(/^#.*\n?/m, "").split("\n").map(x => x.split("\t"));
pug (pugjs.org/) restored the balance in my xml galaxy:
Pug/Jade is a templating engine for HTML documents. It doesn't generate
XML—the example you gave produces
<doc><title>My stupid document</title><enabled/></doc>
… which is neither valid HTML nor XML. It *would* be valid XML if it
included the mandatory <?xml …?> directive; the header's absence suggests
Pug simply accepts arbitrary tag-names (probably to maximise compatibility
with JSX and future versions of HTML).
In any case, Pug is simply one of *many* tools that provide syntactic sugar
for HTML. I'm sure there's a similar templating engine somewhere that
supports XML output.
On Wed, 16 Sep 2020 at 01:11, Marc Chantreux <eiro@phear.org> wrote:
> hello,
>
> > XML is verbose, cumbersome to read and write, and has two different ways
> to
> > express data structures
>
> > <doc title="My stupid document" enabled="true"></doc>
> > <doc>
> > <title>My stupid document</title>
> > <enabled>true</enabled>
> > <enabled />
> > </doc>
>
> this *isn't* the same to me: attributes are for metadata and tag
> contents are for data. but the thing is: because xml is so painful
> to edit, people (including me) started to abuse metadata.
>
> pug (pugjs.org/) restored the balance in my xml galaxy:
>
> doc
> title My stupid document
> enabled/
>
> seems ok to me.
>
> > Conversely, JSON is more concise and predictable
>
> json is more relevant than xml to store datastructures, right, but
> i just said anything positive i can tell about JSON ...
>
> > { "title": "My stupid document", "enabled": true }
>
> how about the example that follows ?
> regards
> marc
>
> <doc>
> <title>My stupid document</title>
> <enabled>true</enabled>
> <abstract>
> this is about trying to explain that <format id="json"/>
> is way inferior to
> <enum of="file-formats">
> <format>roff</format>
> <format>tex</format>
> <format>tex</format>
> </enum>
> in some situations. but when i want to store data, my first
> attempt will be cbor to exchange and tsv to edit (or using ascii
> separators from 0x1c to 0x1f). another solution i like is the
> one i saw from time to time but don't know if it ever has a name.
> here is an example:
> <snippet>
> %T My stupid document
> %E not sure anymore ...
> </snippet>
> </abstract>
> </doc>
>
>
- manlint?, Sergiusz Pawlowicz, 2020/09/11
- Re: manlint?, Ingo Schwarze, 2020/09/11
- Re: manlint?, Steffen Nurpmeso, 2020/09/11
- Re: manlint?, Ralph Corderoy, 2020/09/12
- Re: manlint?, Steve Izma, 2020/09/14
- Re: manlint?, Eric S. Raymond, 2020/09/15
- (off topic?) Docbook? Re: manlint?, Marc Chantreux, 2020/09/15
- Re: (off topic?) Docbook? Re: manlint?, Ingo Schwarze, 2020/09/15
- Re: (off topic?) Docbook? Re: manlint?, John Gardner, 2020/09/15
- Re: (off topic?) Docbook? Re: manlint?, Marc Chantreux, 2020/09/15
- Re: (off topic?) Docbook? Re: manlint?,
John Gardner <=
- Re: (off topic?) Docbook? Re: manlint?, Marc Chantreux, 2020/09/16
- Re: (off topic?) Docbook? Re: manlint?, John Gardner, 2020/09/16
- Re: (off topic?) about pug. Re: manlint?, Marc Chantreux, 2020/09/16
- Re: (off topic?) Docbook? Re: manlint?, James K. Lowden, 2020/09/16
- Re: (off topic?) Docbook? Re: manlint?, James K. Lowden, 2020/09/18
- Re: (off topic?) Docbook? Re: manlint?, Ingo Schwarze, 2020/09/17
- Re: (off topic?) Docbook? Re: manlint?, John Gardner, 2020/09/17
- Re: (off topic?) Docbook? Re: manlint?, G. Branden Robinson, 2020/09/27
- Re: (off topic?) Docbook? Re: manlint?, John Gardner, 2020/09/27
- Re: (off topic?) Docbook? Re: manlint?, Werner LEMBERG, 2020/09/27