public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
From: John MacFarlane <jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org>
To: Daniel Staal <DStaal-Jdbf3xiKgS8@public.gmane.org>,
	pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
Subject: Re: Do Pandoc's conversion functions which exist in both directions guarantee/aim for bijectivity?
Date: Tue, 04 May 2021 10:44:12 -0700	[thread overview]
Message-ID: <m2im3y1jir.fsf@MacBook-Pro.hsd1.ca.comcast.net> (raw)
In-Reply-To: <9f900b8c-9341-3549-1b31-eeb3f5a9b320-Jdbf3xiKgS8@public.gmane.org>


This is correct.  We aspire to semantic equivalence but
definitely not syntactic.  For example, if you convert

hi # there

to Markdown you may get

hi \# there

Ideally, we'd have the following invariant:

  doc == readF (writeF doc)

where readF/writeF are the reader and writer for a format,
with the same extensions set, and doc is an arbitrary
Pandoc AST.

I wouldn't say we have this now with most formats. Running
this sort of test can indicate places where the reader or
writer needs to be improved.

Daniel Staal <DStaal-Jdbf3xiKgS8@public.gmane.org> writes:

> I don't believe there's any particular aim for it -- notably the 
> Markdown format is known to not always return the input when run on 
> itself.  The aim is for the output to be the semantic equivalent, not 
> that it will be the same.
>
> Daniel T. Staal


  parent reply	other threads:[~2021-05-04 17:44 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-03 22:23 Jeffrey Wang
     [not found] ` <2ffba3ed-4e84-45ad-9eea-f4fb4b2da636n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2021-05-03 22:34   ` Daniel Staal
     [not found]     ` <9f900b8c-9341-3549-1b31-eeb3f5a9b320-Jdbf3xiKgS8@public.gmane.org>
2021-05-04 17:44       ` John MacFarlane [this message]
2021-05-04 20:24   ` christi...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
     [not found]     ` <0b756db2-f247-49b1-a7dd-e0242e79d956n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2021-05-04 21:22       ` Jeffrey Wang
     [not found]         ` <CACZurRei78h_5EG4vSUdhS+GFaF-gUVnCB=eVXh98f6ULpCuXA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2021-05-04 21:34           ` christi...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
     [not found]             ` <81417776-15c4-4dfb-8229-0dc15614c88dn-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2021-05-04 21:35               ` Jeffrey Wang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2im3y1jir.fsf@MacBook-Pro.hsd1.ca.comcast.net \
    --to=jgm-tvlzxgkolnx2fbvcvol8/a@public.gmane.org \
    --cc=DStaal-Jdbf3xiKgS8@public.gmane.org \
    --cc=pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).