-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Static file serving subsite for Yesod Web Framework.
--   
--   Static file serving subsite for Yesod Web Framework.
@package yesod-static
@version 1.2.0.1


-- | Serve static files from a Yesod app.
--   
--   This is great for developing your application, but also for a
--   dead-simple deployment. Caching headers are automatically taken care
--   of.
--   
--   If you are running a proxy server (like Apache or Nginx), you may want
--   to have that server do the static serving instead.
--   
--   In fact, in an ideal setup you'll serve your static files from a
--   separate domain name to save time on transmitting cookies. In that
--   case, you may wish to use <a>urlRenderOverride</a> to redirect
--   requests to this subsite to a separate domain name.
--   
--   Note that this module's static subsite ignores all files and
--   directories that are hidden by Unix conventions (i.e. start with a
--   dot, such as <tt>".ssh"</tt>) and the directory <a>tmp</a> on the root
--   of the directory with static files.
module Yesod.Static

-- | Type used for the subsite with static contents.
newtype Static
Static :: StaticSettings -> Static
type StaticRoute = Route Static

-- | Produce a default value of <a>Static</a> for a given file folder.
--   
--   Does not have index files or directory listings. The static files'
--   contents <i>must not</i> change, however new files can be added.
static :: FilePath -> IO Static

-- | Same as <a>static</a>, but does not assumes that the files do not
--   change and checks their modification time whenever a request is made.
staticDevel :: FilePath -> IO Static

-- | Produce a <a>Static</a> based on embedding all of the static files'
--   contents in the executable at compile time. Nota Bene: if you replace
--   the scaffolded <a>static</a> call in Settings/StaticFiles.hs you will
--   need to change the scaffolded addStaticContent. Otherwise, some of
--   your assets will be 404'ed. This is because by default yesod will
--   generate compile those assets to <tt>static/tmp</tt> which for
--   <a>static</a> is fine since they are served out of the directory
--   itself. With embedded static, that will not work. You can easily
--   change <tt>addStaticContent</tt> to <tt>_ _ _ -&gt; return
--   Nothing</tt> as a workaround. This will cause yesod to embed those
--   assets into the generated HTML file itself.
embed :: FilePath -> Q Exp

-- | Combine multiple CSS files together. Common usage would be:
--   
--   <pre>
--   &gt;&gt;&gt; combineStylesheets' development def 'StaticR [style1_css, style2_css]
--   </pre>
--   
--   Where <tt>development</tt> is a variable in your site indicated
--   whether you are in development or production mode.
--   
--   Since 1.2.0
combineStylesheets' :: Bool -> CombineSettings -> Name -> [Route Static] -> Q Exp

-- | Combine multiple JS files together. Common usage would be:
--   
--   <pre>
--   &gt;&gt;&gt; combineScripts' development def 'StaticR [script1_js, script2_js]
--   </pre>
--   
--   Where <tt>development</tt> is a variable in your site indicated
--   whether you are in development or production mode.
--   
--   Since 1.2.0
combineScripts' :: Bool -> CombineSettings -> Name -> [Route Static] -> Q Exp

-- | Data type for holding all settings for combining files.
--   
--   This data type is a settings type. For more information, see:
--   
--   <a>http://www.yesodweb.com/book/settings-types</a>
--   
--   Since 1.2.0
data CombineSettings

-- | File path containing static files.
--   
--   Default: static
--   
--   Since 1.2.0
csStaticDir :: CombineSettings -> FilePath

-- | Post processing to be performed on CSS files.
--   
--   Default: Use Lucius to minify.
--   
--   Since 1.2.0
csCssPostProcess :: CombineSettings -> [FilePath] -> ByteString -> IO ByteString

-- | Post processing to be performed on Javascript files.
--   
--   Default: Pass-through.
--   
--   Since 1.2.0
csJsPostProcess :: CombineSettings -> [FilePath] -> ByteString -> IO ByteString

-- | Pre-processing to be performed on CSS files.
--   
--   Default: convert all occurences of <i>static</i> to ../
--   
--   Since 1.2.0
csCssPreProcess :: CombineSettings -> Text -> IO Text

-- | Pre-processing to be performed on Javascript files.
--   
--   Default: Pass-through.
--   
--   Since 1.2.0
csJsPreProcess :: CombineSettings -> Text -> IO Text

-- | Subfolder to put combined files into.
--   
--   Default: combined
--   
--   Since 1.2.0
csCombinedFolder :: CombineSettings -> FilePath

-- | Template Haskell function that automatically creates routes for all of
--   your static files.
--   
--   For example, if you used
--   
--   <pre>
--   staticFiles "static/"
--   </pre>
--   
--   and you had files <tt>"static/style.css"</tt> and
--   <tt>"static/js/script.js"</tt>, then the following top-level
--   definitions would be created:
--   
--   <pre>
--   style_css    = StaticRoute ["style.css"]    []
--   js_script_js = StaticRoute ["js/script.js"] []
--   </pre>
--   
--   Note that dots (<tt>.</tt>), dashes (<tt>-</tt>) and slashes
--   (<tt>/</tt>) are replaced by underscores (<tt>_</tt>) to create valid
--   Haskell identifiers.
staticFiles :: FilePath -> Q [Dec]

-- | Same as <a>staticFiles</a>, but takes an explicit list of files to
--   create identifiers for. The files path given are relative to the
--   static folder. For example, to create routes for the files
--   <tt>"static/js/jquery.js"</tt> and
--   <tt>"static/css/normalize.css"</tt>, you would use:
--   
--   <pre>
--   staticFilesList \"static\" [\"js\/jquery.js\", \"css\/normalize.css\"]
--   </pre>
--   
--   This can be useful when you have a very large number of static files,
--   but only need to refer to a few of them from Haskell.
staticFilesList :: FilePath -> [FilePath] -> Q [Dec]

-- | Same as <a>staticFiles</a>, but doesn't append an ETag to the query
--   string.
--   
--   Using <a>publicFiles</a> will speed up the compilation, since there
--   won't be any need for hashing files during compile-time. However,
--   since the ETag ceases to be part of the URL, the <a>Static</a> subsite
--   won't be able to set the expire date too far on the future. Browsers
--   still will be able to cache the contents, however they'll need send a
--   request to the server to see if their copy is up-to-date.
publicFiles :: FilePath -> Q [Dec]
base64md5 :: ByteString -> String
instance Eq (Route Static)
instance Show (Route Static)
instance Read (Route Static)
instance Default CombineSettings
instance YesodSubDispatch Static m
instance ParseRoute Static
instance RenderRoute Static
