public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* Markdown -> plain: How to preserve blockquotes?
@ 2017-09-02  5:16 Francisco Lopes
       [not found] ` <b9e503e1-de59-4086-8104-64f32c8bfa5f-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 16+ messages in thread
From: Francisco Lopes @ 2017-09-02  5:16 UTC (permalink / raw)
  To: pandoc-discuss


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

Hi, is there a way to preserve blockquotes from Markdown to plain text?

The current behavior turn blockquotes into whitespace and this is specially
bad for me because I'm working with email from Markdown to plain text and
whitespace as blockquote really doesn't work.

Regards,
Francisco Lopes

-- 
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/b9e503e1-de59-4086-8104-64f32c8bfa5f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

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

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

* Markdown -> plain: How to preserve blockquotes?
       [not found] ` <b9e503e1-de59-4086-8104-64f32c8bfa5f-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2017-09-03  6:53   ` Kolen Cheung
       [not found]     ` <d5636ec4-4c36-4514-a87a-3622e37d4986-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 16+ messages in thread
From: Kolen Cheung @ 2017-09-03  6:53 UTC (permalink / raw)
  To: pandoc-discuss

[-- Attachment #1: Type: text/plain, Size: 134 bytes --]

Can you give a minimum example? Provide a short example, command you used, etc., and what you want to achieve (your expected output).

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

* Re: Markdown -> plain: How to preserve blockquotes?
       [not found]     ` <d5636ec4-4c36-4514-a87a-3622e37d4986-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2017-09-03 12:36       ` Francisco Lopes
       [not found]         ` <cd94eef0-e89b-4aa2-969e-17cf6bb99162-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 16+ messages in thread
From: Francisco Lopes @ 2017-09-03 12:36 UTC (permalink / raw)
  To: pandoc-discuss


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

Em domingo, 3 de setembro de 2017 03:53:31 UTC-3, Kolen Cheung escreveu:
>
> Can you give a minimum example? Provide a short example, command you used, 
> etc., and what you want to achieve (your expected output).
>


Check here: https://gist.github.com/oblitum/328d6d5929bacb595f52207a8cdca21d

Notice that I've also corrected an unexpected &nbsp; in the current plain 
output.

-- 
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/cd94eef0-e89b-4aa2-969e-17cf6bb99162%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

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

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

* Re: Markdown -> plain: How to preserve blockquotes?
       [not found]         ` <cd94eef0-e89b-4aa2-969e-17cf6bb99162-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2017-09-04  1:58           ` Kolen Cheung
       [not found]             ` <8e1e0a64-7e87-4dbd-b669-0b55854fe110-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 16+ messages in thread
From: Kolen Cheung @ 2017-09-04  1:58 UTC (permalink / raw)
  To: pandoc-discuss

[-- Attachment #1: Type: text/plain, Size: 1482 bytes --]

When you say preserve, do you mean you want to see the `>` characters? It won't be difficult to do that, but I'm afraid it is an arbitrary expectation on how much markdown you want to see in the plain text output. (should the `-` for lists and `>` for blockquote be considered as plaintext? If so, every markdown syntax should be considered as plaintext, or else how should you draw the boundary? Moreoever, some people do think markdown *is* plaintext, and people often say markdown won the plaintext war, where markdown becomes the de facto standard for plain text.)

Now in your case where you want to have a custom "markdown variant" that more things becomes plaintext while preserving some of the markdown extensions, I guess you may try to turn off most of the markdown extensions that you don't need (see the manual/user guide if you don't know what I mean, e.g. `-t markdown-grid_table...`).

-- 
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/8e1e0a64-7e87-4dbd-b669-0b55854fe110%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

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

* Re: Markdown -> plain: How to preserve blockquotes?
       [not found]             ` <8e1e0a64-7e87-4dbd-b669-0b55854fe110-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2017-09-04  8:33               ` Francisco Lopes
       [not found]                 ` <e364ab5a-9752-47ce-ad05-9ece6e099b77-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 16+ messages in thread
From: Francisco Lopes @ 2017-09-04  8:33 UTC (permalink / raw)
  To: pandoc-discuss


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

I see your point regarding Markdown having won over plain text, so much so 
that I'm adopting it
as the plain text version already. The problem is, it still feels a bit 
cluttered compared to plain for
me, my only issue with plain is just the quotes, it feels too clunky as is 
now, it adds too much
vertical space and removing > hinders it unusable for emails.

Notice that this has been mentioned some years back:

- https://groups.google.com/d/msg/pandoc-discuss/JKFEQBzKQAo/w2p4PCfqZ4MJ

I know about the extensions and how to manipulate the variables, etc but I 
don't think removing
from Markdown will work, since my only grip with plain is the blockquote 
(besides the &nbsp bug).


-- 
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/e364ab5a-9752-47ce-ad05-9ece6e099b77%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

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

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

* Re: Markdown -> plain: How to preserve blockquotes?
       [not found]                 ` <e364ab5a-9752-47ce-ad05-9ece6e099b77-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2017-09-04  9:36                   ` Kolen Cheung
       [not found]                     ` <eaa32942-b318-456e-9ed6-7db797e050de-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 16+ messages in thread
From: Kolen Cheung @ 2017-09-04  9:36 UTC (permalink / raw)
  To: pandoc-discuss

[-- Attachment #1: Type: text/plain, Size: 1247 bytes --]

Actually my main point was that how the boundary between plaintext and markdown should be drawn? You might expect `>` as part of plaintext, but they are not IMO. Strictly speaking, the list character `-` also isn't plaintext. I would imagine converting markdown to plaintext is to remove all the "markup language" bit of it.

And I would still suggest you to try turning off all markdown extensions except for those you need, e.g. list and blockquote. You might start from markdown_strict which bundled with the least amount of extensions to keep your list short. I didn't try that, but I expect turning off all markdown extensions essentially making it plaintext.

-- 
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/eaa32942-b318-456e-9ed6-7db797e050de%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

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

* Re: Markdown -> plain: How to preserve blockquotes?
       [not found]                     ` <eaa32942-b318-456e-9ed6-7db797e050de-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2017-09-04 13:53                       ` John Muccigrosso
  2017-09-04 16:21                       ` Francisco Lopes
  2017-09-04 18:52                       ` Francisco Lopes
  2 siblings, 0 replies; 16+ messages in thread
From: John Muccigrosso @ 2017-09-04 13:53 UTC (permalink / raw)
  To: pandoc-discuss


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

On Monday, September 4, 2017 at 5:36:44 AM UTC-4, Kolen Cheung wrote:
>
> Strictly speaking, the list character `-` also isn't plaintext.


Really? How else would you do a list in plaintext?

* is another common marker in plaintext, but isn't that why Gruber used 
them in the first place…because both symbols _are_ what people use when 
they write lists in plaintext? 

-- 
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/bb165425-a1a9-43ea-9956-1566f692300a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

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

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

* Re: Markdown -> plain: How to preserve blockquotes?
       [not found]                     ` <eaa32942-b318-456e-9ed6-7db797e050de-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  2017-09-04 13:53                       ` John Muccigrosso
@ 2017-09-04 16:21                       ` Francisco Lopes
  2017-09-04 18:52                       ` Francisco Lopes
  2 siblings, 0 replies; 16+ messages in thread
From: Francisco Lopes @ 2017-09-04 16:21 UTC (permalink / raw)
  To: pandoc-discuss


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



Em segunda-feira, 4 de setembro de 2017 06:36:44 UTC-3, Kolen Cheung 
escreveu:
>
> Actually my main point was that how the boundary between plaintext and 
> markdown should be drawn? You might expect `>` as part of plaintext, but 
> they are not IMO. Strictly speaking, the list character `-` also isn't 
> plaintext. I would imagine converting markdown to plaintext is to remove 
> all the "markup language" bit of it.


IMO, the conventions of plain text EML are OK and practical, so I do expect 
> for block quotation. Indentation is also not bad,
I can see it as more aesthetically pleasant for the purposes of quotes with 
citation, but for conversations it is not. So I see it
just as different with their own advantages.
 

> And I would still suggest you to try turning off all markdown extensions 
> except for those you need, e.g. list and blockquote. You might start from 
> markdown_strict which bundled with the least amount of extensions to keep 
> your list short. I didn't try that, but I expect turning off all markdown 
> extensions essentially making it plaintext.
>

-- 
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/447e4fb9-270b-4860-879c-0dfc627992a4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

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

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

* Re: Markdown -> plain: How to preserve blockquotes?
       [not found]                     ` <eaa32942-b318-456e-9ed6-7db797e050de-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  2017-09-04 13:53                       ` John Muccigrosso
  2017-09-04 16:21                       ` Francisco Lopes
@ 2017-09-04 18:52                       ` Francisco Lopes
       [not found]                         ` <fb9edf5e-3b0d-48b9-b10e-29f738a80987-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  2 siblings, 1 reply; 16+ messages in thread
From: Francisco Lopes @ 2017-09-04 18:52 UTC (permalink / raw)
  To: pandoc-discuss


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

My last message was moderated, did I say anything wrong?

-- 
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/fb9edf5e-3b0d-48b9-b10e-29f738a80987%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

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

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

* Re: Markdown -> plain: How to preserve blockquotes?
       [not found]                         ` <fb9edf5e-3b0d-48b9-b10e-29f738a80987-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2017-09-05  4:53                           ` John MacFarlane
       [not found]                             ` <20170905045318.GE3765-9Rnp8PDaXcadBw3G0RLmbRFnWt+6NQIA@public.gmane.org>
  0 siblings, 1 reply; 16+ messages in thread
From: John MacFarlane @ 2017-09-05  4:53 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

+++ Francisco Lopes [Sep 04 17 11:52 ]:
>   My last message was moderated, did I say anything wrong?

No, Google does that automatically on occasion, for reasons
that are generally opaque to me.  I just unfroze your
message.

Pandoc's 'plain' output tries to reproduce the conventions
used in Project Gutenberg's plain text books.  That doesn't
use `>` for quotes; rather, it uses indentation to come
close to the look of an actual printed book, and that's
what we do too.

The `&nbsp;` is a bug, though, which I'm about to fix.
In markdown you need something between a list and an
indented code block, or the indented block gets interpreted
as a continuation paragraph in the last list item. To
prevent that we insert an HTML comment or (if raw HTML is
disabled) a `&nbsp;`.  But of course this isn't necessary
in `plain` output.


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

* Re: Markdown -> plain: How to preserve blockquotes?
       [not found]                             ` <20170905045318.GE3765-9Rnp8PDaXcadBw3G0RLmbRFnWt+6NQIA@public.gmane.org>
@ 2017-09-05  5:20                               ` Francisco Lopes
       [not found]                                 ` <6ec4d317-8de4-476d-86c5-91438eb47729-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 16+ messages in thread
From: Francisco Lopes @ 2017-09-05  5:20 UTC (permalink / raw)
  To: pandoc-discuss


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

Hello John,

Em terça-feira, 5 de setembro de 2017 01:53:20 UTC-3, John MacFarlane 
escreveu:
>
> +++ Francisco Lopes [Sep 04 17 11:52 ]: 
> >   My last message was moderated, did I say anything wrong? 
>
> No, Google does that automatically on occasion, for reasons 
> that are generally opaque to me.  I just unfroze your 
> message. 
>
> Pandoc's 'plain' output tries to reproduce the conventions 
> used in Project Gutenberg's plain text books.  That doesn't 
> use `>` for quotes; rather, it uses indentation to come 
> close to the look of an actual printed book, and that's 
> what we do too.
>

That's in agreement with what I said in my deleted message.
I don't indentation as better or worse, just different purpose,
and more aesthetically pleasant for citation quotes, just like
in books, but completely equivocated for conversation quotes
that can go many levels deep.

The `&nbsp;` is a bug, though, which I'm about to fix. 
> In markdown you need something between a list and an 
> indented code block, or the indented block gets interpreted 
> as a continuation paragraph in the last list item. To 
> prevent that we insert an HTML comment or (if raw HTML is 
> disabled) a `&nbsp;`.  But of course this isn't necessary 
> in `plain` output. 
>
>

-- 
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/6ec4d317-8de4-476d-86c5-91438eb47729%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

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

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

* Re: Markdown -> plain: How to preserve blockquotes?
       [not found]                                 ` <6ec4d317-8de4-476d-86c5-91438eb47729-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2017-09-05  5:28                                   ` Francisco Lopes
       [not found]                                     ` <ae3ba6b6-616a-4cb5-8bb2-be45b575d54e-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 16+ messages in thread
From: Francisco Lopes @ 2017-09-05  5:28 UTC (permalink / raw)
  To: pandoc-discuss


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

Actually, scratch that... current plain output strips links, which are 
important
at the text version of a multipart email... I guess I'm just gonna stick to
markdown as is.

Regards,

Em terça-feira, 5 de setembro de 2017 02:20:22 UTC-3, Francisco Lopes 
escreveu:
>
> Hello John,
>
> Em terça-feira, 5 de setembro de 2017 01:53:20 UTC-3, John MacFarlane 
> escreveu:
>>
>> +++ Francisco Lopes [Sep 04 17 11:52 ]: 
>> >   My last message was moderated, did I say anything wrong? 
>>
>> No, Google does that automatically on occasion, for reasons 
>> that are generally opaque to me.  I just unfroze your 
>> message. 
>>
>> Pandoc's 'plain' output tries to reproduce the conventions 
>> used in Project Gutenberg's plain text books.  That doesn't 
>> use `>` for quotes; rather, it uses indentation to come 
>> close to the look of an actual printed book, and that's 
>> what we do too.
>>
>
> That's in agreement with what I said in my deleted message.
> I don't indentation as better or worse, just different purpose,
> and more aesthetically pleasant for citation quotes, just like
> in books, but completely equivocated for conversation quotes
> that can go many levels deep.
>
> The `&nbsp;` is a bug, though, which I'm about to fix. 
>> In markdown you need something between a list and an 
>> indented code block, or the indented block gets interpreted 
>> as a continuation paragraph in the last list item. To 
>> prevent that we insert an HTML comment or (if raw HTML is 
>> disabled) a `&nbsp;`.  But of course this isn't necessary 
>> in `plain` output. 
>>
>>
>

-- 
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/ae3ba6b6-616a-4cb5-8bb2-be45b575d54e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

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

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

* Re: Markdown -> plain: How to preserve blockquotes?
       [not found]                                     ` <ae3ba6b6-616a-4cb5-8bb2-be45b575d54e-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2017-09-05 12:16                                       ` Kolen Cheung
       [not found]                                         ` <d6d7afde-883b-43da-9727-4ce24a08a43f-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 16+ messages in thread
From: Kolen Cheung @ 2017-09-05 12:16 UTC (permalink / raw)
  To: pandoc-discuss

[-- Attachment #1: Type: text/plain, Size: 1838 bytes --]

As I guessed you don't really want to have plaintext. Again, try turning off markdown extensions to make it more "lightweight" and tailor that as your "plaintext".

Regarding treating list marker as plaintext or not: we need to ask ourselves what do we mean when we say plaintext and markdown. In the "markdown wins the plaintext war" camp, markdown is plaintext. Just to look up wikipedia in <https://en.m.wikipedia.org/wiki/Plain_text>, non-binary formats are plaintext, like most of the pandoc formats including HTML. So pandoc's plain format definitely has a special meaning than these. And @jgm just defined it above. Lastly, when I say the list marker isn't plaintext, I'm thinking in terms of "stringify". Like if given a document, if I'm to remove every formatting features, what would I be left with? Or in other words, if I speak it out without any help from those markups, what would that be? In this sense, a list in *plain* text is like "Give me a pen, pencil, and ruler." By the way, I think in typography, when you write that in a list (with list markers), the rule to apply punctuation marks and connectives is exactly as if you write it out in a sentence. i.e. the list marker is just a visual element to better represent the information.

-- 
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/d6d7afde-883b-43da-9727-4ce24a08a43f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

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

* Re: Markdown -> plain: How to preserve blockquotes?
       [not found]                                         ` <d6d7afde-883b-43da-9727-4ce24a08a43f-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2017-09-05 18:02                                           ` Francisco Lopes
       [not found]                                             ` <9d2b4cdb-b236-42bd-baea-ff53da0ca1ed-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 16+ messages in thread
From: Francisco Lopes @ 2017-09-05 18:02 UTC (permalink / raw)
  To: pandoc-discuss


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



Em terça-feira, 5 de setembro de 2017 09:16:41 UTC-3, Kolen Cheung escreveu:
>
> As I guessed you don't really want to have plaintext. Again, try turning 
> off markdown extensions to make it more "lightweight" and tailor that as 
> your "plaintext". 
>

The problem is that turning off markdown extensions to achieve plain text 
will simply not work afaik.

For example, current plain text output will turn bold markdown **text** to 
all caps plain TEXT. Which I find nice,
I find it logical for plain text output. Can't it be done by turning off 
flags?

The thing is that what I want has no standard yet, it's something target 
for plain text EML, between current plain
text and markdown. IMO, **foo** etc, clutters plain text output. Another 
possible feature of such target output
could be to always move url links to footer while leaving anchors in the 
main content.

Regards
 

> Regarding treating list marker as plaintext or not: we need to ask 
> ourselves what do we mean when we say plaintext and markdown. In the 
> "markdown wins the plaintext war" camp, markdown is plaintext. Just to look 
> up wikipedia in <https://en.m.wikipedia.org/wiki/Plain_text>, non-binary 
> formats are plaintext, like most of the pandoc formats including HTML. So 
> pandoc's plain format definitely has a special meaning than these. And @jgm 
> just defined it above. Lastly, when I say the list marker isn't plaintext, 
> I'm thinking in terms of "stringify". Like if given a document, if I'm to 
> remove every formatting features, what would I be left with? Or in other 
> words, if I speak it out without any help from those markups, what would 
> that be? In this sense, a list in *plain* text is like "Give me a pen, 
> pencil, and ruler." By the way, I think in typography, when you write that 
> in a list (with list markers), the rule to apply punctuation marks and 
> connectives is exactly as if you write it out in a sentence. i.e. the list 
> marker is just a visual element to better represent the information.


-- 
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/9d2b4cdb-b236-42bd-baea-ff53da0ca1ed%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

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

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

* Re: Markdown -> plain: How to preserve blockquotes?
       [not found]                                             ` <9d2b4cdb-b236-42bd-baea-ff53da0ca1ed-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2017-09-05 18:17                                               ` John MacFarlane
       [not found]                                                 ` <20170905181733.GD10851-9Rnp8PDaXcadBw3G0RLmbRFnWt+6NQIA@public.gmane.org>
  0 siblings, 1 reply; 16+ messages in thread
From: John MacFarlane @ 2017-09-05 18:17 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

You might have some success with filters.
You could use Markdown output, and intercept constructions
like Strong and Emph, replacing them with something else.

+++ Francisco Lopes [Sep 05 17 11:02 ]:
>   Em terça-feira, 5 de setembro de 2017 09:16:41 UTC-3, Kolen Cheung
>   escreveu:
>
>     As I guessed you don't really want to have plaintext. Again, try
>     turning off markdown extensions to make it more "lightweight" and
>     tailor that as your "plaintext".
>
>   The problem is that turning off markdown extensions to achieve plain
>   text will simply not work afaik.
>   For example, current plain text output will turn bold markdown **text**
>   to all caps plain TEXT. Which I find nice,
>   I find it logical for plain text output. Can't it be done by turning
>   off flags?
>   The thing is that what I want has no standard yet, it's something
>   target for plain text EML, between current plain
>   text and markdown. IMO, **foo** etc, clutters plain text output.
>   Another possible feature of such target output
>   could be to always move url links to footer while leaving anchors in
>   the main content.
>   Regards
>
>     Regarding treating list marker as plaintext or not: we need to ask
>     ourselves what do we mean when we say plaintext and markdown. In the
>     "markdown wins the plaintext war" camp, markdown is plaintext. Just
>     to look up wikipedia in <[1]https://en.m.wikipedia.org/
>     wiki/Plain_text>, non-binary formats are plaintext, like most of the
>     pandoc formats including HTML. So pandoc's plain format definitely
>     has a special meaning than these. And @jgm just defined it above.
>     Lastly, when I say the list marker isn't plaintext, I'm thinking in
>     terms of "stringify". Like if given a document, if I'm to remove
>     every formatting features, what would I be left with? Or in other
>     words, if I speak it out without any help from those markups, what
>     would that be? In this sense, a list in *plain* text is like "Give
>     me a pen, pencil, and ruler." By the way, I think in typography,
>     when you write that in a list (with list markers), the rule to apply
>     punctuation marks and connectives is exactly as if you write it out
>     in a sentence. i.e. the list marker is just a visual element to
>     better represent the information.
>
>   --
>   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 [2]pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>   To post to this group, send email to
>   [3]pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>   To view this discussion on the web visit
>   [4]https://groups.google.com/d/msgid/pandoc-discuss/9d2b4cdb-b236-42bd-
>   baea-ff53da0ca1ed%40googlegroups.com.
>   For more options, visit [5]https://groups.google.com/d/optout.
>
>References
>
>   1. https://en.m.wikipedia.org/wiki/Plain_text
>   2. mailto:pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
>   3. mailto:pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
>   4. https://groups.google.com/d/msgid/pandoc-discuss/9d2b4cdb-b236-42bd-baea-ff53da0ca1ed-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org?utm_medium=email&utm_source=footer
>   5. 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/20170905181733.GD10851%40Johns-MacBook-Pro.local.
For more options, visit https://groups.google.com/d/optout.


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

* Re: Markdown -> plain: How to preserve blockquotes?
       [not found]                                                 ` <20170905181733.GD10851-9Rnp8PDaXcadBw3G0RLmbRFnWt+6NQIA@public.gmane.org>
@ 2017-09-08 20:16                                                   ` Melroch
  0 siblings, 0 replies; 16+ messages in thread
From: Melroch @ 2017-09-08 20:16 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

[-- Attachment #1: Type: text/plain, Size: 7795 bytes --]

I have successfully used a filter to make plain output look like Perl POD
documentation format. The beauty of plain is that you can just inject Str
elements with whatever markup you like and plain will just output it
verbatim. For example link URLs are present in the JSON which the filter
receives, so you can just replace the Link elements with whatever literal
strings you like which include the link text and the URL. For example a
[Pandoc::Filter][] based filter for inserting the URL in angle brackets and
the title if any in parentheses after the link text:

~~~~~~perl
#!/usr/bin/env perl

use 5.010001;
use utf8;
use strict;
use warnings;

use Pandoc::Filter;
use Pandoc::Elements;

pandoc_filter Link => sub {
    my $url = $_->url;
    my $title = $_->title;
    my $content = $_->content;
    $title &&= qq{ ($title)};
    return [@$content, Space, Str "<$url>", Str $title];
};

~~~~~~

or to get traditional email emphasis:

~~~~~~perl
#!/usr/bin/env perl

use 5.010001;
use utf8;
use strict;
use warnings;

use Pandoc::Elements;
use Pandoc::Walker qw[ action transform ];

my $action = action Emph => sub {
    my($elem, $action) = @_;
    my $content = transform $elem->content, $action, $action; # recurse
    return [Str '_', @$content, Str '_'];
},
Strong => sub {
    my($elem, $action) = @_;
    my $content = transform $elem->content, $action, $action; # recurse
    return [Str '*', @$content, Str '*'];
};

my $doc = pandoc_json();

transform $doc, $action, $action; # action both as callback and argument!

print $doc->to_json;
~~~~~~

Block quotes are tougher but it could be done if you run pandoc (with
Pandoc.pm) on the content with the same filter(s) to fix nested block
quotes,
then insert '> ' at the start of every line:

~~~~~~perl
# less-plain.pl

use Pandoc::Elements;
use Pandoc::Walker qw[ action transform ];
use Pandoc; # wrapper module

my $doc = pandoc_json();
my $meta = $doc->meta;
my $api_version = $doc->api_version;

my $action = action BlockQuote => sub {
    my($elem, $action) = @_;
    my $content_doc = Document {
        blocks => $elem->content, # works because content is an array of
blocks!
        meta => $meta,
        api_version => $api_version,
    };
    # convert with pandoc!
    my $content = $content_doc->to_pandoc( -t => 'plain', -F => $0 );
    $content =~ s{^}{> }mg;
    return Para [ Str $content ];
},
Link => ...,   # replace ... with the subs above, and/or insert your own!
Emph => ...,
Strong => ...;

transform $doc, $action, $action; # action both as callback and argument!

print $doc->to_json;
~~~~~~

The trick with calling pandoc works because the `$0` variable contains the
path to the current program which is the filter itself.
Naturally you would like to put all your modifications in the same filter.
[Pandoc::Filter]: https://metacpan.org/pod/Pandoc::Filter

/bpj

Den 5 sep 2017 20:18 skrev "John MacFarlane" <jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org>:

> You might have some success with filters.
> You could use Markdown output, and intercept constructions
> like Strong and Emph, replacing them with something else.
>
> +++ Francisco Lopes [Sep 05 17 11:02 ]:
>
>>   Em terça-feira, 5 de setembro de 2017 09:16:41 UTC-3, Kolen Cheung
>>   escreveu:
>>
>>     As I guessed you don't really want to have plaintext. Again, try
>>     turning off markdown extensions to make it more "lightweight" and
>>     tailor that as your "plaintext".
>>
>>   The problem is that turning off markdown extensions to achieve plain
>>   text will simply not work afaik.
>>   For example, current plain text output will turn bold markdown **text**
>>   to all caps plain TEXT. Which I find nice,
>>   I find it logical for plain text output. Can't it be done by turning
>>   off flags?
>>   The thing is that what I want has no standard yet, it's something
>>   target for plain text EML, between current plain
>>   text and markdown. IMO, **foo** etc, clutters plain text output.
>>   Another possible feature of such target output
>>   could be to always move url links to footer while leaving anchors in
>>   the main content.
>>   Regards
>>
>>     Regarding treating list marker as plaintext or not: we need to ask
>>     ourselves what do we mean when we say plaintext and markdown. In the
>>     "markdown wins the plaintext war" camp, markdown is plaintext. Just
>>     to look up wikipedia in <[1]https://en.m.wikipedia.org/
>>     wiki/Plain_text>, non-binary formats are plaintext, like most of the
>>     pandoc formats including HTML. So pandoc's plain format definitely
>>     has a special meaning than these. And @jgm just defined it above.
>>     Lastly, when I say the list marker isn't plaintext, I'm thinking in
>>     terms of "stringify". Like if given a document, if I'm to remove
>>     every formatting features, what would I be left with? Or in other
>>     words, if I speak it out without any help from those markups, what
>>     would that be? In this sense, a list in *plain* text is like "Give
>>     me a pen, pencil, and ruler." By the way, I think in typography,
>>     when you write that in a list (with list markers), the rule to apply
>>     punctuation marks and connectives is exactly as if you write it out
>>     in a sentence. i.e. the list marker is just a visual element to
>>     better represent the information.
>>
>>   --
>>   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 [2]pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>>   To post to this group, send email to
>>   [3]pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>>   To view this discussion on the web visit
>>   [4]https://groups.google.com/d/msgid/pandoc-discuss/9d2b4cdb-b236-42bd-
>>   baea-ff53da0ca1ed%40googlegroups.com.
>>   For more options, visit [5]https://groups.google.com/d/optout.
>>
>> References
>>
>>   1. https://en.m.wikipedia.org/wiki/Plain_text
>>   2. mailto:pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
>>   3. mailto:pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
>>   4. https://groups.google.com/d/msgid/pandoc-discuss/9d2b4cdb-b2
>> 36-42bd-baea-ff53da0ca1ed-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org?utm_medium=email&
>> utm_source=footer
>>   5. 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/ms
> gid/pandoc-discuss/20170905181733.GD10851%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/CADAJKhC1y5ip7M%3DHiEUjF2urMyciCUK%2BHroXw%2B5wabi7n4XXRA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

[-- Attachment #2: Type: text/html, Size: 14841 bytes --]

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

end of thread, other threads:[~2017-09-08 20:16 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-02  5:16 Markdown -> plain: How to preserve blockquotes? Francisco Lopes
     [not found] ` <b9e503e1-de59-4086-8104-64f32c8bfa5f-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2017-09-03  6:53   ` Kolen Cheung
     [not found]     ` <d5636ec4-4c36-4514-a87a-3622e37d4986-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2017-09-03 12:36       ` Francisco Lopes
     [not found]         ` <cd94eef0-e89b-4aa2-969e-17cf6bb99162-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2017-09-04  1:58           ` Kolen Cheung
     [not found]             ` <8e1e0a64-7e87-4dbd-b669-0b55854fe110-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2017-09-04  8:33               ` Francisco Lopes
     [not found]                 ` <e364ab5a-9752-47ce-ad05-9ece6e099b77-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2017-09-04  9:36                   ` Kolen Cheung
     [not found]                     ` <eaa32942-b318-456e-9ed6-7db797e050de-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2017-09-04 13:53                       ` John Muccigrosso
2017-09-04 16:21                       ` Francisco Lopes
2017-09-04 18:52                       ` Francisco Lopes
     [not found]                         ` <fb9edf5e-3b0d-48b9-b10e-29f738a80987-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2017-09-05  4:53                           ` John MacFarlane
     [not found]                             ` <20170905045318.GE3765-9Rnp8PDaXcadBw3G0RLmbRFnWt+6NQIA@public.gmane.org>
2017-09-05  5:20                               ` Francisco Lopes
     [not found]                                 ` <6ec4d317-8de4-476d-86c5-91438eb47729-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2017-09-05  5:28                                   ` Francisco Lopes
     [not found]                                     ` <ae3ba6b6-616a-4cb5-8bb2-be45b575d54e-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2017-09-05 12:16                                       ` Kolen Cheung
     [not found]                                         ` <d6d7afde-883b-43da-9727-4ce24a08a43f-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2017-09-05 18:02                                           ` Francisco Lopes
     [not found]                                             ` <9d2b4cdb-b236-42bd-baea-ff53da0ca1ed-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2017-09-05 18:17                                               ` John MacFarlane
     [not found]                                                 ` <20170905181733.GD10851-9Rnp8PDaXcadBw3G0RLmbRFnWt+6NQIA@public.gmane.org>
2017-09-08 20:16                                                   ` Melroch

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).