From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/18398 Path: news.gmane.org!.POSTED!not-for-mail From: Kolen Cheung Newsgroups: gmane.text.pandoc Subject: Re: pandoc transform between markdown and rst support Chinese character not well? Date: Fri, 27 Oct 2017 01:42:21 -0700 (PDT) Message-ID: References: <4f48a015-3dc7-f663-81d5-a1d74333304b@gmail.com> <20171019161034.GC73240@protagoras> <20171020162833.GB33085@protagoras> <20171021160255.GC88234@Johns-MacBook-Pro.local> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_812_1984658853.1509093742097" X-Trace: blaine.gmane.org 1509093749 6270 195.159.176.226 (27 Oct 2017 08:42:29 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 27 Oct 2017 08:42:29 +0000 (UTC) To: pandoc-discuss Original-X-From: pandoc-discuss+bncBCS252WXTEIBB3XCZPHQKGQE2NQNIJY-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Fri Oct 27 10:42:24 2017 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane.org Original-Received: from mail-oi0-f62.google.com ([209.85.218.62]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e80DY-0000IW-B0 for gtp-pandoc-discuss@m.gmane.org; Fri, 27 Oct 2017 10:42:16 +0200 Original-Received: by mail-oi0-f62.google.com with SMTP id f66sf6209383oib.1 for ; Fri, 27 Oct 2017 01:42:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:date:from:to:message-id:in-reply-to:references:subject :mime-version:x-original-sender:reply-to:precedence:mailing-list :list-id:list-post:list-help:list-archive:list-subscribe :list-unsubscribe; bh=S5t8tecs8YX99DHjuAUCZhASfiUz5GCKelJgMmY5Q5I=; b=CqPGTHcgBAJel3u/tzz/+/HnJvgGndzA2IQ6YEHIAu5JBnRApAAnY6Gy5EK0oaToM2 pDepygnH1bzifbR4jKp/FJC73UoEY90nWmAUnNTPlGjscbXw+1xhXnBS82nwrkPAyn9q V9DaXvccP3wNGPH0MwQO5yuSpkb4CU5LleAU6s9niSl81Y6oFYpwdRRkL5FWgoa8JWOi iDiYMmPdtBvXsGH35SSshhu6V/clawKahlCrlprV+jOuFb8aYcGeUpg7llx41KX1kNwq yrxf8ep+Mdm9BGJiXUu1GtC4bqHjH7D9MZpVx7/ciLspPiA0s+5D5A7Ossqpo7Z6d519 lEnA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:message-id:in-reply-to:references:subject:mime-version :x-original-sender:reply-to:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-subscribe:list-unsubscribe; bh=S5t8tecs8YX99DHjuAUCZhASfiUz5GCKelJgMmY5Q5I=; b=DSyeg1wvcjS7zAu1LyALferabNwILdcfUPYfmq9dfUk9eg6D4Q31tWRvZknnyl/jHR X/3bVSs28gkdhPe2ytvJUlb/Lq3vP7BVTFu9NuQPN4HMMJ2uYyA9JkKrzcfvxQgrYjrz 4l534u6ko3iu35lvwUo9bGusXJTBcZKH1powkCsmXq4+wO3X0vghVo4gCA6P0PDjBVir 06TTM/AtRLc7aOdXM+fuu4/T9aQhY+eYuiaydXBuS8o0qun0VDxsKlMRYOPV98Ou2cU0 hE63xDmXi79Z58TqYFkdNWDd09HdClynUGmu3Uz9l2NBUdPmRE/uykNuSsWBM9R2r1Z0 8L7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:date:from:to:message-id:in-reply-to :references:subject:mime-version:x-original-sender:reply-to :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post :list-help:list-archive:list-subscribe:list-unsubscribe; bh=S5t8tecs8YX99DHjuAUCZhASfiUz5GCKelJgMmY5Q5I=; b=eHapmODcbGq4rflElJbxxIfbhMtBgAJ/qGq5H74gRoPGhtp0+V19CQliaTuifSWTri ZQwKI7BjsnPGqCFYmFx9jgUe2mpXm3k15XwsQ1gmHDxOqM4Mw2A7ldosn0H01JyEekIs 9DEgxTh/c/6xILnulX3Gp57ovwcl4y3by3vtbrqwULFmAqbIOVLzDj5D1kbLXGj6uwiI PXjctzK9c3Mmkhyban1GdVGWJYrg48j2vmGOFDc7Yf3fJ41hQ6LNjdJif4U8p7pLbiFf /nLwi1cR4wAEKpjw+OCxTsZU37bLLvpvWVi4v03gddz9m4kwEEpuRKbae3kcKBRz1DYc 71jw== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AMCzsaUMnx+FmIcz8mn9KRwWB17KlNRlFvj3mvfG5R1gh/1OnqansJPT HfPtu1/D7B7Bh838iQTozNg= X-Google-Smtp-Source: ABhQp+TERn6nA2x7XMEpr00+0zYUB0UaAJTBlFLY3A7aMRmFcCGbcaH+ygvFUqbn7g83iLx3xq1unQ== X-Received: by 10.157.85.8 with SMTP id l8mr275446oth.7.1509093743577; Fri, 27 Oct 2017 01:42:23 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 10.202.172.148 with SMTP id v142ls2118932oie.17.gmail; Fri, 27 Oct 2017 01:42:22 -0700 (PDT) X-Received: by 10.157.7.51 with SMTP id 48mr177370ote.11.1509093742673; Fri, 27 Oct 2017 01:42:22 -0700 (PDT) In-Reply-To: X-Original-Sender: christian.kolen-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org Precedence: list Mailing-list: list pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org; contact pandoc-discuss+owners-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org List-ID: X-Google-Group-Id: 1007024079513 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , Xref: news.gmane.org gmane.text.pandoc:18398 Archived-At: ------=_Part_812_1984658853.1509093742097 Content-Type: multipart/alternative; boundary="----=_Part_813_2052872526.1509093742097" ------=_Part_813_2052872526.1509093742097 Content-Type: text/plain; charset="UTF-8" If you just want to convert the table "just like when it was in markdown format", then you should set a high column width. Have you tried it yet? Another option is not to use pipe table but grid table in your markdown source, provided that you have an easy way to edit grid table. If filter is an option, you could try . e.g. you could convert your markdown to markdown with pantable2csv, to convert your table to csv format first, and then add a yaml in the csv table block to manually specify width, and then convert the 2nd markdown to RST. (You might then ask if it is possible to pipe the 3 through automatically without manual editing the CSV table. For now the answer is no, because Table in pandoc cannot have attributes, so it is difficult to be able to provide this information to pantable. In general, table in pandoc (and markdown in general) is complicated (e.g. there are 4 different table formats). Sooner or later, a pandoc user probably will discover some caveats and subtlety among the 4 formats, and for example how other parameters like the column width might affect its behavior. Sometimes we might feel cursed and wish things were different, but we are blessed at least because pandoc has been consistent, and is scriptable and extensible (through the filter system). Another suggestion I might make is not to use Sphinx. Pandoc can write to HTML directly, have a template system that gives you a certain level of control on the output, plus a ton of "pandoc-extras" ecosystem to generate websites (see more on the pandoc wiki on GitHub). May be you can help me understand why one would do md-rst-html conversion but not md-html directly. I think it is kind of backward. If you want to use Sphinx, then probably you should really write in RST. Pandoc also reads RST (with some limitations) which might be useful if you want to cover something Sphinx can't do. On Sunday, October 22, 2017 at 6:28:27 PM UTC-7, iromise wrote: > > yeah, there might not be some perfect methods, but I think the table can > show just like when it was in markdown format. > > 2017-10-22 0:02 GMT+08:00 John MacFarlane > >: > >> Where should it split, if there is no space for guidance? >> >> One option for RST tables would be to artificially split >> at some arbitrary location when the whole string won't fit. >> But this is going to give ugly results in general. >> >> +++ Baozheng Liu [Oct 21 17 15:56 ]: >> >>> But I think that may be pandoc should split the line for us since it >>> may take us a lot of time to make sure that space is regular... >>> >>> 2017-10-21 0:28 GMT+08:00 John MACFARLANE <[1]j...-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org >>> >: >>> >>> If you insert a regular space character, that will allow >>> pandoc to break the line. The other alternative, as noted, >>> is to use a very wide --columns setting, but that's going >>> to give you a very wide table. >>> +++ Baozheng Liu [Oct 20 17 10:52 ]: >>> >>> So will pandoc be able to solve this problem in another way? >>> >>> -- >>> You received this message because you are subscribed to a topic in >>> the Google Groups "pandoc-discuss" group. >>> To unsubscribe from this topic, visit >>> [2]https://groups.google.com/d/topic/pandoc-discuss/wGVGKiUhcNU >>> /unsubscribe. >>> To unsubscribe from this group and all its topics, send an email to >>> [3]pandoc-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org . >>> To post to this group, send email to >>> [4]pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org . >>> To view this discussion on the web visit >>> [5]https://groups.google.com/d/msgid/pandoc-discuss/20171020162 >>> 833.GB33085%40protagoras. >>> >>> For more options, visit [6]https://groups.google.com/d/optout. >>> >>> -- >>> 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 [7]pandoc-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org . >>> To post to this group, send email to >>> [8]pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org . >>> To view this discussion on the web visit >>> [9] >>> https://groups.google.com/d/msgid/pandoc-discuss/CA%2BR_OtkDLgyG67Zi >>> y6LM_zFxdWfFCiHS4MavZGzar1knQgQ7-Q%40mail.gmail.com. >>> For more options, visit [10]https://groups.google.com/d/optout. >>> >>> References >>> >>> 1. mailto:j...-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org >>> 2. >>> https://groups.google.com/d/topic/pandoc-discuss/wGVGKiUhcNU/unsubscribe >>> 3. mailto:pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org >>> 4. mailto:pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org >>> 5. >>> https://groups.google.com/d/msgid/pandoc-discuss/20171020162833.GB33085@protagoras >>> 6. https://groups.google.com/d/optout >>> 7. mailto:pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org >>> 8. mailto:pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org >>> 9. >>> https://groups.google.com/d/msgid/pandoc-discuss/CA+R_OtkDLgyG67Ziy6LM_zFxdWfFCiHS4MavZGzar1knQgQ7-Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org?utm_medium=email&utm_source=footer >>> 10. https://groups.google.com/d/optout >>> >> >> -- >> You received this message because you are subscribed to a topic in the >> Google Groups "pandoc-discuss" group. >> To unsubscribe from this topic, visit >> https://groups.google.com/d/topic/pandoc-discuss/wGVGKiUhcNU/unsubscribe. >> To unsubscribe from this group and all its topics, send an email to >> pandoc-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org . >> To post to this group, send email to pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org >> . >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/pandoc-discuss/20171021160255.GC88234%40Johns-MacBook-Pro.local >> . >> >> For more options, visit https://groups.google.com/d/optout. >> > > -- 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/cb530166-f86d-497f-b9e8-d448b5781241%40googlegroups.com. For more options, visit https://groups.google.com/d/optout. ------=_Part_813_2052872526.1509093742097 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
If you just want to convert the table "just like when= it was in markdown format", then you should set a high column width. = Have you tried it yet?

Another option is not to use pipe= table but grid table in your markdown source, provided that you have an ea= sy way to edit grid table.

If filter is an option,= you could try <https://github.com/ickc/pantable>. e.g. you could con= vert your markdown to markdown with pantable2csv, to convert your table to = csv format first, and then add a yaml in the csv table block to manually sp= ecify width, and then convert the 2nd markdown to RST. (You might then ask = if it is possible to pipe the 3 through automatically without manual editin= g the CSV table. For now the answer is no, because Table in pandoc cannot h= ave attributes, so it is difficult to be able to provide this information t= o pantable.

In general, table in pandoc (and markdown in general) is= complicated (e.g. there are 4 different table formats). Sooner or later, a= pandoc user probably will discover some caveats and subtlety among the 4 f= ormats, and for example how other parameters like the column width might af= fect its behavior. Sometimes we might feel cursed and wish things were diff= erent, but we are blessed at least because pandoc has been consistent, and = is scriptable and extensible (through the filter system).

Another suggestion I might make is not to use Sphinx. Pandoc can wr= ite to HTML directly, have a template system that gives you a certain level= of control on the output, plus a ton of "pandoc-extras" ecosyste= m to generate websites (see more on the pandoc wiki on GitHub). May be you = can help me understand why one would do md-rst-html conversion but not md-h= tml directly. I think it is kind of backward. If you want to use Sphinx, th= en probably you should really write in RST. Pandoc also reads RST (with som= e limitations) which might be useful if you want to cover something Sphinx = can't do.

On Sunday, October 22, 2017 at 6:28:27 PM UTC-7, iromi= se wrote:
yeah= , there might not be some perfect methods, but I think the table can show j= ust like when it was in markdown format.

2017-10-22 0:02 GMT+08:00 John MacFarlane <j...@berk= eley.edu>:
Where should it = split, if there is no space for guidance?

One option for RST tables would be to artificially split
at some arbitrary location when the whole string won't fit.
But this is going to give ugly results in general.

+++ Baozheng Liu [Oct 21 17 15:56 ]:
=C2=A0 But I think that may be pandoc should split the line for us since it=
=C2=A0 may take us a lot of time to make sure that space is regular...

=C2=A0 2017-10-21 0:28 GMT+08:00 John MACFARLANE <[1]j...-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org&g= t;:

=C2=A0 =C2=A0 If you insert a regular space character, that will allow
=C2=A0 =C2=A0 pandoc to break the line.=C2=A0 The other alternative, as not= ed,
=C2=A0 =C2=A0 is to use a very wide --columns setting, but that's going=
=C2=A0 =C2=A0 to give you a very wide table.
=C2=A0 =C2=A0 +++ Baozheng Liu [Oct 20 17 10:52 ]:

=C2=A0 =C2=A0 =C2=A0 So will pandoc be able to solve this problem in anothe= r way?

=C2=A0 =C2=A0 --
=C2=A0 =C2=A0 You received this message because you are subscribed to a top= ic in
=C2=A0 =C2=A0 the Google Groups "pandoc-discuss" group.
=C2=A0 =C2=A0 To unsubscribe from this topic, visit
=C2=A0 =C2=A0 [2]https://groups.google.com/d/topic/pandoc-discuss/wGVGKiUhcNU
=C2=A0 =C2=A0 /unsubscribe.
=C2=A0 =C2=A0 To unsubscribe from this group and all its topics, send an em= ail to
=C2=A0 =C2=A0 [3]pandoc-discus...@googlegroups.com.
=C2=A0 =C2=A0 To post to this group, send email to
=C2=A0 =C2=A0 [4]pandoc-...@googlegroups.com.
=C2=A0 =C2=A0 To view this discussion on the web visit
=C2=A0 =C2=A0 [5]https://groups.google.com/d/msgid/pandoc-discuss/20171020162
=C2=A0 =C2=A0 833.GB33085%40protagoras.

=C2=A0 For more options, visit [6]https://groups.g= oogle.com/d/optout.

=C2=A0 --
=C2=A0 You received this message because you are subscribed to the Google =C2=A0 Groups "pandoc-discuss" group.
=C2=A0 To unsubscribe from this group and stop receiving emails from it, se= nd
=C2=A0 an email to [7]pandoc-discus...@googlegroups.com.
=C2=A0 To post to this group, send email to
=C2=A0 [8]pandoc-...@googlegroups.com.
=C2=A0 To view this discussion on the web visit
=C2=A0 [9]https://group= s.google.com/d/msgid/pandoc-discuss/CA%2BR_OtkDLgyG67Zi
=C2=A0 y6LM_zFxdWfFCiHS4MavZGzar1knQgQ7-Q%40mail.gmail.com.
=C2=A0 For more options, visit [10]https://group= s.google.com/d/optout.

References

=C2=A0 1. mailto:j...-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org
=C2=A0 2. h= ttps://groups.google.com/d/topic/pandoc-discuss/wGVGKiUhcNU/unsub= scribe
=C2=A0 3. mailto:pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
=C2=A0 4. mailto:pandoc-...@googlegroups.com
=C2=A0 5. https://groups.google.com/d/msgid/pandoc-= discuss/20171020162833.GB33085@protagoras
=C2=A0 6. https://groups.google.com/d/optout<= /a>
=C2=A0 7. mailto:
pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
=C2=A0 8. mailto:pandoc-...@googlegroups.com
=C2=A0 9. https://groups.google.com/d/msgid/pa= ndoc-discuss/CA+R_OtkDLgyG67Ziy6LM_zFxdWfFCiHS4MavZGzar1knQgQ7-Q@= mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter
=C2=A010. https://groups.google.com/d/optout<= /a>

--
You received this message because you are subscribed to a topic in the Goog= le Groups "pandoc-discuss" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/pandoc-di= scuss/wGVGKiUhcNU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to pandoc-discu= s...@googlegroups.com.
To post to this group, send email to pandoc-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc= -discuss/20171021160255.GC88234%40Johns-MacBook-Pro.local.

For more options, visit https://groups.google.com= /d/optout.

--
You received this message because you are subscribed to the Google Groups &= quot;pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an e= mail to pand= oc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/= msgid/pandoc-discuss/cb530166-f86d-497f-b9e8-d448b5781241%40googlegroups.co= m.
For more options, visit http= s://groups.google.com/d/optout.
------=_Part_813_2052872526.1509093742097-- ------=_Part_812_1984658853.1509093742097--