public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
From: John MacFarlane <jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org>
To: Chanamel Ungar
	<Chanamel-Rw1WCSvBAmdUkLafFIKz2WXnswh1EIUO@public.gmane.org>,
	pandoc-discuss
	<pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
Subject: Re: Adding boilerplate text in docx
Date: Wed, 15 Dec 2021 10:21:38 -0800	[thread overview]
Message-ID: <yh480k7dc5g24t.fsf@johnmacfarlane.net> (raw)
In-Reply-To: <d7950765-fa28-41f1-88f5-fd14aba9de82n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>

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
```


      parent reply	other threads:[~2021-12-15 18:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-15 14:46 Chanamel Ungar
     [not found] ` <d7950765-fa28-41f1-88f5-fd14aba9de82n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2021-12-15 18:21   ` John MacFarlane [this message]

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=yh480k7dc5g24t.fsf@johnmacfarlane.net \
    --to=jgm-tvlzxgkolnx2fbvcvol8/a@public.gmane.org \
    --cc=Chanamel-Rw1WCSvBAmdUkLafFIKz2WXnswh1EIUO@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).