public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* pandoc from org-mode file to gfm doesn't generate correct table
@ 2019-10-04 18:39 Sturm Mabie
       [not found] ` <27c12987-7101-49af-aefd-b25eb7d17f59-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Sturm Mabie @ 2019-10-04 18:39 UTC (permalink / raw)
  To: pandoc-discuss


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

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.

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

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

* Re: pandoc from org-mode file to gfm doesn't generate correct table
       [not found] ` <27c12987-7101-49af-aefd-b25eb7d17f59-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2019-10-04 20:19   ` John MacFarlane
  0 siblings, 0 replies; 2+ messages in thread
From: John MacFarlane @ 2019-10-04 20:19 UTC (permalink / raw)
  To: Sturm Mabie, pandoc-discuss


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.


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

end of thread, other threads:[~2019-10-04 20:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-04 18:39 pandoc from org-mode file to gfm doesn't generate correct table Sturm Mabie
     [not found] ` <27c12987-7101-49af-aefd-b25eb7d17f59-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2019-10-04 20:19   ` 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).