hbro-contrib-1.0.0.0: Third-party extensions to hbro.

Safe HaskellNone

Hbro.Bookmarks

Description

Designed to be imported as qualified.

Synopsis

Documentation

data Entry Source

Constructors

Entry 

Fields

mURI :: URI
 
mTags :: [String]
 

Instances

add :: (Functor m, MonadIO m, MonadReader r m, HasWebView r, MonadError HError m) => IO FilePath -> [String] -> m ()Source

Add current webpage to bookmarks with given tags

addCustomSource

Arguments

:: (MonadIO m, MonadError HError m) 
=> IO FilePath

Bookmarks' database file

-> Entry

New bookmarks entry

-> m () 

Add a custom entry to bookmarks

selectSource

Arguments

:: (Functor m, MonadIO m, MonadError HError m) 
=> IO FilePath

Bookmarks' database file

-> [String]

dmenu's commandline options

-> m URI 

Open a dmenu with all (sorted alphabetically) bookmarks entries, and return the user's selection, if any.

selectTagSource

Arguments

:: (Functor m, MonadIO m, MonadError HError m) 
=> IO FilePath

Bookmarks' database file

-> [String]

dmenu's commandline options

-> m [URI] 

Open a dmenu with all (sorted alphabetically) bookmarks tags, and return the user's selection, if any.

deleteWithTagSource

Arguments

:: (Functor m, MonadIO m, MonadError HError m) 
=> IO FilePath

Bookmarks' database file

-> [String]

dmenu's commandline options

-> m () 

popOldest :: PortableFilePath -> String -> IO (Maybe URI) popOldest file tags = do

Return a random Bookmark entry with a given tag, while removing it from bookmarks. popRandom :: PortableFilePath -> String -> IO (Maybe URI) popRandom file tags = do file' <- resolve file result <- try . readFile $ file' file'' either (\e - errorHandler file' e >> return Nothing) (x -> return $ Just x) result

Remove all bookmarks entries matching the given tag.