public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* controlling smart typography with org or markdown
@ 2021-09-26 19:40 Simon Michael
  2021-09-26 20:36 ` Albert Krewinkel
  2021-09-27 23:35 ` John MacFarlane
  0 siblings, 2 replies; 4+ messages in thread
From: Simon Michael @ 2021-09-26 19:40 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

G'day all!

As someone documenting command line software, I never want `smart` 
typography. Still, Pandoc lets me control it, right ? In the end, yes.. 
but I must share some notes. Perhaps I'm getting confused between 
readers and writers ? Any comments welcome.


1. A small correction
---------------------

 > https://pandoc.org/MANUAL.html#extensions: "For example, --from 
markdown_strict+footnotes is..."

The underscore is a typo I think.


2. With the org reader, smart can not be disabled
-------------------------------------------------

 > https://pandoc.org/MANUAL.html#extension-smart: "Interpret straight 
quotes as curly quotes, --- as em-dashes, -- as en-dashes, and ... as 
ellipses. "

This suggests smart is disabled by default for org (reader, or so I think):

$ pandoc --version
pandoc 2.14.2
Compiled with pandoc-types 1.22, texmath 0.12.3.1, skylighting 0.11,
citeproc 0.5, ipynb 0.1.0.1
...
$ pandoc --list-extensions=org
-ascii_identifiers
+auto_identifiers
+citations
-east_asian_line_breaks
-gfm_auto_identifiers
-smart

But this shows it enabled by default:

$ echo '--version' | pandoc -f org -t native
[Para [Str "\8211version"]]

And enabling/disabling the extension has no effect:

$ echo '--version' | pandoc -f org-smart -t native
[Para [Str "\8211version"]]
$ echo '--version' | pandoc -f org+smart -t native
[Para [Str "\8211version"]]


3. With the markdown writer, smart is selected oppositely
---------------------------------------------------------

Since I am converting to markdown, maybe I could control it there. I was 
already disabling smart in the markdown writer I thought, but it was not 
working:

$ echo '--version' | pandoc -f org -t markdown-smart
–version

Then I found this:

 > "Note: If you are writing Markdown, then the smart extension has the 
reverse effect: what would have been curly quotes comes out straight."

Which indeed achieves my goal:

$ echo '--version' | pandoc -f org -t markdown+smart
--version

But.. why the reverse effect ? There must be a reason, but I found this 
non-intuitive.


4. More
---------------------------------------------------------

So it seems I have been *enabling* smart in my markdown web docs (with 
-t markdown-smart) for years. But I haven't been seeing smart 
quotes/dashes; apparently they were still being suppressed by other 
means. I investigated:

With the markdown reader, smart is enabled by default, and disabled with 
-smart as one would expect (unlike the markdown writer):

$ echo  '--version' | pandoc -f markdown -t native
[Para [Str "\8211version"]]
$ echo  '--version' | pandoc -f markdown-smart -t native
[Para [Str "--version"]]

Here are the combinations of the markdown reader and markdown writer, as 
I understand them.

A. from smart markdown to non-smart markdown:

$ echo  '--version' | pandoc -f markdown -t markdown
--version

B. from smart markdown to smart markdown:

$ echo  '--version' | pandoc -f markdown -t markdown-smart
–version

C. from non-smart markdown to non-smart markdown (why the backslash ?):

$ echo  '--version' | pandoc -f markdown-smart -t markdown
\--version

D. from non-smart markdown to smart markdown (why no en-dash here ?)

$ echo  '--version' | pandoc -f markdown-smart -t markdown-smart
--version


And now I must go for a lie down.

-- 
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/siqibs%242h1%241%40ciao.gmane.io.


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

end of thread, other threads:[~2021-09-28  0:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-26 19:40 controlling smart typography with org or markdown Simon Michael
2021-09-26 20:36 ` Albert Krewinkel
2021-09-27 23:35 ` John MacFarlane
     [not found]   ` <4331fc4f-e662-4ea0-89c0-c62b0c0228e1n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2021-09-28  0:04     ` Ophir Lifshitz

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