8 import Data.ByteString.Base (LazyByteString)
9 import qualified Data.ByteString.Char8 as C8
11 import Data.Encoding.UTF8
12 import Network.HTTP.Lucu
14 import Subversion.Types
17 type PageName = String
24 , pageType :: MIMEType
25 , pageIsTheme :: Bool -- text/css 以外では無意味
26 , pageIsFeed :: Bool -- text/x-rakka 以外では無意味
27 , pageIsLocked :: Bool
28 , pageIsBoring :: Bool
29 , pageRevision :: Maybe RevNum
30 , pageSummary :: Maybe String
31 , pageOtherLang :: [(String, PageName)]
32 , pageContent :: LazyByteString
36 -- UTF-8 に encode してから 0x20 - 0x7E の範圍を除いて URI escape する。
37 encodePageName :: PageName -> FilePath
38 encodePageName = escapeURIString shouldEscape . C8.unpack . encode UTF8
40 shouldEscape :: Char -> Bool
42 | c >= ' ' && c <= '~' = False