From 9b28d21b0a6579d5b97367f5bba3181e04500242 Mon Sep 17 00:00:00 2001 From: "John J. Camilleri" Date: Wed, 28 Nov 2018 13:48:40 +0100 Subject: [PATCH] Remove Htmls.hs --- src/tools/Htmls.hs | 102 --------------------------------------- src/tools/gf-tools.cabal | 4 -- 2 files changed, 106 deletions(-) delete mode 100644 src/tools/Htmls.hs diff --git a/src/tools/Htmls.hs b/src/tools/Htmls.hs deleted file mode 100644 index e4b7d4ccd..000000000 --- a/src/tools/Htmls.hs +++ /dev/null @@ -1,102 +0,0 @@ ----------------------------------------------------------------------- --- | --- Maintainer : AR --- Stability : (stable) --- Portability : (portable) --- --- > CVS $Date: 2005/05/16 17:07:18 $ --- > CVS $Author: aarne $ --- > CVS $Revision: 1.11 $ --- --- chop an HTML file into separate files, each linked to the next and previous. --- the names of the files are n-file, with n = 01,02,... --- the chopping is performed at each separator, here defined as @\" - -link :: FilePath -> Int -> Int -> String -link file mx n = - (if n >= mx-1 then "" else (" Next")) ++ - (if n == 1 then "" else (" Previous")) ++ - (" Contents") ++ - (" Fulltext") ++ - (" First") ++ - (" Last") - where - file_ = fileName file (n - 1) - file' = fileName file (n + 1) - file0 = fileName file 0 - file1 = fileName file 1 - file2 = fileName file (mx - 1) - -fileName :: FilePath -> Int -> FilePath -fileName file n = (if n < 10 then ('0':) else id) $ show n ++ "-" ++ file - -pageNum mx num = "

" ++ show num ++"/" ++ show (mx-1) ++ "

" - -mkIndex file = unlines . mkInd 1 where - mkInd n ss = case ss of - s : rest | (s==separator) -> mkInd (n+1) rest - s : rest -> case getHeading s of - Just (i,t) -> mkLine n i t : mkInd n rest - _ -> mkInd n rest - _ -> [] - getHeading s = case dropWhile isSpace s of - '<':h:i:_:t | isDigit i -> return (i,take (length t - 5) t) -- drop final - _ -> Nothing - mkLine _ '1' t = t ++ " : Table of Contents

" -- heading of whole document - mkLine n i t = stars i ++ link n t ++ "
" - stars i = case i of - '3' -> "

  • " - '4' -> "
  • * " - _ -> "" - link n t = "" ++ t ++ "" diff --git a/src/tools/gf-tools.cabal b/src/tools/gf-tools.cabal index 1f89f3a85..f8a9a1cde 100644 --- a/src/tools/gf-tools.cabal +++ b/src/tools/gf-tools.cabal @@ -6,7 +6,3 @@ cabal-version: >= 1.8 Executable gfdoc main-is: GFDoc.hs build-depends: base, directory>=1.2, time>=1.5, process - -Executable htmls - main-is: Htmls.hs - build-depends: base \ No newline at end of file