Forum How do I...?

--remap being ignored

matt
I'm trying to source images from paths other than the baseurl (I have multiple places from which I'm pulling images on my local system).

But it seems like --remap only works on http:// urls.

With this html:

<!DOCTYPE html>
<html>
<head>
  <title></title>
</head>
<body>
  <img src="LIB/duck.jpg">
</body>
</html>


this happens:

$ prince /tmp/test.html --remap=LIB=/tmp/mylib/
prince: warning: --remap option ignored
prince: /tmp/LIB/duck.jpg: warning: can't open input file: No such file or directory
mikeday
Yes, currently remap only applies to HTTP URLs.
matt
Could it be made to work on arbitrary strings instead?
hallvord
That's a question Mike will have to answer - I'll just note in case it might help that you could try the --baseurl=URL option and/or run a local server. For example if you have Python installed running the command
python -m SimpleHTTPServer

gives you an instant HTTP server on localhost. So
$ prince http://localhost:8000/tmp/test.html --remap=http://localhost:8000/LIB=http://localhost:8000/tmp/mylib/

might work :)

Announcement: repos for tests/utils

Edited by hallvord

wangp
The right hand side of the remap argument is always a path, though.

You just need to give Prince a base URL that has http or https as the protocol:
prince test.html --baseurl http://myproject/test.html --remap=http://myproject/LIB=mylib
hallvord
Ah yes, you're right about the right hand side - ought to be a path.
Documentation says baseurl and remap are mutually incompatible.. I haven't tested this approach.

Announcement: repos for tests/utils

matt
Yes, that's the approach I'm taking right now:

... --remap http://LIB=/path/to/lib


I'd prefer doing it without the scheme, since it's not actually http, but I can live with it.