Coder Social home page Coder Social logo

Comments (6)

gregwebs avatar gregwebs commented on July 3, 2024

widgetFile works as designed. You need to override the implementation, not sure if there is documentation for that.

The error you get is from the shakespeareRuntime code path (I believe not finding your routes in scope). I would guess that it has nothing to do with coffeescript.

from shakespeare.

pacak avatar pacak commented on July 3, 2024

Exactly the same code works fine with other JavaScript template language and if overriding widgetFile to support coffee script means something completely different from overriding it for julius (other than providing different extension name and parsing functions - it is broken. Especially is there is no documentation explaining you why coffee script is that different from Julius from yesod's point of view.

As far as I understand whole idea of scaffold is in having some sane set of defaults that you can use as is without having to write this code yourself, unless you want something strange (like using head or tail functions from Prelude, heh :) ).

from shakespeare.

pacak avatar pacak commented on July 3, 2024

http://comments.gmane.org/gmane.comp.lang.haskell.yesod/2700

from shakespeare.

snoyberg avatar snoyberg commented on July 3, 2024

This has been addressed in yesod devel, but as Greg mentioned, there's no built-in support for Coffeescript in widgetFile. If we include Coffeescript with the same level of control as Julius is supported, this problem will be resolved.

from shakespeare.

gregwebs avatar gregwebs commented on July 3, 2024

Is there documentation somewhere on how to override widgetFile?

widgetFile :: String -> Q Exp 
widgetFile = (if development then widgetFileReload else widgetFileNoReload )
    widgetFileSettings
  where
    widgetFileSettings = def { wfsLanguages = λhset  defaultTemplateLanguages hset 
        [ 
          TemplateLanguage True  "coffee"  Text.Coffee.coffeeFile   Text.Coffee.coffeeFileReload
      ] } 

from shakespeare.

snoyberg avatar snoyberg commented on July 3, 2024

I copied that information to https://github.com/yesodweb/yesod/wiki/Overriding-widgetFile, and I'll link to that Wiki page from the scaffolding. Should we close this issue?

from shakespeare.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.