Closed pabloferz closed 8 years ago
I'm wondering why Escher needs to be a special case at all.
pkg/Escher/*
sounds OK to me.
@mdcfrancis
@shashi I'm inclined to agree with you - so /assets could be re-purposed for assets relative to the page definition and everything else is explicit based on package.
I like that idea as it simplify things.
I made the appropriate changes. Does this look better now?
Ok, I think I have to modify escher_make
from /src/cli/compile.jl
and probably update some of the documentation. Would that be all this is missing?
Yeah, I think that's it. Could you rebase and squash commits?
I'm going to do it in a few hours anyway if no updates here. Thanks for the PR!
No problem! I'm happy to help.
Hi all,
I think I still have a problem loading a sample.png file from where my index.jl is.
I've tried the following:
I first launch julia in REPL (cmd windows) and type in the following commands to launch the web server in the directory I want.
using Escher
include(Pkg.dir("Escher", "src", "cli", "serve.jl"))
cd(Pkg.dir("Escher", pwd()))
escher_serve()
Say, my pwd()
is located at C:\escher_test
In C:\escher_test
, I have an index.jl file which runs when I type in the browser http://localhost:5555
From this index.jl file, I'd like to load an image located at C:\escher_test\sample.png
.
I've tried using image("assets/sample.png")
with no luck.
I have also tried the following methods:
image("file:///C:/escher_test/sample.png")
image("/escher_test/sample.png")
image("C:\\escher_test\sample.png")
Furthermore, checking the Chrome inspection console, the img tag has a src="http://localhost:5555/assets/sample.png"
Where is the localhost running on my disk?
Any help appreciated!
Just putting it in an assets
folder (C:\escher_test\assets
in your case) and then using image("assets/sample.png")
should work.
@rohitvarkey That worked, Rohit. Thank you. 👍
Fixes https://github.com/shashi/Escher.jl/issues/81
This moves the access to the
Escher/assets
directory fromassets
toescher/assets
and adds access to the user working path (from where the julia files are loaded) under theassets
name.Now you can load images directly from the directory of your julia file without the need of the
Images
package, which makes specially easy to load svg files.For example, if you have a file
image.svg
in the same path of your escher/julia file, you can load the image asimage("assets/image.svg")
.