Copyright | (c) 2020 Kowainik (c) 2022 Dmitrii Kovanikov |
---|---|
License | MPL-2.0 |
Maintainer | Dmitrii Kovanikov <kovanikov@gmail.com> |
Stability | Experimental |
Portability | Portable |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Implements a function that opens a given file in a browser.
Since: 0.0.0.0
Synopsis
- openInBrowser :: FilePath -> IO ()
- newtype BrowseException = BrowserNotFoundException String
Documentation
openInBrowser :: FilePath -> IO () Source #
Open a given file in a browser. The function has the following algorithm:
- Check the
BROWSER
environment variable - If it's not set, try to guess browser depending on OS
- If unsuccsessful, print a message
Throws: BrowseException
if can't find a browser.
Since: 0.0.0.0
newtype BrowseException Source #
Exception thrown by openInBrowser
.
Since: 0.0.0.0
BrowserNotFoundException String | Can't find a browser application. Stores the current OS inside. Since: 0.0.0.0 |
Instances
Exception BrowseException Source # | Since: 0.0.0.0 |
Defined in Iris.Browse | |
Show BrowseException Source # | Since: 0.0.0.0 |
Defined in Iris.Browse showsPrec :: Int -> BrowseException -> ShowS # show :: BrowseException -> String # showList :: [BrowseException] -> ShowS # | |
Eq BrowseException Source # | Since: 0.0.0.0 |
Defined in Iris.Browse (==) :: BrowseException -> BrowseException -> Bool # (/=) :: BrowseException -> BrowseException -> Bool # |