From 07c159d23f04cb56c8a71f531b491104cc725152 Mon Sep 17 00:00:00 2001 From: porges Date: Sun, 7 Dec 2008 08:22:19 +0000 Subject: add unicode output --- src/Main.hs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/Main.hs') diff --git a/src/Main.hs b/src/Main.hs index 810c227e..cde7790c 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -242,7 +242,7 @@ render flags ifaces installedIfaces = do getDataDir -- provided by Cabal #endif fs -> return (last fs) - + let unicode = Flag_UseUnicode `elem` flags let css_file = case [str | Flag_CSS str <- flags] of [] -> Nothing fs -> Just (last fs) @@ -300,7 +300,7 @@ render flags ifaces installedIfaces = do ppHtml title packageStr visibleIfaces odir prologue maybe_html_help_format maybe_source_urls maybe_wiki_urls - maybe_contents_url maybe_index_url + maybe_contents_url maybe_index_url unicode copyHtmlBits odir libDir css_file when (Flag_Hoogle `elem` flags) $ do @@ -425,6 +425,9 @@ handleEasyFlags flags = do when (Flag_Version `elem` flags) byeVersion when (Flag_GhcVersion `elem` flags) byeGhcVersion + when (Flag_UseUnicode `elem` flags && not (Flag_Html `elem` flags)) $ + throwE ("Unicode can only be enabled for HTML output.") + when ((Flag_GenIndex `elem` flags || Flag_GenContents `elem` flags) && Flag_Html `elem` flags) $ throwE ("-h cannot be used with --gen-index or --gen-contents") -- cgit v1.2.3