public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* Adding boilerplate text in docx
@ 2021-12-15 14:46 Chanamel Ungar
       [not found] ` <d7950765-fa28-41f1-88f5-fd14aba9de82n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Chanamel Ungar @ 2021-12-15 14:46 UTC (permalink / raw)
  To: pandoc-discuss


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

Hey,

Currently have a few issues with the docx transformation I wonder if you 
good folks could help me with:

1. I have some boilerplate text that needs to be inserted in *most*, but 
not all docx generated from a source markdown file. It needs to appear as a 
footnote of the first page of the document. What would be the best way to 
do this?

2. Currently, the date in the generated docx is automatically set to today. 
Is there any way to pass in a specific date into the document?

3. Is there any way in markdown to create tables with merged cells?

I.e. 

| A | B |
-----------
|fruit | apple |    80kcal     |
|       |  pear  |       60kcal   |
| veg | carrot | 30kcal |


The fruit cell should be merged


-- 
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/d7950765-fa28-41f1-88f5-fd14aba9de82n%40googlegroups.com.

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

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

* Re: Adding boilerplate text in docx
       [not found] ` <d7950765-fa28-41f1-88f5-fd14aba9de82n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2021-12-15 18:21   ` John MacFarlane
  0 siblings, 0 replies; 2+ messages in thread
From: John MacFarlane @ 2021-12-15 18:21 UTC (permalink / raw)
  To: Chanamel Ungar, pandoc-discuss

Chanamel Ungar <Chanamel-Rw1WCSvBAmdUkLafFIKz2WXnswh1EIUO@public.gmane.org> writes:

> Hey,
>
> Currently have a few issues with the docx transformation I wonder if you
> good folks could help me with:
>
> 1. I have some boilerplate text that needs to be inserted in *most*, but
> not all docx generated from a source markdown file. It needs to appear as a
> footnote of the first page of the document. What would be the best way to
> do this?

It would be relatively easy to write a filter that adds a
footnote to an element, say the title.

> 2. Currently, the date in the generated docx is automatically set to today.
> Is there any way to pass in a specific date into the document?

Yes, if you're going from markdown, just include the date in your metadata:

---
title: Whatever
date: July 3, 2021
...

> 3. Is there any way in markdown to create tables with merged cells?
>
> I.e.
>
> | A | B |
> -----------
> |fruit | apple |    80kcal     |
> |       |  pear  |       60kcal   |
> | veg | carrot | 30kcal |

No, not with native md tables.  But you could include an HTML
table and use a special filter to parse it.

This is due to BPJ on this list:
https://groups.google.com/g/pandoc-discuss/c/seVGKkR-bKQ/m/UoOUx8GxAAAJ


```lua
function RawBlock (raw)
  if 'html' == raw.format then
    local html = raw.text
    local doc = pandoc.read(html, 'html')
    if doc then return doc.blocks end
  end
  return nil
end
```


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

end of thread, other threads:[~2021-12-15 18:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-15 14:46 Adding boilerplate text in docx Chanamel Ungar
     [not found] ` <d7950765-fa28-41f1-88f5-fd14aba9de82n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2021-12-15 18:21   ` 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).