Other-Modules:
Rakka.Environment
Rakka.Page
- Rakka.Plugin
Rakka.Resource
Rakka.Resource.Index
Rakka.Resource.Object
Rakka.Wiki.Interpreter
Rakka.Wiki.Interpreter.Base
Rakka.Wiki.Interpreter.Image
+ Rakka.Wiki.Interpreter.Trackback
Rakka.Wiki.Interpreter.Outline
Rakka.Wiki.Engine
Rakka.Wiki.Formatter
import Rakka.Storage
import Rakka.SystemConfig
import Rakka.Wiki.Interpreter
-import qualified Rakka.Wiki.Interpreter.Base as Base
-import qualified Rakka.Wiki.Interpreter.Image as Image
-import qualified Rakka.Wiki.Interpreter.Outline as Outline
+import qualified Rakka.Wiki.Interpreter.Base as Base
+import qualified Rakka.Wiki.Interpreter.Image as Image
+import qualified Rakka.Wiki.Interpreter.Trackback as Trackback
+import qualified Rakka.Wiki.Interpreter.Outline as Outline
import Subversion.Repository
import System.Directory
import System.FilePath
mkInterpTable = listToTable $
foldl (++) [] [ Base.interpreters
, Image.interpreters
+ , Trackback.interpreters
, Outline.interpreters
]
where
, mkPageURI
, mkPageFragmentURI
, mkObjectURI
+ , mkAuxiliaryURI
)
where
mkObjectURI :: URI -> PageName -> URI
mkObjectURI baseURI name
+ = mkAuxiliaryURI baseURI ["object"] name
+
+
+mkAuxiliaryURI :: URI -> [String] -> PageName -> URI
+mkAuxiliaryURI baseURI basePath name
= baseURI {
- uriPath = foldl combine "/" [uriPath baseURI, "object", encodePageName name]
+ uriPath = foldl combine "/" ([uriPath baseURI] ++ basePath ++ [encodePageName name])
}
+++ /dev/null
-module Rakka.Plugin
- ( Plugin(..)
- , RequestHandler
- , RequestContext(..)
- )
- where
-
-import Data.Typeable
-import Network.HTTP.Lucu
-import Rakka.Wiki.Interpreter
-import Rakka.Storage
-import Rakka.SystemConfig
-
-
-data Plugin
- = Plugin {
- pinInterpreters :: ![Interpreter]
- , pinRequestHandlers :: ![RequestHandler]
- }
- deriving (Typeable)
-
-
-type RequestHandler
- = RequestContext -> [String] -> IO (Maybe ResourceDef)
-
-
-data RequestContext
- = RequestContext {
- rcStorage :: !Storage
- , rcSysConf :: !SystemConfig
- }
--- /dev/null
+module Rakka.Wiki.Interpreter.Trackback
+ ( interpreters
+ )
+ where
+
+import Rakka.Page
+import Rakka.SystemConfig
+import Rakka.Wiki
+import Rakka.Wiki.Interpreter
+
+
+interpreters :: [Interpreter]
+interpreters = [ trackbackURLInterp
+ , trackbacksInterp
+ ]
+
+
+trackbackURLInterp :: Interpreter
+trackbackURLInterp
+ = InlineCommandInterpreter {
+ iciName = "trackbackURL"
+ , iciInterpret
+ = \ ctx _ -> do BaseURI baseURI <- getSysConf (ctxSysConf ctx) (BaseURI undefined)
+ let uri = mkAuxiliaryURI baseURI ["trackback"] (ctxPageName ctx)
+ return $ ExternalLink uri (Just "Trackback URL")
+ }
+
+
+trackbacksInterp :: Interpreter
+trackbacksInterp
+ = BlockCommandInterpreter {
+ bciName = "trackbacks"
+ , bciInterpret
+ = \ _ _ -> return $ Div [("class", "trackbacks")] []
+ }
undefinedCmdErr name
= Div [("class", "error")]
[ Paragraph [Text ("The command `" ++ name ++ "' is not defined. " ++
- "Ensure that you haven't mistyped and the module " ++
- "providing the command is actually loaded.")
+ "Make sure you haven't mistyped.")
]
]
<outline />
= Menu =
+* [[MainPage|Main]]
+* [[Help/Syntax|Syntax Help]]
= Trackbacks =
+<trackbackURL />
+<trackbacks />
]]></textData>
</page>
padding: 20px;
}
+.sideBar p {
+ margin-left: 5px;
+}
+
+.sideBar .outline li {
+ margin-left: 1em;
+ padding: 0;
+}
+
.sideBar li {
padding: 3px;
}
}
.sideBar li + li {
- margin-top: 0.2em;
+ margin-top: 0.1em;
}
-.sideBar ul + h1 {
+.sideBar * + h1 {
margin-top: 1.2em;
}
body {
background-color: white;
color: black;
+}
+.body {
line-height: 1.3;
}
+p {
+ margin: 0 0 0.8em 0;
+}
+
h1, h2, h3, h4, h5, h6 {
font-weight: normal;
}
.sideBar .outline li {
list-style-type: disc;
- margin-left: 1em;
-
- padding: 0;
- line-height: 1.0;
+ background-color: inherit;
}
.sideBar .outline li li {
list-style-type: circle;
list-style-type: circle;
}
-p {
- margin: 0 0 0.8em 0;
+.sideBar li {
+ padding: 2px 5px;
+ background-color: #f5f5f5;
}
/* float **********************************************************************/