From: Ingo Schwarze <schwarze@usta.de>
To: tech@mdocml.bsd.lv
Subject: Re: -Tman with -mman
Date: Tue, 4 Oct 2011 00:00:29 +0200 [thread overview]
Message-ID: <20111003220029.GG20053@iris.usta.de> (raw)
In-Reply-To: <4E88C13D.6090708@bsd.lv>
Hi Kristaps,
Kristaps Dzonsons wrote on Sun, Oct 02, 2011 at 09:53:33PM +0200:
> On 02/10/2011 17:40, Joerg Sonnenberger wrote:
>> On Sun, Oct 02, 2011 at 05:04:18PM +0200, Kristaps Dzonsons wrote:
>>> What sort of behaviour is most reasonable when providing a man
>>> manual to the new -Tman? I think this should be ironed out before
>>> the release. The mandoc manual says "-Tman only with mdoc" and, if
>>> man is provided to -Tman, outputs nothing (like -Tlint).
>>>
>>> It makes the most sense to me to output the original file (after
>>> preprocessing, I guess). All this requires is a duplicate buffer in
>>> read.c (conditional on -Tman being present to avoid overhead in
>>> normal usage). I don't like the idea of putting out an error (or
>>> nothing at all) because it special-cases modes for input.
>> Agreed, just giving back the original input (maybe reformatted) sounds
>> like the best approach.
I agree that makes sense if the code is parsed (.man -> AST)
and then freshly formatted (AST -> .man) in the sense of a validating,
normalizing parser.
Oops, now that i think about it, maybe i went the wrong way with
mdoc -> man? Maybe i should have implemented that as a two-step
translation? First mdoc-AST -> man-AST, then man-AST -> man-code?
Maybe i should start over? Hm...
> Putting some code to the idea...
Not that i'm really opposed to your small patch - but i'm not
sure this is terribly useful either, so far it's mostly
a fancy cat(1).
In case we maybe want to implement a real normalizing parser later,
i'm both OK with erroring out until we get there or putting in
your fancy cat(1).
> (Sorry for the churn, I ordered the
> mandoc.h functions. They're the same except for the mandoc_keep()
> and mandoc_getkeep() additions). This isn't quite commit-ready, but
> a start. Basically, I ask for a keep buffer if OUTT_MAN is
> specified. This needed some machinery to expose the parser to the
> front-end.
>
> Thoughts?
Well, as a placeholder for something better later, the general
idea seems OK.
Yours,
Ingo
--
To unsubscribe send an email to tech+unsubscribe@mdocml.bsd.lv
next prev parent reply other threads:[~2011-10-03 22:00 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-02 15:04 Kristaps Dzonsons
2011-10-02 15:40 ` Joerg Sonnenberger
2011-10-02 19:53 ` Kristaps Dzonsons
2011-10-03 22:00 ` Ingo Schwarze [this message]
2011-10-03 22:18 ` Kristaps Dzonsons
2011-10-05 9:36 ` Kristaps Dzonsons
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20111003220029.GG20053@iris.usta.de \
--to=schwarze@usta.de \
--cc=tech@mdocml.bsd.lv \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).