* Tell pandoc to respect rst in markdown files while transforming to rst @ 2020-08-14 14:58 BJ [not found] ` <d88ec922-7c61-4cbe-8599-b435540c6a9bn-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> 0 siblings, 1 reply; 4+ messages in thread From: BJ @ 2020-08-14 14:58 UTC (permalink / raw) To: pandoc-discuss [-- Attachment #1.1: Type: text/plain, Size: 919 bytes --] I have a markdown file that I want to convert to RST. The clue is, that this *markdown* file already contains valid RST (i.e. nested directives), i.e. .. note:: .. include:: /path/to/file Some static text also with RST-valid indention How to tell pandoc while transforming the RST-enriched markdown to RST to keep this indention? It seems pandoc removes (left trim) without mercy. Is there a toggle or plugin I missed? Or could I add some magic-markup in the source markdown? Kind regards BJ -- 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/d88ec922-7c61-4cbe-8599-b435540c6a9bn%40googlegroups.com. [-- Attachment #1.2: Type: text/html, Size: 1523 bytes --] ^ permalink raw reply [flat|nested] 4+ messages in thread
[parent not found: <d88ec922-7c61-4cbe-8599-b435540c6a9bn-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>]
* Re: Tell pandoc to respect rst in markdown files while transforming to rst [not found] ` <d88ec922-7c61-4cbe-8599-b435540c6a9bn-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> @ 2020-08-14 18:15 ` John MacFarlane [not found] ` <m2eeo9jdpv.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org> 0 siblings, 1 reply; 4+ messages in thread From: John MacFarlane @ 2020-08-14 18:15 UTC (permalink / raw) To: BJ, pandoc-discuss > How to tell pandoc while transforming the RST-enriched markdown to RST to > keep this indention? It seems pandoc removes (left trim) without mercy. Is > there a toggle or plugin I missed? Or could I add some magic-markup in the > source markdown? Well, that's very easy, if you're using pandoc's markdown extensions. Just use a "raw attribute": ```{=rst} .. note:: .. include:: /path/to/file Some static text also with RST-valid indention ``` This will be passed verbatim to RST output and ignored for other formats. ^ permalink raw reply [flat|nested] 4+ messages in thread
[parent not found: <m2eeo9jdpv.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>]
* Re: Tell pandoc to respect rst in markdown files while transforming to rst [not found] ` <m2eeo9jdpv.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org> @ 2020-08-18 7:22 ` BJ [not found] ` <ba94e3c9-2f4b-4a5a-bd3b-4f6886aee523n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> 0 siblings, 1 reply; 4+ messages in thread From: BJ @ 2020-08-18 7:22 UTC (permalink / raw) To: pandoc-discuss [-- Attachment #1.1: Type: text/plain, Size: 1548 bytes --] Sorry for contacting you personally. I answered via my email client before. I hope I did it correct now. Yes you are right, thanks. This kind of conversion works. https://pandoc.org/try/?text=%23+markdown%0A%0A%60%60%60%7B%3Drst%7D%0A%60this+is+rst%60_%0A%60%60%60%0A&from=markdown&to=rst&standalone=0 If using Github flavoured markdown as source format, it will look differently... I will do some more investigation on my side, to find out, which better fits my needs. Thanks so far! On Friday, August 14, 2020 at 8:15:58 PM UTC+2 John MacFarlane wrote: > > > How to tell pandoc while transforming the RST-enriched markdown to RST > to > > keep this indention? It seems pandoc removes (left trim) without mercy. > Is > > there a toggle or plugin I missed? Or could I add some magic-markup in > the > > source markdown? > > Well, that's very easy, if you're using pandoc's markdown > extensions. Just use a "raw attribute": > > ```{=rst} > .. note:: > > .. include:: /path/to/file > > Some static text also with RST-valid indention > ``` > > This will be passed verbatim to RST output and ignored for other > formats. > > -- 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/ba94e3c9-2f4b-4a5a-bd3b-4f6886aee523n%40googlegroups.com. [-- Attachment #1.2: Type: text/html, Size: 2387 bytes --] ^ permalink raw reply [flat|nested] 4+ messages in thread
[parent not found: <ba94e3c9-2f4b-4a5a-bd3b-4f6886aee523n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>]
* Re: Tell pandoc to respect rst in markdown files while transforming to rst [not found] ` <ba94e3c9-2f4b-4a5a-bd3b-4f6886aee523n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> @ 2020-08-21 18:51 ` John MacFarlane 0 siblings, 0 replies; 4+ messages in thread From: John MacFarlane @ 2020-08-21 18:51 UTC (permalink / raw) To: BJ, pandoc-discuss If you're using the most recent version of pandoc, you should be able to do pandoc -f gfm+raw_attribute and get support for the raw attribute syntax. BJ <bjoern.lippert-aoCR0UM+3MJWk0Htik3J/w@public.gmane.org> writes: > Sorry for contacting you personally. I answered via my email client before. > I hope I did it correct now. > > Yes you are right, thanks. This kind of conversion works. > https://pandoc.org/try/?text=%23+markdown%0A%0A%60%60%60%7B%3Drst%7D%0A%60this+is+rst%60_%0A%60%60%60%0A&from=markdown&to=rst&standalone=0 > > If using Github flavoured markdown as source format, it will look > differently... I will do some more investigation on my side, to find out, > which better fits my needs. > > Thanks so far! > On Friday, August 14, 2020 at 8:15:58 PM UTC+2 John MacFarlane wrote: > >> >> > How to tell pandoc while transforming the RST-enriched markdown to RST >> to >> > keep this indention? It seems pandoc removes (left trim) without mercy. >> Is >> > there a toggle or plugin I missed? Or could I add some magic-markup in >> the >> > source markdown? >> >> Well, that's very easy, if you're using pandoc's markdown >> extensions. Just use a "raw attribute": >> >> ```{=rst} >> .. note:: >> >> .. include:: /path/to/file >> >> Some static text also with RST-valid indention >> ``` >> >> This will be passed verbatim to RST output and ignored for other >> formats. >> >> > > -- > 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/ba94e3c9-2f4b-4a5a-bd3b-4f6886aee523n%40googlegroups.com. ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-08-21 18:51 UTC | newest] Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2020-08-14 14:58 Tell pandoc to respect rst in markdown files while transforming to rst BJ [not found] ` <d88ec922-7c61-4cbe-8599-b435540c6a9bn-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> 2020-08-14 18:15 ` John MacFarlane [not found] ` <m2eeo9jdpv.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org> 2020-08-18 7:22 ` BJ [not found] ` <ba94e3c9-2f4b-4a5a-bd3b-4f6886aee523n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> 2020-08-21 18:51 ` 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).