tech@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: Kristaps Dzonsons <kristaps@bsd.lv>
To: tech@mdocml.bsd.lv
Cc: Ingo Schwarze <schwarze@usta.de>
Subject: Re: -Tman with -mman
Date: Mon, 03 Oct 2011 23:18:52 +0100	[thread overview]
Message-ID: <4E8A34CC.70706@bsd.lv> (raw)
In-Reply-To: <20111003220029.GG20053@iris.usta.de>

On 03/10/2011 23:00, Ingo Schwarze wrote:
> 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.

Ingo,

I think the approach you have is fine---since I don't foresee this mode 
as being heavily used, let's keep it as small as possible.  I think 
adding normalised-output modes to mandoc is just bloat.

Meanwhile, I'll put in the fancy-cat.  This fits my expectation of an 
output mode always producing output.  (It also doesn't cost anything.)

Incidentally, the docs need to be updated to note that the `so' 
invocations are resolved prior to output and the roff in mdoc input is 
stripped.  This may not be expected behaviour, so...

Thanks,

Kristaps
--
 To unsubscribe send an email to tech+unsubscribe@mdocml.bsd.lv

  reply	other threads:[~2011-10-03 22:19 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
2011-10-03 22:18       ` Kristaps Dzonsons [this message]
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=4E8A34CC.70706@bsd.lv \
    --to=kristaps@bsd.lv \
    --cc=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).