public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
From: John MacFarlane <jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org>
To: Sturm Mabie <sturm-t1kUVyXlVBodnm+yROfE0A@public.gmane.org>,
	pandoc-discuss
	<pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
Subject: Re: pandoc from org-mode file to gfm doesn't generate correct table
Date: Fri, 04 Oct 2019 13:19:10 -0700	[thread overview]
Message-ID: <yh480kv9t4xo01.fsf@johnmacfarlane.net> (raw)
In-Reply-To: <27c12987-7101-49af-aefd-b25eb7d17f59-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>


gfm doesn't handle YAML metadata because it's a pandoc extension.

In principle we could wire up the gfm writer so you can do
gfm+yaml_metadata_block, but currently you can't.

You can force pandoc's regular markdown output to use pipe
tables by disabling other table styles:

  pandoc -t markdown-simple_tables-multiline_tables-grid_tables

Sturm Mabie <sturm-t1kUVyXlVBodnm+yROfE0A@public.gmane.org> writes:

> I'm trying to convert an org file that has a table that looks like this:
>
>   | Portfolio | Return | Volatility | Leverage | Pre-drag Return | 
> Post-drag Return |
>   
> |-----------+--------+------------+----------+-----------------+------------------|
>   | A         |     1% |         1% |        5 |          5.025% 
> |             4.9% |
>   | B         |     5% |         5% |        1 |          5.125% 
> |               5% |
>   | C         |    10% |        10% |      0.5 |           5.25% 
> |           5.125% |
>
> I run:
>
> $ pandoc vol.org -t markdown+pipe_tables -so out.md
>
> Instead of a pipe_table I get:
>
>   Portfolio   Return   Volatility   Leverage   Pre-drag Return   Post-drag 
> Return
>   ----------- -------- ------------ ---------- ----------------- 
> ------------------
>   A           1%       1%           5          5.025%            4.9%
>   B           5%       5%           1          5.125%            5%
>   C           10%      10%          0.5        5.25%             5.125%
>
> Note that using:
>
> $ pandoc vol.org -t gfm -so out.md
>
> I get a nice pipe_table:
>
> | Portfolio | Return | Volatility | Leverage | Pre-drag Return | Post-drag 
> Return |
> | --------- | ------ | ---------- | -------- | --------------- | 
> ---------------- |
> | A         | 1%     | 1%         | 5        | 5.025%          | 
> 4.9%             |
> | B         | 5%     | 5%         | 1        | 5.125%          | 
> 5%               |
> | C         | 10%    | 10%        | 0.5      | 5.25%           | 
> 5.125%           |
>
> But unfortunately does not generate the front-matter:
>
> ---
> category: Posts
> date: '2019-10-04'
> mathjax: true
> startup: showeverything
> ---
>
> I need the front matter since I'm using Jekyll to host the markdown files. 
>
> So my question is: How can I get the front-matter along with the pipe 
> tables? Why is gfm stripping my front-matter?
>
> Thanks!
>
> -- 
> 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/27c12987-7101-49af-aefd-b25eb7d17f59%40googlegroups.com.


      parent reply	other threads:[~2019-10-04 20:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-04 18:39 Sturm Mabie
     [not found] ` <27c12987-7101-49af-aefd-b25eb7d17f59-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2019-10-04 20:19   ` 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=yh480kv9t4xo01.fsf@johnmacfarlane.net \
    --to=jgm-tvlzxgkolnx2fbvcvol8/a@public.gmane.org \
    --cc=pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org \
    --cc=sturm-t1kUVyXlVBodnm+yROfE0A@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).