public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* Cross-platform file generation
@ 2010-11-22  6:13 Ivan Lazar Miljenovic
       [not found] ` <AANLkTimW0dJFCr_3b1W=HQYwAJU3Hco-wubYsw6AD4hr-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: Ivan Lazar Miljenovic @ 2010-11-22  6:13 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

In my SourceGraph [1] program, I use pandoc as a library to generate
HTML reports (well, this is technically done in another library and
there is support for generating LaTeX, etc. as well but I've never
bothered to write command-line options to specify output type).  As
part of this, the images are saved in a graphs/ sub-directory and
referenced relatively in the actual HTML file, with the referencing
being done with FilePath [2].

[1]: http://hackage.haskell.org/package/SourceGraph
[2]: http://hackage.haskell.org/package/filepath

A user has recently reported to me that when he generates the report
in Windows and then tries to upload the resulting report on the web,
the file references are all wrong: Windows-style path separators are
used, which isn't what is expected/wanted in an HTML file.

Is there any way of fixing/solving this issue?  I could always force
usage of forward-slashes rather than trying to be OS-independent, but
this will probably result in problems if I ever end up letting users
choose to generate a LaTeX document, etc.

-- 
Ivan Lazar Miljenovic
Ivan.Miljenovic-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
IvanMiljenovic.wordpress.com


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

* Re: Cross-platform file generation
       [not found] ` <AANLkTimW0dJFCr_3b1W=HQYwAJU3Hco-wubYsw6AD4hr-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2010-11-22 16:29   ` John MacFarlane
       [not found]     ` <20101122162933.GA3709-nFAEphtLEs+AA6luYCgp0U1S2cYJDpTV9nwVQlTi/Pw@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: John MacFarlane @ 2010-11-22 16:29 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

This doesn't sound like a pandoc problem; it sounds like a problem
with the library that generates the images and the corresponding
links...

If you think it's a pandoc problem, please give a minimal example
of how to reproduce it, using only pandoc.

John

+++ Ivan Lazar Miljenovic [Nov 22 10 17:13 ]:
> In my SourceGraph [1] program, I use pandoc as a library to generate
> HTML reports (well, this is technically done in another library and
> there is support for generating LaTeX, etc. as well but I've never
> bothered to write command-line options to specify output type).  As
> part of this, the images are saved in a graphs/ sub-directory and
> referenced relatively in the actual HTML file, with the referencing
> being done with FilePath [2].
> 
> [1]: http://hackage.haskell.org/package/SourceGraph
> [2]: http://hackage.haskell.org/package/filepath
> 
> A user has recently reported to me that when he generates the report
> in Windows and then tries to upload the resulting report on the web,
> the file references are all wrong: Windows-style path separators are
> used, which isn't what is expected/wanted in an HTML file.
> 
> Is there any way of fixing/solving this issue?  I could always force
> usage of forward-slashes rather than trying to be OS-independent, but
> this will probably result in problems if I ever end up letting users
> choose to generate a LaTeX document, etc.
> 
> -- 
> Ivan Lazar Miljenovic
> Ivan.Miljenovic-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
> IvanMiljenovic.wordpress.com
> 
> -- 
> You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
> To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> To unsubscribe from this group, send email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> For more options, visit this group at http://groups.google.com/group/pandoc-discuss?hl=en.
> 


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

* Re: Cross-platform file generation
       [not found]     ` <20101122162933.GA3709-nFAEphtLEs+AA6luYCgp0U1S2cYJDpTV9nwVQlTi/Pw@public.gmane.org>
@ 2010-11-22 20:32       ` Ivan Lazar Miljenovic
       [not found]         ` <AANLkTi=hefs7yNo4X=y35EvSvVM4b=bKrOnLe7mnKBVj-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: Ivan Lazar Miljenovic @ 2010-11-22 20:32 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

On 23 November 2010 03:29, John MacFarlane <fiddlosopher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> This doesn't sound like a pandoc problem; it sounds like a problem
> with the library that generates the images and the corresponding
> links...
>
> If you think it's a pandoc problem, please give a minimal example
> of how to reproduce it, using only pandoc.

It's not really a pandoc problem per-se; I was just hoping for
suggestions on how to deal with this (and the libraries that generate
the images and links are mine, so there's a very real possibility that
the problem is indeed mine :p).

I think the issue here is that pandoc generates two different types of
files, making it difficult to link to images from another directory:
those that are fundamentally local-based (LaTeX, ODT, etc.) and those
intended for web publication (HTML, S5, etc.).  So I should probably
deal with the links differently depending on the output format (which
I just figured out as I was writing this :s).

-- 
Ivan Lazar Miljenovic
Ivan.Miljenovic-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
IvanMiljenovic.wordpress.com


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

* Re: Cross-platform file generation
       [not found]         ` <AANLkTi=hefs7yNo4X=y35EvSvVM4b=bKrOnLe7mnKBVj-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2010-11-22 21:07           ` John MacFarlane
       [not found]             ` <20101122210731.GB5774-nFAEphtLEs+AA6luYCgp0U1S2cYJDpTV9nwVQlTi/Pw@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: John MacFarlane @ 2010-11-22 21:07 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

+++ Ivan Lazar Miljenovic [Nov 23 10 07:32 ]:
> On 23 November 2010 03:29, John MacFarlane <fiddlosopher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> > This doesn't sound like a pandoc problem; it sounds like a problem
> > with the library that generates the images and the corresponding
> > links...
> >
> > If you think it's a pandoc problem, please give a minimal example
> > of how to reproduce it, using only pandoc.
> 
> It's not really a pandoc problem per-se; I was just hoping for
> suggestions on how to deal with this (and the libraries that generate
> the images and links are mine, so there's a very real possibility that
> the problem is indeed mine :p).
> 
> I think the issue here is that pandoc generates two different types of
> files, making it difficult to link to images from another directory:
> those that are fundamentally local-based (LaTeX, ODT, etc.) and those
> intended for web publication (HTML, S5, etc.).  So I should probably
> deal with the links differently depending on the output format (which
> I just figured out as I was writing this :s).

I see.  Well, maybe a case could be made for handling this in pandoc.
If I understand correctly, you'd like to be able to write

![image](path/to/image.jpg)

and have this appear in HTML as

<img src="path/to/image.jpg" alt="image" />

and in LaTeX either as

\includegraphics{path\to\image.jpg}  [if on windows]

or as

\includegraphics{path/to/image.jpg}  [if on *nix]

Currently pandoc just uses the same path (with necessary escaping)
for all output formats.  But it might be possible to do something
fancier.

John


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

* Re: Cross-platform file generation
       [not found]             ` <20101122210731.GB5774-nFAEphtLEs+AA6luYCgp0U1S2cYJDpTV9nwVQlTi/Pw@public.gmane.org>
@ 2010-11-22 21:13               ` Ivan Lazar Miljenovic
  2010-11-23  8:49               ` Paul R
  1 sibling, 0 replies; 7+ messages in thread
From: Ivan Lazar Miljenovic @ 2010-11-22 21:13 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

On 23 November 2010 08:07, John MacFarlane <fiddlosopher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> I see.  Well, maybe a case could be made for handling this in pandoc.
> If I understand correctly, you'd like to be able to write
>
> ![image](path/to/image.jpg)
>
> and have this appear in HTML as
>
> <img src="path/to/image.jpg" alt="image" />
>
> and in LaTeX either as
>
> \includegraphics{path\to\image.jpg}  [if on windows]
>
> or as
>
> \includegraphics{path/to/image.jpg}  [if on *nix]
>
> Currently pandoc just uses the same path (with necessary escaping)
> for all output formats.  But it might be possible to do something
> fancier.

Right, that's the kind of thing I'm talking about.

-- 
Ivan Lazar Miljenovic
Ivan.Miljenovic-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
IvanMiljenovic.wordpress.com

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to pandoc-discuss+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/pandoc-discuss?hl=en.



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

* Re: Cross-platform file generation
       [not found]             ` <20101122210731.GB5774-nFAEphtLEs+AA6luYCgp0U1S2cYJDpTV9nwVQlTi/Pw@public.gmane.org>
  2010-11-22 21:13               ` Ivan Lazar Miljenovic
@ 2010-11-23  8:49               ` Paul R
       [not found]                 ` <87lj4ktofc.fsf-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  1 sibling, 1 reply; 7+ messages in thread
From: Paul R @ 2010-11-23  8:49 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

Hi, 

John> and in LaTeX either as
John> \includegraphics{path\to\image.jpg} [if on windows]
John> or as
John> \includegraphics{path/to/image.jpg} [if on *nix]

Most latex compilers will understand unix paths even on windows, so
distinction should not be necessary.


-- 
  Paul


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

* Re: Cross-platform file generation
       [not found]                 ` <87lj4ktofc.fsf-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2010-11-23  9:53                   ` Ivan Lazar Miljenovic
  0 siblings, 0 replies; 7+ messages in thread
From: Ivan Lazar Miljenovic @ 2010-11-23  9:53 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

On 23 November 2010 19:49, Paul R <paul.r.ml-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> Hi,
>
> John> and in LaTeX either as
> John> \includegraphics{path\to\image.jpg} [if on windows]
> John> or as
> John> \includegraphics{path/to/image.jpg} [if on *nix]
>
> Most latex compilers will understand unix paths even on windows, so
> distinction should not be necessary.

How about the ODT and RTF writers?

-- 
Ivan Lazar Miljenovic
Ivan.Miljenovic-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
IvanMiljenovic.wordpress.com


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

end of thread, other threads:[~2010-11-23  9:53 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-22  6:13 Cross-platform file generation Ivan Lazar Miljenovic
     [not found] ` <AANLkTimW0dJFCr_3b1W=HQYwAJU3Hco-wubYsw6AD4hr-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-11-22 16:29   ` John MacFarlane
     [not found]     ` <20101122162933.GA3709-nFAEphtLEs+AA6luYCgp0U1S2cYJDpTV9nwVQlTi/Pw@public.gmane.org>
2010-11-22 20:32       ` Ivan Lazar Miljenovic
     [not found]         ` <AANLkTi=hefs7yNo4X=y35EvSvVM4b=bKrOnLe7mnKBVj-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-11-22 21:07           ` John MacFarlane
     [not found]             ` <20101122210731.GB5774-nFAEphtLEs+AA6luYCgp0U1S2cYJDpTV9nwVQlTi/Pw@public.gmane.org>
2010-11-22 21:13               ` Ivan Lazar Miljenovic
2010-11-23  8:49               ` Paul R
     [not found]                 ` <87lj4ktofc.fsf-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2010-11-23  9:53                   ` Ivan Lazar Miljenovic

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