tech@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: Kristaps Dzonsons <kristaps@bsd.lv>
To: tech@mdocml.bsd.lv
Cc: Jesse Hagewood <jesse.hagewood@gmail.com>
Subject: Re: Implementing roff requests.
Date: Thu, 31 May 2012 13:25:08 +0200	[thread overview]
Message-ID: <4FC75514.7080108@bsd.lv> (raw)
In-Reply-To: <CACfFK-UWc9Wq2cA8=W3aG4yUm1onVaAbeOi8+gF+bxBO3GOL3g@mail.gmail.com>

Hi Jesse,

Welcome!

As Ingo has mentioned, a few of these macros aren't possible given the 
layering of mandoc: roff.c is an opaque preprocessor and has limited 
functionality to cue the next processors (libmandoc.h), and no control 
at all over the front-ends (main.h).  `.ad', for example, is not 
possible given the current layering.  You'd need a separate <div> tag in 
HTML mode and it's uncertain how this would play with other 
implicit-margin-changing constructs (like lists).

As you can see, roff.c itself is quite delicate---too delicate, if you 
ask me, bowing under conditionals and loops and so on.  roff and mandoc 
don't mix well: mandoc is [more or less] reflowable, while roff is line- 
and character-based.  If your focus is moving more and more into roff, 
you may want to revive Heirloom troff instead of using mandoc.  I 
actually prefer to move /away/ from roff unless explicitly demanded. 
Things like .ns, for example, already have -mdoc equivalents.

You might get partial coverage by re-writing `ns' as an appropriate 
-mdoc or -man no-space macro, but I'm not certain about behaviour. 
Furthermore, this would pollute the layering even more with knowledge of 
the underlying parse type.  As written above, there's a well-defined 
point of diminishing returns here.

I also note that tabs are a headache: I designed mandoc poorly in this 
regard.  I think an awesome coup would be to throw out all the 
tab-handling in -mdoc, consider tabbed `Bl -column' lists to be synonyms 
for `Bd', and use the standard argument-parser.  This has been in my 
TODO OF DEATH since forever.  It would throw out a lot of ugly, 
workaround code, and also accomodate for lots of tab-separated `Bl 
-column' syntax found in the wild.

Meanwhile, if you've any implementations of macros, please send them to 
tech and we'll look them over!

Best,

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

  parent reply	other threads:[~2012-05-31 11:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-30 20:58 Jesse Hagewood
2012-05-31  1:22 ` Ingo Schwarze
2012-05-31 11:25 ` Kristaps Dzonsons [this message]
2012-05-31 12:52   ` Ingo Schwarze

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=4FC75514.7080108@bsd.lv \
    --to=kristaps@bsd.lv \
    --cc=jesse.hagewood@gmail.com \
    --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).