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" : > 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.