public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* JSON representation of tables
@ 2021-07-20 16:15 BPJ
       [not found] ` <CADAJKhB=o95_UD3ZnkTudvROmX0OJBuTPQvbqMMyLZqv9sPJWQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: BPJ @ 2021-07-20 16:15 UTC (permalink / raw)
  To: pandoc-discuss

[-- Attachment #1: Type: text/plain, Size: 1884 bytes --]

I'm trying to understand the JSON representation of complex/new-style
tables. To that end I have converted the JSON representation of a rather
minimal Markdown table to YAML in order to visualize the structure with as
little
noise as possible. To that YAML I have then added comments attempting to
show
the (zero based) indices of the various list items, and label them according
to what I think is their function. I have replaced indices with capital
letters in places where I think a list may have a variable number of
elements:

    S: (Col) Specs
    R: Rows
    C: Cells
    B: Bodies

I have looked at
<
https://hackage.haskell.org/package/pandoc-types-1.22/docs/Text-Pandoc-Definition.html
>
but I am not quite sure that I have got things right because the two
structures don't seem to be totally analogous.

I would be very grateful if a developer who already groks the structure
would
take the time to have a
look at the attached YAML with my comments and check that I have got
things right and that I have not overlooked anything. There are some
question marks against some labels which I am especially unsure about, and
questions attached to some comments which I would be very grateful to get
clarified.

One thing in particular: does RowHeadColumns refer to what a
typographer would call the (number of) stub columns? (See
<https://images.app.goo.gl/MvgfLtUALmXuaMyUA> for an overview of
standard typographic terminology for tables.)

TIA,

/bpj

-- 
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/CADAJKhB%3Do95_UD3ZnkTudvROmX0OJBuTPQvbqMMyLZqv9sPJWQ%40mail.gmail.com.

[-- Attachment #2: Type: text/html, Size: 3176 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: JSON representation of tables
       [not found] ` <CADAJKhB=o95_UD3ZnkTudvROmX0OJBuTPQvbqMMyLZqv9sPJWQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2021-07-20 16:20   ` BPJ
  2021-07-20 16:39   ` John MacFarlane
  1 sibling, 0 replies; 4+ messages in thread
From: BPJ @ 2021-07-20 16:20 UTC (permalink / raw)
  To: pandoc-discuss


[-- Attachment #1.1: Type: text/plain, Size: 2087 bytes --]

I forgot the attachment. Typical!

Den tis 20 juli 2021 18:15BPJ <melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> skrev:

> I'm trying to understand the JSON representation of complex/new-style
> tables. To that end I have converted the JSON representation of a rather
> minimal Markdown table to YAML in order to visualize the structure with as
> little
> noise as possible. To that YAML I have then added comments attempting to
> show
> the (zero based) indices of the various list items, and label them
> according
> to what I think is their function. I have replaced indices with capital
> letters in places where I think a list may have a variable number of
> elements:
>
>     S: (Col) Specs
>     R: Rows
>     C: Cells
>     B: Bodies
>
> I have looked at
> <
> https://hackage.haskell.org/package/pandoc-types-1.22/docs/Text-Pandoc-Definition.html
> >
> but I am not quite sure that I have got things right because the two
> structures don't seem to be totally analogous.
>
> I would be very grateful if a developer who already groks the structure
> would
> take the time to have a
> look at the attached YAML with my comments and check that I have got
> things right and that I have not overlooked anything. There are some
> question marks against some labels which I am especially unsure about, and
> questions attached to some comments which I would be very grateful to get
> clarified.
>
> One thing in particular: does RowHeadColumns refer to what a
> typographer would call the (number of) stub columns? (See
> <https://images.app.goo.gl/MvgfLtUALmXuaMyUA> for an overview of
> standard typographic terminology for tables.)
>
> TIA,
>
> /bpj
>
>

-- 
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/CADAJKhA%3DKLx1sKtWFX4rMPfn6pQn8q-ZHt1j8pPF1hNVTW23fg%40mail.gmail.com.

[-- Attachment #1.2: Type: text/html, Size: 3654 bytes --]

[-- Attachment #2: table.yaml --]
[-- Type: application/octet-stream, Size: 1964 bytes --]

---
blocks:
- c:  
# 0 Table attributes
  - - ''
    - []
    - []
# 1 Caption
# 1.0.0 Short caption
  - - null
# 1.0.1 Long caption
    - - c:
        - c: This
          t: Str
        - t: Space
        - c: table
          t: Str
        t: Plain
# 2 Col spec
# 2.S Spec col
# 2.S.0 Col alignment  
  - - - t: AlignDefault
# 2.S.1 Col width (can this be a number?)
      - t: ColWidthDefault
# 3 Head
# 3.0 Head attributes
  - - - ''
      - []
      - []
# 3.1 Head rows??
# 3.1.R Head row
# 3.1.R.0 Head row attributes
    - - - - ''
          - []
          - []
# 3.1.R.1 Head row cells
# 3.1.R.1.C Head cell
# 3.1.R.1.C.0 Head cell attributes
        - - - - ''
              - []
              - []
# 3.1.R.1.C.1 Head cell alignment
            - t: AlignDefault
# 3.1.R.1.C.2 Head cell col span?
            - 1
# 3.1.R.1.C.2 Head cell row span?
            - 1
# 3.1.R.1.C.3 Head cell content (blocks)
            - - c:
                - c: foo
                  t: Str
                t: Plain
# 4 Bodies
# 4.B Body
# 4.B.0 Body head attributes
  - - - - ''
        - []
        - []
# 4.B.1 Stub ("row head") column count
      - 0
# 4.B.2 Body head rows (analogous to 3.1?)
      - []
# 4.B.3 Body rows
# 4.B.3.R Body row
# 4.B.3.R.0 Body row attributes
      - - - - ''
            - []
            - []
# 4.B.3.R.1 Body row cells
# 4.B.3.R.1.C Body row cell
# 4.B.3.R.1.C.0 Body row cell attributes
          - - - - ''
                - []
                - []
# 4.B.3.R.1.C.1 Body row cell alignment
              - t: AlignDefault
# 4.B.3.R.1.C.2 Body row cell col span
              - 1
# 4.B.3.R.1.C.3 Body row cell row span
              - 1
# 4.B.3.R.1.C.4 Body row cell content
              - - c:
                  - c: baz
                    t: Str
                  t: Plain
# 5 Foot
# 5.0 Foot attributes
  - - - ''
      - []
      - []
# 5.1 Foot rows (analogous to 3.1?)
    - []
  t: Table
meta: {}
pandoc-api-version:
- 1
- 22

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: JSON representation of tables
       [not found] ` <CADAJKhB=o95_UD3ZnkTudvROmX0OJBuTPQvbqMMyLZqv9sPJWQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  2021-07-20 16:20   ` BPJ
@ 2021-07-20 16:39   ` John MacFarlane
       [not found]     ` <m2y2a13pp6.fsf-jF64zX8BO0+FqBokazbCQ6OPv3vYUT2dxr7GGTnW70NeoWH0uzbU5w@public.gmane.org>
  1 sibling, 1 reply; 4+ messages in thread
From: John MacFarlane @ 2021-07-20 16:39 UTC (permalink / raw)
  To: BPJ, pandoc-discuss

BPJ <melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:

Skimming this, it looks correct. I may have missed something.

You can test your understanding by filling in the parts and
converting json to native.

> One thing in particular: does RowHeadColumns refer to what a
> typographer would call the (number of) stub columns? (See
> <https://images.app.goo.gl/MvgfLtUALmXuaMyUA> for an overview of
> standard typographic terminology for tables.)

I'm not quite sure.  The idea would be that if there are
rowheadcolumns, they will be rendered with th rather than
td in HTML, and generally be styled like the table header.

The diagram seems to indicate that *every* table has a stub
column, since every table has a leftmost column; if so,
it's not quite the same concept.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: JSON representation of tables
       [not found]     ` <m2y2a13pp6.fsf-jF64zX8BO0+FqBokazbCQ6OPv3vYUT2dxr7GGTnW70NeoWH0uzbU5w@public.gmane.org>
@ 2021-07-20 17:00       ` BPJ
  0 siblings, 0 replies; 4+ messages in thread
From: BPJ @ 2021-07-20 17:00 UTC (permalink / raw)
  To: John MacFarlane; +Cc: pandoc-discuss

[-- Attachment #1: Type: text/plain, Size: 1407 bytes --]

Den tis 20 juli 2021 18:39John MacFarlane <jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org> skrev:

> BPJ <melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:
>
> Skimming this, it looks correct. I may have missed something.
>
> You can test your understanding by filling in the parts and
> converting json to native.
>
> > One thing in particular: does RowHeadColumns refer to what a
> > typographer would call the (number of) stub columns? (See
> > <https://images.app.goo.gl/MvgfLtUALmXuaMyUA> for an overview of
> > standard typographic terminology for tables.)
>
> I'm not quite sure.  The idea would be that if there are
> rowheadcolumns, they will be rendered with th rather than
> td in HTML, and generally be styled like the table header.
>

That would be stubs, yes.

The diagram seems to indicate that *every* table has a stub
> column, since every table has a leftmost column; if so,
> it's not quite the same concept.
>

The diagram is misleading in this respect.

-- 
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/CADAJKhAJfZGRvfFg7gaexo71Y%2BrUDLNmN5CBL8b%3D0DQkUhVZ%2Bw%40mail.gmail.com.

[-- Attachment #2: Type: text/html, Size: 2809 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-07-20 17:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-20 16:15 JSON representation of tables BPJ
     [not found] ` <CADAJKhB=o95_UD3ZnkTudvROmX0OJBuTPQvbqMMyLZqv9sPJWQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2021-07-20 16:20   ` BPJ
2021-07-20 16:39   ` John MacFarlane
     [not found]     ` <m2y2a13pp6.fsf-jF64zX8BO0+FqBokazbCQ6OPv3vYUT2dxr7GGTnW70NeoWH0uzbU5w@public.gmane.org>
2021-07-20 17:00       ` BPJ

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).