public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* readMarkdown Ignoring Links (in filter)
@ 2015-01-17 14:03 Ranjit Jhala
       [not found] ` <50c32618-284b-4990-bcc2-7627e17d3d42-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: Ranjit Jhala @ 2015-01-17 14:03 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw


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

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-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/50c32618-284b-4990-bcc2-7627e17d3d42%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

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

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

* Re: readMarkdown Ignoring Links (in filter)
       [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
  1 sibling, 0 replies; 6+ messages in thread
From: Ranjit Jhala @ 2015-01-17 14:23 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw


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

Also, I should add, everything works fine if I use the full URL instead, 
i.e. "this is [wiki](http://www.foo.com)".

On Saturday, January 17, 2015 at 6:03:18 AM UTC-8, Ranjit Jhala wrote:
>
> 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-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/28b2fdce-fb75-4705-8133-27acf99ebc7d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

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

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

* Re: readMarkdown Ignoring Links (in filter)
       [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>
  1 sibling, 1 reply; 6+ messages in thread
From: John MacFarlane @ 2015-01-17 19:37 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

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-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/50c32618-284b-4990-bcc2-7627e17d3d42%40googlegroups.com.
>For more options, visit https://groups.google.com/d/optout.


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

* Re: readMarkdown Ignoring Links (in filter)
       [not found]     ` <20150117193712.GA73003-bi+AKbBUZKbivNSvqvJHCtPlBySK3R6THiGdP5j34PU@public.gmane.org>
@ 2015-01-17 21:31       ` Ranjit Jhala
       [not found]         ` <0bf810ca-30b1-4a3d-81e3-614b75b427ca-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: Ranjit Jhala @ 2015-01-17 21:31 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw


[-- 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 --]

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

* Re: readMarkdown Ignoring Links (in filter)
       [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>
  0 siblings, 1 reply; 6+ messages in thread
From: Matthew Pickering @ 2015-01-17 22:58 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

This is the limitation of the approach I suggested. The parsing
happens in a completely separate environment to that of the original
document.

On Sat, Jan 17, 2015 at 9:31 PM, Ranjit Jhala <rjhala-fWt/sZ2FBdz2fBVCVOL8/A@public.gmane.org> wrote:
> 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...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>> >To post to this group, send email to pandoc-...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>> >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.


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

* Re: readMarkdown Ignoring Links (in filter)
       [not found]             ` <CALuQ0m-S3P_kbYjb6ffdLKNbZjVoNkay1CcJ5Y0RB_9aU=e2MA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2015-01-18  4:01               ` Ranjit Jhala
  0 siblings, 0 replies; 6+ messages in thread
From: Ranjit Jhala @ 2015-01-18  4:01 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw


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

Hi Matthew,

I think I solved the problem using a <span>...</span>. I forked and updated 
your gist to:

    https://gist.github.com/ranjitjhala/171aa922204aa84c7b3d

which seems to do the trick for me.

Thanks a lot!

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-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/e4de2926-5dbc-46a1-9575-15ea4d8f262f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

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

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

end of thread, other threads:[~2015-01-18  4:01 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-17 14:03 readMarkdown Ignoring Links (in filter) 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
     [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

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