-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Utilities for using YUI3 with Happstack. -- -- Bundles YUI 3.5.1 and includes a "combo handler" for use in Happstack -- which concatenates YUI modules server-side to send in a single HTTP -- request. The YUI bundle can be embedded in compiled code with Template -- Haskell (install with -fembed) which means the files are -- served directly from memory, and also that you can compile and deploy -- a single executable without having to worry about deploying the YUI -- files as well. -- -- The benefits of using this over the Yahoo! CDN is that you can work -- offline and that you can host YUI yourself without sacrificing the -- benefits of "combo loading". -- -- The versioning scheme of this package is that the first part is the -- targeted Happstack series plus the bundled YUI version, such that 7351 -- means "Happstack 7, YUI 3.5.1". The second part is the major version -- of this package itself, as defined by the Package Versioning Policy. -- -- The package also includes some utilities for working with the YUI CSS -- modules. In a future release, the plan is to add more utilities, for -- example a combo handler for YUI modules written using JMacro, a bridge -- between HSX and YUI Node objects and tools for making it easier to -- work with modules like Uploader and Pjax. -- -- For an example application, see: -- https://github.com/dag/happstack-yui/blob/master/demo/happstack-yui-demo.hs @package happstack-yui @version 7351.3.0 module Happstack.Server.YUI -- | Mounts a handler for serving YUI. -- -- The handler responds to these routes: -- -- -- -- The version number of the bundled YUI release is included in the -- routes for sake of cache-busting: the routes all respond with -- far-future expiration dates. implYUISite :: Text -> Text -> ServerPartT IO Response -- | Gets the class name for the grid unit of the ratio of the two argument -- integers. YUI doesn't define redundant classes like "6/24" because -- that is the same as 1/4 and presumably for sake of a smaller CSS file. -- This helper function handles that for you, though: -- --
--   >>> gridUnit 6 24
--   "yui3-u-1-4"
--   
-- -- The intention is for this function to be used in templates to create -- values for class attributes, for example with HSP: -- --
--   <div class=(gridUnit 6 24)>
--     <% someContent %>
--   </div>
--   
gridUnit :: Integer -> Integer -> Text -- | Converts a pixel size to a percentage suitable for use with the CSS -- fonts module: -- --
--   >>> fontSize 16
--   "123.1%"
--   
-- -- Useful in generated stylesheets, for example with HSP: -- --
--   <style>
--     h1 { font-size: <% fontSize 26 %> }
--   </style>
--   
fontSize :: Integer -> Text -- | Tells if a file is included in the YUI bundle. -- --
--   >>> isYUIFile "yui/yui-min.js"
--   True
--   
isYUIFile :: FilePath -> IO Bool -- | Reads the contents of a file included in the YUI bundle. readYUIFile :: FilePath -> IO ByteString