groff
[Top][All Lists]
Advanced

[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 16:56:23 +1000

>
> i also love yaml because it has references, datatypes, overwritting
> features


Hence why I jokingly call YAML my favourite programming language, taking a
stab at its egregious complexity.

In all seriousness though, if you need semi-programmatic features like
variable references and custom data-types, you're better off just using a
scripting language. Ruby and JavaScript are often used for this purpose;
e.g., Homebrew formulae
<https://github.com/Alhadis/homebrew-troff/blob/master/Formula/man-db.rb>,
Vagrantfiles
<https://github.com/fabriciofx/gc/blob/dff5b34f897d57591691a93d956cf30216aea3e2/vagrant-java-server/Vagrantfile>,
and .eslintrc <https://github.com/eslint/eslint/blob/master/.eslintrc.js>
configs
are all common examples.

the only sad thing to me is that they added templating which makes
> things harder to port and is not related to the initial goal which
> is "a decent syntax for xml/html".


To be honest, I've never needed (or wanted) a templating language because
it's easier to use TextMate snippets for rapidly entering repetitive or
cumbersome code constructs. Then again, it might be my abrasive dislike of
the current JavaScript ecosystem talking…
On Wed, 16 Sep 2020 at 15:55, Marc Chantreux <eiro@phear.org> wrote:

> > example, YAML has 6 fucking ways <https://stackoverflow.com/a/21699210>
>
> actually 9 (see the comments) :) and i actually like it because i can
> easily choose one of this way to serialize another content in a yaml.
>
> i also love yaml because:
>
> * it feels natural to read and edit to me
> * it has references, datatypes, overwritting features
>
> so whenever i have to edit datastructures that are not easy to serialize
> with simple formats, yaml is my prefered format.
>
> > 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>
>
> of course it does
>
>     doc
>         title My strupid document
>         enabled/
>
>     doc
>         title My strupid document
>         enabled/
>
> > … which is neither valid HTML nor XML. It *would* be valid XML if it
> > included the mandatory <?xml …?> directive;
>
> so you can add it
>
>     doctype xml
>     doc
>         title My strupid document
>         enabled/
>
> you can also add any arbitrary string anywere in the source
>
>     |<?xml version="1.0" encoding="utf-8"?>
>     doc
>         title My strupid document
>         enabled/
>
> > In any case, Pug is simply one of *many* tools that provide syntactic
> sugar
> > for HTML.
>
> not that many achieved to let me:
> * do whatever i need/want
> * feel happy about editing the content
>
> the only sad thing to me is that they added templating which makes
> things harder to port and is not related to the initial goal which
> is "a decent syntax for xml/html".
>
> to me pug is a tool to *generate* templates so you can write
>
>     < my-stupid-page.pug| my-template-engine-of-choice > index.html
>
> in the mkfile of my site, i have
>
>     template.%: %.pug
>         $PUG < $prereq > $target
>     pub/atom.xml: template.atom news.yaml
>       pandoc -f markdown --template ./template.atom news.yaml > $target
>     pub/%.html: %.md template.html
>       pandoc --template ./template.html -o $target $prereq(1)
>
> regards
> marc
>
>
>
>
>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]