agocorona / MFlow

(Haskell) Web application server with stateful, type safe user interactions and widget combinators
http://mflowdemo.herokuapp.com
Other
100 stars 12 forks source link

local image files not found #36

Closed stuartallenmills closed 9 years ago

stuartallenmills commented 10 years ago

Works from within a page: img ! src (fromString //ganglia.wikimedia.org/latest/img/spinner.gif)

but img ! src (fromString "cornell.jpg")

does not. In code below s1 is the variable

runNavigation "" . step $ do r <- page $ h3 << "Basic example with inputs and links " ++> img ! src (fromString s1) ++> getString (Just "text input") <* submitButton "OK"

I've been combing the docs - but there is a lot of stuff (good stuff!) there.

agocorona commented 10 years ago

Hi,

Thanks for trying MFlow.

It is necessary to establish the root folder of the files with setFilesPath.

In the demo, this path is the folder Demos:

setFilesPath "Demos/"

that is done in the main of demos-blaze.hs.

With that, it should work.

2014-06-03 3:31 GMT+02:00, stuartallenmills notifications@github.com:

Works from within a page: img ! src //ganglia.wikimedia.org/latest/img/spinner.gif

but img ! src "cornell.jpg"

does not.

I've been combing the docs - but there is a lot of stuff (good stuff!) there.


Reply to this email directly or view it on GitHub: https://github.com/agocorona/MFlow/issues/36

Alberto.

stuartallenmills commented 10 years ago

Thanks for the quick response. MFlow looks very powerful and comprehensive.

I apologize for overlooking the setFilesPath command in the Demos and taking up your time.

One thing you might find interesting is that the emacs plugin flycheck-haskell cannot find the package "MFlow.Wai.Blaze.Html.All" regardless of what package database it's in (global, user, sandbox) when runghc is enabled in the flycheck-haskell configuration.

This is the ONLY package I have encountered with this problem; with runghc enabled flycheck-haskell has worked correctly with sandboxes with all other packages.

To work with MFlow with error-checking I have to disable runghc and install MFlow in the user or global package databases. I spent some time trying to identify the problem but was unsuccessful. My best guess is that the "depth" and number of packages of your "All" is causing flycheck-haskell to blow up at some point.

Thanks again for your time.

Stuart

On 6/3/2014 12:05 AM, agocorona wrote:

Hi,

Thanks for trying MFlow.

It is necessary to establish the root folder of the files with setFilesPath.

In the demo, this path is the folder Demos:

setFilesPath "Demos/"

that is done in the main of demos-blaze.hs.

With that, it should work.

2014-06-03 3:31 GMT+02:00, stuartallenmills notifications@github.com:

Works from within a page: img ! src //ganglia.wikimedia.org/latest/img/spinner.gif

but img ! src "cornell.jpg"

does not.

I've been combing the docs - but there is a lot of stuff (good stuff!) there.


Reply to this email directly or view it on GitHub: https://github.com/agocorona/MFlow/issues/36

Alberto.

— Reply to this email directly or view it on GitHub https://github.com/agocorona/MFlow/issues/36#issuecomment-44926612.

agocorona commented 10 years ago

Thanks to you Stuart.

setFilesPath is not easy to catch since it was not mentioned very much.

By the way, to complete the documentation, with:

setFilesPath $ getConfig "filesPath" "my/path/by/default"

it set the path by default, but later the user can change it in the mflow.config file when he need it.

As you said, Probably the depth of the path is the cause of the problem with the emacs plugin.

2014-06-04 1:19 GMT+02:00, stuartallenmills notifications@github.com:

Thanks for the quick response. MFlow looks very powerful and comprehensive.

I apologize for overlooking the setFilesPath command in the Demos and taking up your time.

One thing you might find interesting is that the emacs plugin flycheck-haskell cannot find the package "MFlow.Wai.Blaze.Html.All" regardless of what package database it's in (global, user, sandbox) when runghc is enabled in the flycheck-haskell configuration.

This is the ONLY package I have encountered with this problem; with runghc enabled flycheck-haskell has worked correctly with sandboxes with all other packages.

To work with MFlow with error-checking I have to disable runghc and install MFlow in the user or global package databases. I spent some time trying to identify the problem but was unsuccessful. My best guess is that the "depth" and number of packages of your "All" is causing flycheck-haskell to blow up at some point.

Thanks again for your time.

Stuart

On 6/3/2014 12:05 AM, agocorona wrote:

Hi,

Thanks for trying MFlow.

It is necessary to establish the root folder of the files with setFilesPath.

In the demo, this path is the folder Demos:

setFilesPath "Demos/"

that is done in the main of demos-blaze.hs.

With that, it should work.

2014-06-03 3:31 GMT+02:00, stuartallenmills notifications@github.com:

Works from within a page: img ! src //ganglia.wikimedia.org/latest/img/spinner.gif

but img ! src "cornell.jpg"

does not.

I've been combing the docs - but there is a lot of stuff (good stuff!) there.


Reply to this email directly or view it on GitHub: https://github.com/agocorona/MFlow/issues/36

Alberto.

— Reply to this email directly or view it on GitHub https://github.com/agocorona/MFlow/issues/36#issuecomment-44926612.


Reply to this email directly or view it on GitHub: https://github.com/agocorona/MFlow/issues/36#issuecomment-45032817

Alberto.