public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* Modifying docx table output
@ 2015-09-07 12:17 Flurin Egger
       [not found] ` <4d896acd-80e8-44e2-a612-94914f410dba-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Flurin Egger @ 2015-09-07 12:17 UTC (permalink / raw)
  To: pandoc-discuss


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

Hi,

I'm currently trying to create a filter that will take all tables and 
convert them by hand as I don't want them to have the styling generated in 
the docx writer. So my idea was to create a filter that uses a modified 
part of the `blockToOpenXML` function to output an XML string that I could 
use as input for a `RawBlock`.

The problem is that I now need to manually process all blocks/inlines 
within the table as well.  So I practically have to write a custom 
DocxWriter (apart from header/styles/etc. handling). 

I don't think this is the best approach. Does anyone have suggestions on 
how to do this? Can the DocxWriter module expose a function to convert 
Blocks/Inlinse to docx XML?

Regards,
Flurin

-- 
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/4d896acd-80e8-44e2-a612-94914f410dba%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

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

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

* Re: Modifying docx table output
       [not found] ` <4d896acd-80e8-44e2-a612-94914f410dba-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2015-09-08 17:40   ` John MACFARLANE
       [not found]     ` <20150908174031.GB27464-4kKid1p5UN4xFjuZnxJpBp3lxR28IOakuDuwTybUTCk@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: John MACFARLANE @ 2015-09-08 17:40 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

+++ Flurin Egger [Sep 07 15 05:17 ]:
>   Hi,
>   I'm currently trying to create a filter that will take all tables and
>   convert them by hand as I don't want them to have the styling generated
>   in the docx writer. So my idea was to create a filter that uses a
>   modified part of the `blockToOpenXML` function to output an XML string
>   that I could use as input for a `RawBlock`.
>   The problem is that I now need to manually process all blocks/inlines
>   within the table as well.  So I practically have to write a custom
>   DocxWriter (apart from header/styles/etc. handling).
>   I don't think this is the best approach. Does anyone have suggestions
>   on how to do this? Can the DocxWriter module expose a function to
>   convert Blocks/Inlinse to docx XML?

Ideally the writer would be structured this way.  The
problem is that many docx constructs require coordination
between the generation of the xml and other things that
go in the docx container.  For example, footnotes go in
a separate file.

Anyway, it might be possible to rewrite the writer, but
with the current architecture, there's no way to get just
the XML.


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

* Re: Modifying docx table output
       [not found]     ` <20150908174031.GB27464-4kKid1p5UN4xFjuZnxJpBp3lxR28IOakuDuwTybUTCk@public.gmane.org>
@ 2015-09-09  7:22       ` Flurin Egger
       [not found]         ` <0ccea60d-28c7-4ca7-ad1e-c1f46d0b6c0b-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Flurin Egger @ 2015-09-09  7:22 UTC (permalink / raw)
  To: pandoc-discuss


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

Hmmm, too bad. I have indeed seen that some constructs modify the 
writerstate. 

To circumvent this issue I'm writing a custom yaml bit in a codeblock that 
will create the tables for me.

Alternatively, is it possible to write your own custom writer in Haskell? 
In the docs I only find stuff about writing them in Lua but I'd rather 
build on the current docx writer.

On Tuesday, September 8, 2015 at 7:40:45 PM UTC+2, John MacFarlane wrote:
>
> +++ Flurin Egger [Sep 07 15 05:17 ]: 
> >   Hi, 
> >   I'm currently trying to create a filter that will take all tables and 
> >   convert them by hand as I don't want them to have the styling 
> generated 
> >   in the docx writer. So my idea was to create a filter that uses a 
> >   modified part of the `blockToOpenXML` function to output an XML string 
> >   that I could use as input for a `RawBlock`. 
> >   The problem is that I now need to manually process all blocks/inlines 
> >   within the table as well.  So I practically have to write a custom 
> >   DocxWriter (apart from header/styles/etc. handling). 
> >   I don't think this is the best approach. Does anyone have suggestions 
> >   on how to do this? Can the DocxWriter module expose a function to 
> >   convert Blocks/Inlinse to docx XML? 
>
> Ideally the writer would be structured this way.  The 
> problem is that many docx constructs require coordination 
> between the generation of the xml and other things that 
> go in the docx container.  For example, footnotes go in 
> a separate file. 
>
> Anyway, it might be possible to rewrite the writer, but 
> with the current architecture, there's no way to get just 
> the XML. 
>
>

-- 
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/0ccea60d-28c7-4ca7-ad1e-c1f46d0b6c0b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

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

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

* Re: Modifying docx table output
       [not found]         ` <0ccea60d-28c7-4ca7-ad1e-c1f46d0b6c0b-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2015-09-09 16:26           ` John MACFARLANE
  0 siblings, 0 replies; 4+ messages in thread
From: John MACFARLANE @ 2015-09-09 16:26 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

+++ Flurin Egger [Sep 09 15 00:22 ]:
>   Hmmm, too bad. I have indeed seen that some constructs modify the
>   writerstate.
>   To circumvent this issue I'm writing a custom yaml bit in a codeblock
>   that will create the tables for me.
>   Alternatively, is it possible to write your own custom writer in
>   Haskell? In the docs I only find stuff about writing them in Lua but
>   I'd rather build on the current docx writer.

You can write your own custom writer, but you'd have to do a
custom build of pandoc -- you can't just integrate something
with an existing pandoc binary as you can with the lua
writers.


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

end of thread, other threads:[~2015-09-09 16:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-07 12:17 Modifying docx table output Flurin Egger
     [not found] ` <4d896acd-80e8-44e2-a612-94914f410dba-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2015-09-08 17:40   ` John MACFARLANE
     [not found]     ` <20150908174031.GB27464-4kKid1p5UN4xFjuZnxJpBp3lxR28IOakuDuwTybUTCk@public.gmane.org>
2015-09-09  7:22       ` Flurin Egger
     [not found]         ` <0ccea60d-28c7-4ca7-ad1e-c1f46d0b6c0b-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2015-09-09 16:26           ` John MACFARLANE

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