public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
From: Anton Sharonov <anton.sharonov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
Subject: Re: line breaking in grid table cells
Date: Wed, 9 Jun 2021 23:18:16 +0200	[thread overview]
Message-ID: <CAMoRF4n_mvcVJ6pW9N7xbjrvc3msnzWcG4D9WoiY+WFqjGD5iQ@mail.gmail.com> (raw)
In-Reply-To: <m2o8cf9jy7.fsf-jF64zX8BO0+iXxlc9qkzFr9bIa4KchGshsV+eolpW18@public.gmane.org>

On Wed, 9 Jun 2021 at 16:44, John MacFarlane <jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org> wrote:
>
>
> I'd like to get feedback about a possible change in the
> way pandoc formats grid tables (used in markdown, rst, muse,
> and haddock).
>
> Currently column widths are strictly enforced, so if a table
> cell contains a long verbatim code snippet or a long URL, it
> will be broken up so that the contents fit into the cell.
>
> An alternate behavior, suggested in
> https://github.com/jgm/pandoc/issues/4572,
> would be to let the cell expand past its prescribed width
> to accommodate the "unbreakable" content.
>
> PR #4572 suggests making this available as an option, but
> I'm thinking maybe it should just be the default behavior,
> and I wonder if people could comment on that.  We could emit
> a warning when cell widths are expanded to fit content.


Disclaimer: everything below is just humble opinion of one person.

Said that, my vote goes as +1 to "make it an option".

Arguments:

Like it is now - breaking the verbatim content looks ugly of course.
But expanding column sizes potentially leads to very wide total table
width, hard to read and maintain - which in my opinion is even more
ugly. So +1 for to make it an option - at  least allow to keep current
status quo.

And since you are asking:

Another idea to deal with this kind of problem ("unbreakable content"
on inconvenient places like table cells) would be to create new syntax
extension lets call it for the moment "AST segment replacement",
controlled by an  option (this "AST segment replacement" was described
by my post few weeks ago - in short it can be something like a
footnote, where "unbreakable content" can be defined outside the table
and referenced from the table using "replacement pointer". Abstract
syntax tree segment can be "transplanted" from segment definition
point - expressed as kind of "footnote" - to that target position
inside the table cell. That way "unbreakable content" can be replaced
by some rather short generated identifier used as "replacement
pointer", keeping the table column slim and good observable,
outsourcing definition of long "inconvenient" segments to another
places in the document, not disturbed by any table formatting
concerns. Right now draft implementation of that idea exists in form
of lua filter, utilizing self invented flavor of possible syntax.
Having support for folding "unbreakable content" in that way from
pandoc core as an optional behavior would be absolutely cool)

Thanks and with best regards, Anton

>
> --
> You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/m2o8cf9jy7.fsf%40MacBook-Air.hsd1.ca.comcast.net.


  parent reply	other threads:[~2021-06-09 21:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-09 14:44 John MacFarlane
     [not found] ` <m2o8cf9jy7.fsf-jF64zX8BO0+iXxlc9qkzFr9bIa4KchGshsV+eolpW18@public.gmane.org>
2021-06-09 21:18   ` Anton Sharonov [this message]
     [not found]     ` <CAMoRF4n_mvcVJ6pW9N7xbjrvc3msnzWcG4D9WoiY+WFqjGD5iQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2021-06-09 22:26       ` John MacFarlane

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=CAMoRF4n_mvcVJ6pW9N7xbjrvc3msnzWcG4D9WoiY+WFqjGD5iQ@mail.gmail.com \
    --to=anton.sharonov-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org \
    /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).