import Data.Maybe
import Data.Time
import Network.HTTP.Lucu
-import Network.HTTP.Lucu.Utils
import Network.URI hiding (path)
import Rakka.Environment
import Rakka.Page
import Rakka.Utils
import Rakka.W3CDateTime
import Rakka.Wiki.Engine
-import System.FilePath
+import System.FilePath.Posix
import Text.HyperEstraier hiding (getText)
import Text.XML.HXT.Arrow
-import Text.XML.HXT.DOM.TypeDefs
-import Text.XML.HXT.DOM.XmlKeywords
+import Text.XML.HXT.XPath
fallbackPageEntity :: Environment -> [String] -> IO (Maybe ResourceDef)
fallbackPageEntity env path
- | null path = return Nothing
- | null $ head path = return Nothing
- | isLower $ head $ head path = return Nothing -- 先頭の文字が小文字であってはならない
+ | null name = return Nothing
+ | isLower $ head name = return Nothing -- 先頭の文字が小文字であってはならない
| otherwise
= return $ Just $ ResourceDef {
resUsesNativeThread = False
, resIsGreedy = True
- , resGet = Just $ handleGet env (toPageName path)
+ , resGet = Just $ handleGet env name
, resHead = Nothing
, resPost = Nothing
- , resPut = Just $ handlePut env (toPageName path)
- , resDelete = Just $ handleDelete env (toPageName path)
+ , resPut = Just $ handlePut env name
+ , resDelete = Just $ handleDelete env name
}
where
- toPageName :: [String] -> PageName
- toPageName = decodePageName . dropExtension . joinWith "/"
+ name :: PageName
+ name = (dropExtension . UTF8.decodeString . joinPath) path
handleGet :: Environment -> PageName -> Resource ()
>>>
xmlizePage
>>>
- writeDocumentToString [ (a_indent, v_1) ]
+ writeDocumentToString [ (a_indent , v_1 )
+ , (a_output_encoding, utf8)
+ , (a_no_xml_pi , v_0 ) ]
)
output resultStr