Re: shakespeare-js seems to produce empty js files
Greg Weber <
greg@...>
2012-03-01 13:50:41 GMT
is there any error output in the console? Do you have the coffee
binary installed?
On Thu, Mar 1, 2012 at 2:01 AM, Lambda <lambdadusk@...> wrote:
> I've put a debug message in my whenExists, like this:
>
> whenExists :: String -> String -> (FilePath -> Q Exp) -> Q Exp
> whenExists x glob f = do
> let fn = DU.globFile glob x
> e <- qRunIO $ doesFileExist fn
> qRunIO $ putStrLn $ fn ++ ": " ++ show e
> if e then f fn else [|mempty|]
>
> The output is:
>
> templates/default-layout.hamlet: True
> templates/default-layout.coffee: True
> templates/default-layout.lucius: True
>
> So the coffee file is found properly.
>
> Am Donnerstag, 1. März 2012 07:45:33 UTC+1 schrieb Greg Weber:
>>
>> I am using coffeescript in about the same way. You aren't operating on
>> much information here. You should start by putting a debug print in
>> your whenExists function if the file is not found.
>>
>> The next release of yesod-default will make it a little easier to use
>> coffeescript.
>>
>> On Wed, Feb 29, 2012 at 6:05 PM, Lambda <lambdadusk@...> wrote:
>> > I'm sorry I'm a bit fuzzy on this one, because I don't understand
>> > enough about the workings of julius to explain the problem properly.
>> >
>> > I have in my templates folder the files "default-layout.hamlet",
>> > "default-layout.lucius" and "default-layout.coffee". I want them all
>> > three in my standard base template. There is no trouble with the
>> > hamlet or lucius file, however.
>> >
>> > But the generated .js file included to the website remains empty. I
>> > wrote my own widgetFile to handle .coffee automatically, cf.
>> > https://gist.github.com/1922803
>> >
>> > So I thought, there'd be an error in there, and I compiled the .coffee
>> > to a .julius and used the standard widgetFile from yesod-default.
>> > The .js file in the website remained empty.
>> >
>> > Last, I added a line "addJulius $(juliusFile "templates/default-
>> > layout.julius")" to the defaultLayout in the Foundation.hs. This works
>> > and gives me the right .js file. When I then change it to "addJulius $
>> > (coffeeFile "templates/default-layout.coffee")", the .js file empty
>> > again, even though everything compiles fine.
>> >
>> > Am I right with my assumption that the coffee support is plainly not
>> > producing any output?