yesod-comments alternatives and similar packages
Based on the "yesod" category.
Alternatively, view yesod-comments alternatives based on common mentions on social networks and blogs.
-
yesod-persistent
A RESTful Haskell web framework built on WAI. -
yesod-fay
Utilities for using the Fay Haskell-to-JS compiler with Yesod. -
yesod-dsl
A domain specific language and a code generator desined to create RESTful services for managing an RDBMS with Yesod web framework and Persistent. -
yesod-crud
Generic administrative CRUD operations as a Yesod subsite -
yesod-auth-hashdb
Yesod.Auth.HashDB plugin, now moved out of main yesod-auth package -
yesod-routes-typescript
generate TypeScript routes for Yesod -
yesod-auth-fb
Authentication backend for Yesod using Facebook. -
yesod-content-pdf
Library for serving PDF content from a Yesod Application -
yesod-recaptcha
Dead simple support for reCAPTCHA on Yesod applications. -
yesod-form-bootstrap4
yesod-form for bootstrap version 4 -
yesod-worker
Drop-in(ish) background worker system for Yesod applications -
yesod-auth-account-fork
Fork of yesod-auth-account with a few additions -
yesod-transloadit
A resuable widget for the Transloadit service & Yesod -
yesod-raml
Generate Yesod framework route definitions, documentaiton, mock-handler, and more from your RAML spec. -
yesod-crud-persist
Easy CRUD subsites for yesod with persistent -
yesod-auth-smbclient
Authentication plugin for Yesod using smbclient -
yesod-datatables
Routines for implementing server-side processing for DataTables (jQuery grid) in Haskell -
yesod-auth-zendesk
Zendesk remote authentication support for Yesod apps. -
yesod-auth-hmac-keccak
An account authentication plugin for yesod with encrypted token transfer. -
yesod-auth-bcrypt
BCrypt salted and hashed passwords in a database as auth for yesod -
yesod-auth-deskcom
Desk.com Multipass support for Yesod apps. -
yesod-pnotify
yet another getMessage/setMessage using pnotify jquery plugins -
yesod-test-json
Utility functions for testing JSON web services written in Yesod -
yesod-auth-ldap-native
Yesod LDAP authentication plugin using native Haskell Ldap.Client -
yesod-paypal-rest
Yesod plugin to use PayPal with the paypal-rest-client library. -
yesod-articles
Automatically generate article previews for a yesod site -
yesod-s3
Simple Helper Library for using Amazon's Simple Storage Service (S3) with Yesod
Static code analysis for 29 languages.
Do you think we are missing an alternative of yesod-comments or a related project?
README
Yesod Comments
A drop-in comments module for a Yesod application.
Installation
# Stable
$ cabal install yesod-coments
# Development
$ git clone https://github.com/pbrisbin/yesod-comments
$ cd yesod-comments
$ cabal install
Usage
Make your foundation type an instance of YesodComments
:
import Yesod.Comments
instance YesodComments MySite where
--
-- Store comments using YesodPersist. It's the only backend
-- available at this time.
--
commentStorage = persistStorage
--
-- userDetails :: UserId -> Handler (Maybe UserDetails)
--
-- This maps an AuthId m to more useful details like friendly name
-- and email address.
--
userDetails = undefined
Next, add comments to some view somewhere. You only have to provide a unique thread identifier, and the widget will handle showing existing comments and a form for submitting new ones.
Note: Users must be authenticated to comment, therefore your site
must be an instance of YesodAuth
in order to use YesodComments
.
-- addComments handles displaying the form on GET and processing it on
-- POST, this follows the common Yesod idiom of handling both methods
-- with one handler:
getPostR :: String -> Handler RepHtml
getPostR slug = do
post <- getPostBySlug slug
defaultLayout $ do
setTitle "A post"
[whamlet|
<div .content>
#{postContent post}
<div .comments>
#{addComments slug}
|]
postPostR :: String -> Handler RepHtml
postPostR = getPostR
Finally, add a migrateComments
call to your Application runner.
makeFoundation :: AppConfig DefaultEnv () -> Logger -> IO MySite
makeFoundation conf setLogger = do
--
-- ...
--
Database.Persist.Store.runPool dbconf (runMigration migrateComments) p
return $ MySite conf setLogger s p manager dbconf
Administration
An administration subsite is provided to allow users to edit and delete comments they've left themselves. Any additional moderation must be done manually (for now).
Add the subsite to your routes:
/comments CommentsAdminR CommentsAdmin getCommentsAdmin
Optionally, define a few more functions in the YesodComments
instance:
instance YesodComments MySite where
--
-- ...
--
-- How to get from a thread identifier to the page where it resides,
-- this is used to provide links back from the "my comments" page
threadRoute = Just $ \thread -> PostR thread
-- How to get to the subsite's Edit action for a comment
editRoute = Just $ \thread cid -> CommentsAdminR $ EditCommentR thread cid
-- How to get to the subsite's Delete action for a comment
deleteRoute = Just $ \thread cid -> CommentsAdminR $ DeleteCommentR thread cid
With these defined, Edit and Delete links will appear whenever a user sees a comment they've left.
Styling
There is no styling provided by this library, but the markup is designed
for Twitter's Bootstrap. If you use that, it should look OK out of the
box. Even if you don't, the div
s that Bootstrap requires should be
more than adequate for creating your own styles.