public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* How to Assign Class to HTML Table using a Filter
@ 2019-01-30 14:50 Ken Dow
       [not found] ` <553f3670-7cb1-402f-9a92-89f3774d17c0-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 12+ messages in thread
From: Ken Dow @ 2019-01-30 14:50 UTC (permalink / raw)
  To: pandoc-discuss


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

Hi,

I'd like to assign a class to every table in my HTML output. I've got PHP 
filters <https://github.com/glassdimly/pandocfilters-php> working but can't 
figure out how to manipulate the AST to do what I want.

Building on an example PHP filter, I have:

Pandoc_Filter::toJSONFilter(function ($type, $value, $format, $meta) {
    if ('Str' == $type) {
        // use mb_convert_case instead of ucwords so filter works with 
unicode
        return mb_convert_case($value, MB_CASE_LOWER, "UTF-8");
    }
    if ('Table' == $type) {
        $attrs = array('classes' => 'table');
        // return ???
    }
});

The 'Str' manipulation works as expected, and any code I put into the 
'Table' section is executed, but I can't get started on how to proceed from 
there. Any pointers would be very welcome!

-- 
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 post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/553f3670-7cb1-402f-9a92-89f3774d17c0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

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

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

* Re: How to Assign Class to HTML Table using a Filter
       [not found] ` <553f3670-7cb1-402f-9a92-89f3774d17c0-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2019-01-30 19:06   ` John MacFarlane
       [not found]     ` <yh480kmunirmm8.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
  0 siblings, 1 reply; 12+ messages in thread
From: John MacFarlane @ 2019-01-30 19:06 UTC (permalink / raw)
  To: Ken Dow, pandoc-discuss


I don't know anything about PHP, but if you look at
the API docs for Text.Pandoc.Definition, you'll see
that the Table element doesn't have attributes
(including class).

Best you can do is insert it into a Div with
attributes.

Ken Dow <thekenshow-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:

> Hi,
>
> I'd like to assign a class to every table in my HTML output. I've got PHP 
> filters <https://github.com/glassdimly/pandocfilters-php> working but can't 
> figure out how to manipulate the AST to do what I want.
>
> Building on an example PHP filter, I have:
>
> Pandoc_Filter::toJSONFilter(function ($type, $value, $format, $meta) {
>     if ('Str' == $type) {
>         // use mb_convert_case instead of ucwords so filter works with 
> unicode
>         return mb_convert_case($value, MB_CASE_LOWER, "UTF-8");
>     }
>     if ('Table' == $type) {
>         $attrs = array('classes' => 'table');
>         // return ???
>     }
> });
>
> The 'Str' manipulation works as expected, and any code I put into the 
> 'Table' section is executed, but I can't get started on how to proceed from 
> there. Any pointers would be very welcome!
>
> -- 
> 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 post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/553f3670-7cb1-402f-9a92-89f3774d17c0%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.


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

* Re: How to Assign Class to HTML Table using a Filter
       [not found]     ` <yh480kmunirmm8.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
@ 2019-01-30 21:53       ` Ken Dow
       [not found]         ` <b411caba-b372-4f99-aca5-36c5b614c91c-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 12+ messages in thread
From: Ken Dow @ 2019-01-30 21:53 UTC (permalink / raw)
  To: pandoc-discuss


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

Hi John,

Thanks for the quick reply. Now that you've pointed it out, I can see that:

Div Attr 
<https://hackage.haskell.org/package/pandoc-types-1.17.5.4/docs/Text-Pandoc-Definition.html#t:Attr> 
[Block 
<https://hackage.haskell.org/package/pandoc-types-1.17.5.4/docs/Text-Pandoc-Definition.html#t:Block>
]

Means that a div can have attributes, but

Table [Inline 
<https://hackage.haskell.org/package/pandoc-types-1.17.5.4/docs/Text-Pandoc-Definition.html#t:Inline>
] [Alignment 
<https://hackage.haskell.org/package/pandoc-types-1.17.5.4/docs/Text-Pandoc-Definition.html#t:Alignment>
] [Double 
<https://hackage.haskell.org/package/base-4.11.1.0/docs/Prelude.html#t:Double>
] [TableCell 
<https://hackage.haskell.org/package/pandoc-types-1.17.5.4/docs/Text-Pandoc-Definition.html#t:TableCell>
] [[TableCell 
<https://hackage.haskell.org/package/pandoc-types-1.17.5.4/docs/Text-Pandoc-Definition.html#t:TableCell>
]]

A table does not have that. 

I did look at this page, but my next task is to learn how to read this 
documentation format...!

Looks like I'll need to post-process the HTML output with a separate 
script. 

On Wednesday, 30 January 2019 14:06:54 UTC-5, John MacFarlane wrote:
>
>
> I don't know anything about PHP, but if you look at 
> the API docs for Text.Pandoc.Definition, you'll see 
> that the Table element doesn't have attributes 
> (including class). 
>
> Best you can do is insert it into a Div with 
> attributes. 
>
> Ken Dow <theke...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org <javascript:>> writes: 
>
> > Hi, 
> > 
> > I'd like to assign a class to every table in my HTML output. I've got 
> PHP 
> > filters <https://github.com/glassdimly/pandocfilters-php> working but 
> can't 
> > figure out how to manipulate the AST to do what I want. 
> > 
> > Building on an example PHP filter, I have: 
> > 
> > Pandoc_Filter::toJSONFilter(function ($type, $value, $format, $meta) { 
> >     if ('Str' == $type) { 
> >         // use mb_convert_case instead of ucwords so filter works with 
> > unicode 
> >         return mb_convert_case($value, MB_CASE_LOWER, "UTF-8"); 
> >     } 
> >     if ('Table' == $type) { 
> >         $attrs = array('classes' => 'table'); 
> >         // return ??? 
> >     } 
> > }); 
> > 
> > The 'Str' manipulation works as expected, and any code I put into the 
> > 'Table' section is executed, but I can't get started on how to proceed 
> from 
> > there. Any pointers would be very welcome! 
> > 
> > -- 
> > 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-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <javascript:>. 
> > To post to this group, send email to pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org 
> <javascript:>. 
> > To view this discussion on the web visit 
> https://groups.google.com/d/msgid/pandoc-discuss/553f3670-7cb1-402f-9a92-89f3774d17c0%40googlegroups.com. 
>
> > For more options, visit https://groups.google.com/d/optout. 
>

-- 
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 post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/b411caba-b372-4f99-aca5-36c5b614c91c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

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

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

* Re: How to Assign Class to HTML Table using a Filter
       [not found]         ` <b411caba-b372-4f99-aca5-36c5b614c91c-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2019-01-31  0:37           ` John MacFarlane
  2019-01-31  1:22             ` Ken
       [not found]             ` <yh480kef8tr7aj.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
  0 siblings, 2 replies; 12+ messages in thread
From: John MacFarlane @ 2019-01-31  0:37 UTC (permalink / raw)
  To: Ken Dow, pandoc-discuss


Probably at some point we'll add attributes to Table;
it's certainly not ideal that you have to work around this!


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

* Re: How to Assign Class to HTML Table using a Filter
  2019-01-31  0:37           ` John MacFarlane
@ 2019-01-31  1:22             ` Ken
  2019-01-31  5:10               ` John MacFarlane
       [not found]             ` <yh480kef8tr7aj.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
  1 sibling, 1 reply; 12+ messages in thread
From: Ken @ 2019-01-31  1:22 UTC (permalink / raw)
  To: Ken Dow, pandoc-discuss, John MacFarlane


--5c524f3d_2eb141f2_3458
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

That would be great - it comes up because frameworks like Bootstrap and S=
pectre uses <table class=3D=E2=80=9Ctable=E2=80=9D> to apply their stylin=
g.

Thanks for a brilliant tool BTW=21 =46inally getting a chance to apply it=
 to a client project.

=E2=80=94
Cheers
Ken

+1 (519) 270-5338 =7C https://kendow.com

The place where you are is called here,
And you must treat it as a powerful stranger.
- David Wagoner
On Jan 30, 2019, 7:37 PM -0500, John Mac=46arlane <jgm=40berkeley.edu>, w=
rote:
>
> Probably at some point we'll add attributes to Table;
> it's certainly not ideal that you have to work around this=21
>

--5c524f3d_2eb141f2_3458
Content-Type: text/html; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

<html xmlns=3D=22http://www.w3.org/1999/xhtml=22>
<head>
<title></title>
</head>
<body>
<div name=3D=22messageBodySection=22>That would be great - it comes up be=
cause frameworks like Bootstrap and Spectre uses &lt;table class=3D=E2=80=
=9Ctable=E2=80=9D&gt; to apply their styling.&=23160;
<div><br /></div>
<div>Thanks for a brilliant tool BTW=21 =46inally getting a chance to app=
ly it to a client project. &=23160;</div>
</div>
<div name=3D=22messageSignatureSection=22><br />
<i>=E2=80=94<br />
Cheers<br />
Ken<br />
<br />
+1 (519) 270-5338 =7C <a href=3D=22https://kendow.com=22>https://kendow.c=
om</a><br />
<br />
The place where you are is called here,</i>
<div><i>And you must treat it as a powerful stranger.</i></div>
<div><i>- David Wagoner</i></div>
</div>
<div name=3D=22messageReplySection=22>On Jan 30, 2019, 7:37 PM -0500, Joh=
n Mac=46arlane &lt;jgm=40berkeley.edu&gt;, wrote:<br />
<blockquote type=3D=22cite=22 style=3D=22margin: 5px 5px; padding-left: 1=
0px; border-left: thin solid =231abc9c;=22><br />
Probably at some point we'll add attributes to Table;<br />
it's certainly not ideal that you have to work around this=21<br />
<br /></blockquote>
</div>
</body>
</html>

--5c524f3d_2eb141f2_3458--

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

* Re: How to Assign Class to HTML Table using a Filter
       [not found]             ` <yh480kef8tr7aj.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
@ 2019-01-31  2:51               ` Ken Dow
  0 siblings, 0 replies; 12+ messages in thread
From: Ken Dow @ 2019-01-31  2:51 UTC (permalink / raw)
  To: pandoc-discuss

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

That would be great - it comes up because frameworks like Bootstrap and Spectre use a “table” class to apply their styling.

Thanks for a brilliant tool, BTW! Finally getting a chance to apply it to a client project.

-- 
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 post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/ec1f587b-a756-46af-9662-e56ff972811f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

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

* Re: How to Assign Class to HTML Table using a Filter
  2019-01-31  1:22             ` Ken
@ 2019-01-31  5:10               ` John MacFarlane
       [not found]                 ` <m2k1ilxvhf.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
  0 siblings, 1 reply; 12+ messages in thread
From: John MacFarlane @ 2019-01-31  5:10 UTC (permalink / raw)
  To: Ken, Ken Dow, pandoc-discuss

Ken <thekenshow-97jfqw80gc5Wk0Htik3J/w@public.gmane.org> writes:

> That would be great - it comes up because frameworks like Bootstrap and Spectre uses <table class=“table”> to apply their styling.

That's true.  It's tempting to just add that class by
default in the HTML writer...  I wonder if that would
cause any problems?

-- 
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 post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/m2k1ilxvhf.fsf%40johnmacfarlane.net.
For more options, visit https://groups.google.com/d/optout.


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

* Re: How to Assign Class to HTML Table using a Filter
       [not found]                 ` <m2k1ilxvhf.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
@ 2019-01-31 12:52                   ` Ken Dow
       [not found]                     ` <fdd9a7c1-f66f-4116-bbff-2ee91842c4a8-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 12+ messages in thread
From: Ken Dow @ 2019-01-31 12:52 UTC (permalink / raw)
  To: pandoc-discuss


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

It's not uncommon for people to use unbordered tables for layout in DOCX. 
Adding a "table" class automatically would produce HTML borders where they 
weren't intended.

In your first response to this, you suggested "insert it into a Div with 
attributes". Is there some way to achieve that with a DOCX source?

On Thursday, 31 January 2019 00:11:10 UTC-5, John MacFarlane wrote:
>
> Ken <theke...-97jfqw80gc5Wk0Htik3J/w@public.gmane.org <javascript:>> writes: 
>
> > That would be great - it comes up because frameworks like Bootstrap and 
> Spectre uses <table class=“table”> to apply their styling. 
>
> That's true.  It's tempting to just add that class by 
> default in the HTML writer...  I wonder if that would 
> cause any problems? 
>
>

-- 
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 post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/fdd9a7c1-f66f-4116-bbff-2ee91842c4a8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

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

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

* Re: How to Assign Class to HTML Table using a Filter
       [not found]                     ` <fdd9a7c1-f66f-4116-bbff-2ee91842c4a8-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2019-01-31 15:06                       ` John MacFarlane
       [not found]                         ` <m25zu4yigh.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
  0 siblings, 1 reply; 12+ messages in thread
From: John MacFarlane @ 2019-01-31 15:06 UTC (permalink / raw)
  To: Ken Dow, pandoc-discuss


Adding a 'table' class wouldn't affect docx output
unless we specifically modified the docx writer to behave
differently in that case.

Ken Dow <thekenshow-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:

> It's not uncommon for people to use unbordered tables for layout in DOCX. 
> Adding a "table" class automatically would produce HTML borders where they 
> weren't intended.
>
> In your first response to this, you suggested "insert it into a Div with 
> attributes". Is there some way to achieve that with a DOCX source?
>
> On Thursday, 31 January 2019 00:11:10 UTC-5, John MacFarlane wrote:
>>
>> Ken <theke...-97jfqw80gc5Wk0Htik3J/w@public.gmane.org <javascript:>> writes: 
>>
>> > That would be great - it comes up because frameworks like Bootstrap and 
>> Spectre uses <table class=“table”> to apply their styling. 
>>
>> That's true.  It's tempting to just add that class by 
>> default in the HTML writer...  I wonder if that would 
>> cause any problems? 
>>
>>
>
> -- 
> 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 post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/fdd9a7c1-f66f-4116-bbff-2ee91842c4a8%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
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 post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/m25zu4yigh.fsf%40johnmacfarlane.net.
For more options, visit https://groups.google.com/d/optout.


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

* Re: How to Assign Class to HTML Table using a Filter
       [not found]                         ` <m25zu4yigh.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
@ 2019-01-31 15:09                           ` John MacFarlane
       [not found]                             ` <m236p8yicd.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
  0 siblings, 1 reply; 12+ messages in thread
From: John MacFarlane @ 2019-01-31 15:09 UTC (permalink / raw)
  To: Ken Dow, pandoc-discuss


To be more precise:  The suggestion above was just to
add the 'table' class to the default HTML output, not
to docx output.

I believe the reason bootstrap et al only style tables
with class 'table' is to distinguish "real" tables
from tables used for layout (e.g. columns) in HTML.
However, it seems to me that all pandoc-produced
tables should be real tables. There may be exceptions,
though -- do people use pandoc tables for layout in
HTML?

John MacFarlane <jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org> writes:

> Adding a 'table' class wouldn't affect docx output
> unless we specifically modified the docx writer to behave
> differently in that case.
>
> Ken Dow <thekenshow-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:
>
>> It's not uncommon for people to use unbordered tables for layout in DOCX. 
>> Adding a "table" class automatically would produce HTML borders where they 
>> weren't intended.
>>
>> In your first response to this, you suggested "insert it into a Div with 
>> attributes". Is there some way to achieve that with a DOCX source?
>>
>> On Thursday, 31 January 2019 00:11:10 UTC-5, John MacFarlane wrote:
>>>
>>> Ken <theke...-97jfqw80gc5Wk0Htik3J/w@public.gmane.org <javascript:>> writes: 
>>>
>>> > That would be great - it comes up because frameworks like Bootstrap and 
>>> Spectre uses <table class=“table”> to apply their styling. 
>>>
>>> That's true.  It's tempting to just add that class by 
>>> default in the HTML writer...  I wonder if that would 
>>> cause any problems? 
>>>
>>>
>>
>> -- 
>> 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 post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>> To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/fdd9a7c1-f66f-4116-bbff-2ee91842c4a8%40googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.

-- 
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 post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/m236p8yicd.fsf%40johnmacfarlane.net.
For more options, visit https://groups.google.com/d/optout.


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

* Re: How to Assign Class to HTML Table using a Filter
       [not found]                             ` <m236p8yicd.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
@ 2019-01-31 16:49                               ` Ken Dow
       [not found]                                 ` <ae8d390d-1006-4c90-96ed-3f921f7a0dfa-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 12+ messages in thread
From: Ken Dow @ 2019-01-31 16:49 UTC (permalink / raw)
  To: pandoc-discuss


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

Right, understood. I agree that the "table" class enables a distinction 
between layout tables and real ones. My case is DOCX -> HTML, however, 
something like:

pandoc -s sourcetest.docx --reference-doc=custom-reference.docx --extract-
media=./ --css=css/spectre.css -t html -o sourcetest.html

If the HTML writer were to add the "table" class universally, then tables 
used for layout *in the source DOCX* would end up with borders (assuming 
Bootstrap et al).

On Thursday, 31 January 2019 10:09:36 UTC-5, John MacFarlane wrote:
>
>
> To be more precise:  The suggestion above was just to 
> add the 'table' class to the default HTML output, not 
> to docx output. 
>
> I believe the reason bootstrap et al only style tables 
> with class 'table' is to distinguish "real" tables 
> from tables used for layout (e.g. columns) in HTML. 
> However, it seems to me that all pandoc-produced 
> tables should be real tables. There may be exceptions, 
> though -- do people use pandoc tables for layout in 
> HTML? 
>
> John MacFarlane <j...-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org <javascript:>> writes: 
>
> > Adding a 'table' class wouldn't affect docx output 
> > unless we specifically modified the docx writer to behave 
> > differently in that case. 
> > 
> > Ken Dow <theke...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org <javascript:>> writes: 
> > 
> >> It's not uncommon for people to use unbordered tables for layout in 
> DOCX. 
> >> Adding a "table" class automatically would produce HTML borders where 
> they 
> >> weren't intended. 
> >> 
> >> In your first response to this, you suggested "insert it into a Div 
> with 
> >> attributes". Is there some way to achieve that with a DOCX source? 
> >> 
> >> On Thursday, 31 January 2019 00:11:10 UTC-5, John MacFarlane wrote: 
> >>> 
> >>> Ken <theke...-97jfqw80gc5Wk0Htik3J/w@public.gmane.org <javascript:>> writes: 
> >>> 
> >>> > That would be great - it comes up because frameworks like Bootstrap 
> and 
> >>> Spectre uses <table class=“table”> to apply their styling. 
> >>> 
> >>> That's true.  It's tempting to just add that class by 
> >>> default in the HTML writer...  I wonder if that would 
> >>> cause any problems? 
> >>> 
> >>> 
> >> 
> >> -- 
> >> 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-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <javascript:>. 
> >> To post to this group, send email to pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org 
> <javascript:>. 
> >> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/pandoc-discuss/fdd9a7c1-f66f-4116-bbff-2ee91842c4a8%40googlegroups.com. 
>
> >> For more options, visit https://groups.google.com/d/optout. 
>

-- 
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 post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/ae8d390d-1006-4c90-96ed-3f921f7a0dfa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

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

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

* Re: How to Assign Class to HTML Table using a Filter
       [not found]                                 ` <ae8d390d-1006-4c90-96ed-3f921f7a0dfa-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2019-01-31 19:08                                   ` John MacFarlane
  0 siblings, 0 replies; 12+ messages in thread
From: John MacFarlane @ 2019-01-31 19:08 UTC (permalink / raw)
  To: Ken Dow, pandoc-discuss


I see the issue.  Of course, if you go to latex or
another format, you'll get a formatted table from
this input.  So one might ask why HTML should be different.

Ken Dow <thekenshow-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:

> Right, understood. I agree that the "table" class enables a distinction 
> between layout tables and real ones. My case is DOCX -> HTML, however, 
> something like:
>
> pandoc -s sourcetest.docx --reference-doc=custom-reference.docx --extract-
> media=./ --css=css/spectre.css -t html -o sourcetest.html
>
> If the HTML writer were to add the "table" class universally, then tables 
> used for layout *in the source DOCX* would end up with borders (assuming 
> Bootstrap et al).
>
> On Thursday, 31 January 2019 10:09:36 UTC-5, John MacFarlane wrote:
>>
>>
>> To be more precise:  The suggestion above was just to 
>> add the 'table' class to the default HTML output, not 
>> to docx output. 
>>
>> I believe the reason bootstrap et al only style tables 
>> with class 'table' is to distinguish "real" tables 
>> from tables used for layout (e.g. columns) in HTML. 
>> However, it seems to me that all pandoc-produced 
>> tables should be real tables. There may be exceptions, 
>> though -- do people use pandoc tables for layout in 
>> HTML? 
>>
>> John MacFarlane <j...-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org <javascript:>> writes: 
>>
>> > Adding a 'table' class wouldn't affect docx output 
>> > unless we specifically modified the docx writer to behave 
>> > differently in that case. 
>> > 
>> > Ken Dow <theke...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org <javascript:>> writes: 
>> > 
>> >> It's not uncommon for people to use unbordered tables for layout in 
>> DOCX. 
>> >> Adding a "table" class automatically would produce HTML borders where 
>> they 
>> >> weren't intended. 
>> >> 
>> >> In your first response to this, you suggested "insert it into a Div 
>> with 
>> >> attributes". Is there some way to achieve that with a DOCX source? 
>> >> 
>> >> On Thursday, 31 January 2019 00:11:10 UTC-5, John MacFarlane wrote: 
>> >>> 
>> >>> Ken <theke...-97jfqw80gc5Wk0Htik3J/w@public.gmane.org <javascript:>> writes: 
>> >>> 
>> >>> > That would be great - it comes up because frameworks like Bootstrap 
>> and 
>> >>> Spectre uses <table class=“table”> to apply their styling. 
>> >>> 
>> >>> That's true.  It's tempting to just add that class by 
>> >>> default in the HTML writer...  I wonder if that would 
>> >>> cause any problems? 
>> >>> 
>> >>> 
>> >> 
>> >> -- 
>> >> 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-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <javascript:>. 
>> >> To post to this group, send email to pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org 
>> <javascript:>. 
>> >> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/pandoc-discuss/fdd9a7c1-f66f-4116-bbff-2ee91842c4a8%40googlegroups.com. 
>>
>> >> For more options, visit https://groups.google.com/d/optout. 
>>
>
> -- 
> 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 post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/ae8d390d-1006-4c90-96ed-3f921f7a0dfa%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
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 post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/yh480k36p8r6ge.fsf%40johnmacfarlane.net.
For more options, visit https://groups.google.com/d/optout.


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

end of thread, other threads:[~2019-01-31 19:08 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-30 14:50 How to Assign Class to HTML Table using a Filter Ken Dow
     [not found] ` <553f3670-7cb1-402f-9a92-89f3774d17c0-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2019-01-30 19:06   ` John MacFarlane
     [not found]     ` <yh480kmunirmm8.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
2019-01-30 21:53       ` Ken Dow
     [not found]         ` <b411caba-b372-4f99-aca5-36c5b614c91c-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2019-01-31  0:37           ` John MacFarlane
2019-01-31  1:22             ` Ken
2019-01-31  5:10               ` John MacFarlane
     [not found]                 ` <m2k1ilxvhf.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
2019-01-31 12:52                   ` Ken Dow
     [not found]                     ` <fdd9a7c1-f66f-4116-bbff-2ee91842c4a8-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2019-01-31 15:06                       ` John MacFarlane
     [not found]                         ` <m25zu4yigh.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
2019-01-31 15:09                           ` John MacFarlane
     [not found]                             ` <m236p8yicd.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
2019-01-31 16:49                               ` Ken Dow
     [not found]                                 ` <ae8d390d-1006-4c90-96ed-3f921f7a0dfa-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2019-01-31 19:08                                   ` John MacFarlane
     [not found]             ` <yh480kef8tr7aj.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
2019-01-31  2:51               ` Ken Dow

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