Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Define the web application's foundation, in the usual Yesod style. See a default Yesod app's comments for more details of each part.
Synopsis
- data App = App {}
- type Handler = HandlerFor App
- type Widget = WidgetFor App ()
- resourcesApp :: [ResourceTree String]
- type AppRoute = Route App
- type Form a = Html -> MForm Handler (FormResult a, Widget)
- data ViewData = VD {}
- getViewData :: Handler ViewData
- checkServerSideUiEnabled :: Handler ()
- shouldShowSidebar :: Handler Bool
- getCurrentJournal :: IORef Journal -> CliOpts -> Day -> Handler (Journal, Maybe String)
Documentation
The site argument for your application. This can be a good place to keep settings and values requiring initialization before your application starts running, such as database connections. Every handler will have access to the data present here.
App | |
|
Instances
Creates the route datatype AppRoute. Every valid URL in your
Creates the associated type:
Creates the value resourcesApp which contains information on the
type Handler = HandlerFor App Source #
resourcesApp :: [ResourceTree String] Source #
defines things like: type Handler = HandlerFor App -- HandlerT App IO, https://www.yesodweb.com/book/routing-and-handlers#routing-and-handlers_handler_monad type Widget = WidgetFor App () -- WidgetT App IO (), https://www.yesodweb.com/book/widgets
A bundle of data useful for hledger-web request handlers and templates.
VD | |
|
getViewData :: Handler ViewData Source #
Gather data used by handlers and templates in the current request.
shouldShowSidebar :: Handler Bool Source #
Find out if the sidebar should be visible. Show it, unless there is a showsidebar cookie set to "0", or a ?sidebar=0 query parameter.
getCurrentJournal :: IORef Journal -> CliOpts -> Day -> Handler (Journal, Maybe String) Source #
Update our copy of the journal if the file changed. If there is an error while reloading, keep the old one and return the error, and set a ui message.