public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
From: Ranjit Jhala <rjhala-fWt/sZ2FBdz2fBVCVOL8/A@public.gmane.org>
To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
Subject: Re: readMarkdown Ignoring Links (in filter)
Date: Sat, 17 Jan 2015 13:31:39 -0800 (PST)	[thread overview]
Message-ID: <0bf810ca-30b1-4a3d-81e3-614b75b427ca@googlegroups.com> (raw)
In-Reply-To: <20150117193712.GA73003-bi+AKbBUZKbivNSvqvJHCtPlBySK3R6THiGdP5j34PU@public.gmane.org>


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

Yes, when I try [wiki](foo) then I get an href to "foo.pdf" which is not
what I want.

That is, "[wiki](foo)" is parsed nicely but gets rendered to the latex as
"\href{foo}{wiki}", while instead
I want it to get rendered to (the equivalent of "wiki \cite{@foo}").

Instead, what I want is to have

  "this is [wiki][foo]"

together with

  "[foo]: http://www.foo.com"

(elsewhere in the document) to be converted to a link to www.foo.com.

(Which works just fine in the main document, but not the bits that are
going through my filter...

On Saturday, January 17, 2015 at 11:37:27 AM UTC-8, John MacFarlane wrote:
>
> Are you sure you don't mean `[wiki](foo)`? 
>
> `[wiki][foo]` will only be a Markdown link if the reference `foo` is 
> defined elsewhere in the document. 
>
> +++ Ranjit Jhala [Jan 17 15 06:03 ]: 
> >Hi, 
> > 
> >I am writing  a small filter for converting from markdown to latex, and 
> >getting the odd behavior, reproduced below 
> >via GHCi: 
> > 
> >> Prelude Text.Pandoc.JSON Text.Pandoc> readMarkdown  def "this is 
> >[wiki][foo]" 
> > 
> >Pandoc (Meta {unMeta = fromList []}) [Para [Str "this",Space,Str 
> "is",Space, 
> >Str "[wiki][foo]"]] 
> > 
> > 
> >Namely, the citation `[wiki][foo]` is read as a String, and hence when 
> >converted 
> >to LaTeX rendered the wrong way (i.e. without the HREF). 
> > 
> >I suspect I have the wrong `ReaderOptions` in `def`  -- but I don't know 
> >which flags to add. 
> > 
> >I am writing this filter following the suggestion from here: 
> > 
> >  https://groups.google.com/d/msg/pandoc-discuss/Kd1L4Rg0dx0/NZvgcMcz9NQJ 
> > 
> > the above only happens inside the filtered blocks -- citations of the 
> >above form work just fine when inside the "regular" 
> > unfiltered document. 
> > 
> >Any suggestions would be most welcome! 
> > 
> >Ranjit. 
> > 
> > 
> >-- 
> >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-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <javascript:>. 
> >To post to this group, send email to pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org 
> <javascript:>. 
> >To view this discussion on the web visit 
> https://groups.google.com/d/msgid/pandoc-discuss/50c32618-284b-4990-bcc2-7627e17d3d42%40googlegroups.com. 
>
> >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/0bf810ca-30b1-4a3d-81e3-614b75b427ca%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

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

  parent reply	other threads:[~2015-01-17 21:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-17 14:03 Ranjit Jhala
     [not found] ` <50c32618-284b-4990-bcc2-7627e17d3d42-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2015-01-17 14:23   ` Ranjit Jhala
2015-01-17 19:37   ` John MacFarlane
     [not found]     ` <20150117193712.GA73003-bi+AKbBUZKbivNSvqvJHCtPlBySK3R6THiGdP5j34PU@public.gmane.org>
2015-01-17 21:31       ` Ranjit Jhala [this message]
     [not found]         ` <0bf810ca-30b1-4a3d-81e3-614b75b427ca-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2015-01-17 22:58           ` Matthew Pickering
     [not found]             ` <CALuQ0m-S3P_kbYjb6ffdLKNbZjVoNkay1CcJ5Y0RB_9aU=e2MA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-01-18  4:01               ` Ranjit Jhala

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=0bf810ca-30b1-4a3d-81e3-614b75b427ca@googlegroups.com \
    --to=rjhala-fwt/sz2fbdz2fbvcvol8/a@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).