renderIO :: Doc -> IO Text.Lazy.Text
renderIO doc = do
    wid <- size >>= \s -> case s of
        Just (Window _ w) -> return w
        Nothing -> return 80
    prefs <- readColourPrefs
    hasPygments <- isJust <$> findExecutable "pygments"
    let opts = PrettyPrintOptions { prettyPrintWidth = wid
                                  , prettyPrintHasPygments = hasPygments
                                  , prettyPrintColourPrefs = prefs
                                  }
    renderIOWith opts doc

-- |
-- Renders a 'Doc' doing 'IO' with some set of options
renderIO :: Doc -> IO Text.Lazy.Text
renderIO doc = do
    wid <- size >>= \s -> case s of
        Just (Window _ w) -> return w
        Nothing -> return 80
    prefs <- readColourPrefs
    hasPygments <- isJust <$> findExecutable "pygments"
    let opts = PrettyPrintOptions { prettyPrintWidth = wid
                                  , prettyPrintHasPygments = hasPygments
                                  , prettyPrintColourPrefs = prefs
                                  }
    renderIOWith opts doc

-- |
-- Renders a 'Doc' doing 'IO' with some set of options
renderIO doc = do
    wid <- size >>= \s -> case s of
        Just (Window _ w) -> return w
        Nothing -> return 80
    prefs <- readColourPrefs
    hasPygments <- isJust <$> findExecutable "pygments"
    let opts = PrettyPrintOptions { prettyPrintWidth = wid
                                  , prettyPrintHasPygments = hasPygments
                                  , prettyPrintColourPrefs = prefs
                                  }
    renderIOWith opts doc

-- |
-- Renders a 'Doc' doing 'IO' with some set of options