packages feed

takahashi 0.2.0.2 → 0.2.1.0

raw patch · 10 files changed

+481/−472 lines, 10 filesdep +lensdep +monad-skeletondep −reasonable-lensdep −reasonable-operationaldep ~mtlPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

Dependencies added: lens, monad-skeleton

Dependencies removed: reasonable-lens, reasonable-operational

Dependency ranges changed: mtl

API changes (from Hackage documentation)

- Control.Monad.Takahashi: BorderDouble :: BorderStyle
- Control.Monad.Takahashi: BorderNone :: BorderStyle
- Control.Monad.Takahashi: BorderSolid :: BorderStyle
- Control.Monad.Takahashi: Color :: Integer -> Integer -> Integer -> Color
- Control.Monad.Takahashi: HStretch :: DrawType
- Control.Monad.Takahashi: SimpleDraw :: DrawType
- Control.Monad.Takahashi: Stretch :: DrawType
- Control.Monad.Takahashi: WStretch :: DrawType
- Control.Monad.Takahashi: annotation :: Contents -> String -> Taka ()
- Control.Monad.Takahashi: annotationCont :: Contents -> String -> Contents
- Control.Monad.Takahashi: annotationOption :: Lens SlideOption SlideOption BlockOption BlockOption
- Control.Monad.Takahashi: bgColor :: Lens BlockOption BlockOption (Maybe Color) (Maybe Color)
- Control.Monad.Takahashi: bindPage :: Contents -> Taka ()
- Control.Monad.Takahashi: blockFontSize :: Lens BlockOption BlockOption (Maybe Int) (Maybe Int)
- Control.Monad.Takahashi: buildTakahashi :: Taka a -> TakahashiRWS a
- Control.Monad.Takahashi: central :: MakeStyle () -> HBuilder () -> HBuilder ()
- Control.Monad.Takahashi: code :: String -> String -> Taka ()
- Control.Monad.Takahashi: code2 :: String -> String -> Taka ()
- Control.Monad.Takahashi: codeCont :: String -> Contents
- Control.Monad.Takahashi: codeOption :: Lens SlideOption SlideOption BlockOption BlockOption
- Control.Monad.Takahashi: contents :: MakeStyle () -> HBuilder () -> HBuilder ()
- Control.Monad.Takahashi: contentsOption :: Lens SlideOption SlideOption BlockOption BlockOption
- Control.Monad.Takahashi: contentsOption2 :: Lens SlideOption SlideOption BlockOption BlockOption
- Control.Monad.Takahashi: data BlockOption
- Control.Monad.Takahashi: data BorderStyle
- Control.Monad.Takahashi: data Color
- Control.Monad.Takahashi: data Contents
- Control.Monad.Takahashi: data DrawType
- Control.Monad.Takahashi: data SlideOption
- Control.Monad.Takahashi: defaultSlideOption :: SlideOption
- Control.Monad.Takahashi: fontColor :: Lens BlockOption BlockOption (Maybe Color) (Maybe Color)
- Control.Monad.Takahashi: frameColor :: Lens BlockOption BlockOption (Maybe Color) (Maybe Color)
- Control.Monad.Takahashi: frameStyle :: Lens BlockOption BlockOption (Maybe BorderStyle) (Maybe BorderStyle)
- Control.Monad.Takahashi: horizon :: [Contents] -> Taka ()
- Control.Monad.Takahashi: horizonCont :: [Contents] -> Contents
- Control.Monad.Takahashi: img :: DrawType -> String -> Taka ()
- Control.Monad.Takahashi: imgCont :: DrawType -> String -> Contents
- Control.Monad.Takahashi: list :: [String] -> Taka ()
- Control.Monad.Takahashi: list2 :: [String] -> Taka ()
- Control.Monad.Takahashi: listCont :: [String] -> Contents
- Control.Monad.Takahashi: listCont2 :: [String] -> Contents
- Control.Monad.Takahashi: makePage :: Contents -> Taka ()
- Control.Monad.Takahashi: makeSlide :: Taka a -> IO String
- Control.Monad.Takahashi: par :: String -> Taka ()
- Control.Monad.Takahashi: par2 :: String -> Taka ()
- Control.Monad.Takahashi: parCont :: String -> Contents
- Control.Monad.Takahashi: parCont2 :: String -> Contents
- Control.Monad.Takahashi: runTakahashi :: Taka a -> Html
- Control.Monad.Takahashi: showTakahashi :: Taka a -> String
- Control.Monad.Takahashi: slideFontSize :: Lens SlideOption SlideOption (Maybe Int) (Maybe Int)
- Control.Monad.Takahashi: slideTitle :: Lens SlideOption SlideOption String String
- Control.Monad.Takahashi: stateSandbox :: MonadState s m => m a -> m a
- Control.Monad.Takahashi: taka :: String -> Taka ()
- Control.Monad.Takahashi: taka2 :: String -> Taka ()
- Control.Monad.Takahashi: takaCont :: String -> Contents
- Control.Monad.Takahashi: takaCont2 :: String -> Contents
- Control.Monad.Takahashi: title :: String -> String -> Taka ()
- Control.Monad.Takahashi: titleCont :: String -> String -> Contents
- Control.Monad.Takahashi: titleOption :: Lens SlideOption SlideOption BlockOption BlockOption
- Control.Monad.Takahashi: twinBottom :: Contents -> Contents -> Taka ()
- Control.Monad.Takahashi: twinBottomCont :: Contents -> Contents -> Contents
- Control.Monad.Takahashi: twinLeft :: Contents -> Contents -> Taka ()
- Control.Monad.Takahashi: twinLeftCont :: Contents -> Contents -> Contents
- Control.Monad.Takahashi: twinRight :: Contents -> Contents -> Taka ()
- Control.Monad.Takahashi: twinRightCont :: Contents -> Contents -> Contents
- Control.Monad.Takahashi: twinTop :: Contents -> Contents -> Taka ()
- Control.Monad.Takahashi: twinTopCont :: Contents -> Contents -> Contents
- Control.Monad.Takahashi: type Taka a = Takahashi SlideOption a
- Control.Monad.Takahashi: vertical :: [Contents] -> Taka ()
- Control.Monad.Takahashi: verticalCont :: [Contents] -> Contents
- Control.Monad.Takahashi: writeSlide :: String -> Taka a -> IO ()
- Control.Monad.Takahashi.HtmlBuilder.Style: SensSelif :: FontFamily
- Control.Monad.Takahashi.Monad: instance MonadState x (Takahashi x)
- Control.Monad.Takahashi.Monad: type Takahashi o = Program (TakahashiBase o)
- Control.Monad.Takahashi.Slide: Contents :: (SlideOption -> HBuilder ()) -> Contents
- Control.Monad.Takahashi.Slide: bindPage :: Contents -> Taka ()
- Control.Monad.Takahashi.Slide: central :: MakeStyle () -> HBuilder () -> HBuilder ()
- Control.Monad.Takahashi.Slide: contents :: MakeStyle () -> HBuilder () -> HBuilder ()
- Control.Monad.Takahashi.Slide: extructHBuilder :: Contents -> SlideOption -> HBuilder ()
- Control.Monad.Takahashi.Slide: instance Eq BlockOption
- Control.Monad.Takahashi.Slide: instance Eq SlideOption
- Control.Monad.Takahashi.Slide: instance Ord BlockOption
- Control.Monad.Takahashi.Slide: instance Ord SlideOption
- Control.Monad.Takahashi.Slide: instance Read BlockOption
- Control.Monad.Takahashi.Slide: instance Read SlideOption
- Control.Monad.Takahashi.Slide: instance Show BlockOption
- Control.Monad.Takahashi.Slide: instance Show SlideOption
- Control.Monad.Takahashi.Slide: makeAnnotationStyle :: SlideOption -> MakeStyle ()
- Control.Monad.Takahashi.Slide: makeCodeStyle :: SlideOption -> MakeStyle ()
- Control.Monad.Takahashi.Slide: makeContentsStyle :: SlideOption -> MakeStyle ()
- Control.Monad.Takahashi.Slide: makeContentsStyle2 :: SlideOption -> MakeStyle ()
- Control.Monad.Takahashi.Slide: makeTitleStyle :: SlideOption -> MakeStyle ()
- Control.Monad.Takahashi.Slide: newtype Contents
+ Control.Monad.Takahashi.API: Contents :: (SlideOption -> HBuilder ()) -> Contents
+ Control.Monad.Takahashi.API: annotation :: Contents -> String -> Taka ()
+ Control.Monad.Takahashi.API: annotationCont :: Contents -> String -> Contents
+ Control.Monad.Takahashi.API: bindPage :: Contents -> Taka ()
+ Control.Monad.Takahashi.API: code :: String -> String -> Taka ()
+ Control.Monad.Takahashi.API: code2 :: String -> String -> Taka ()
+ Control.Monad.Takahashi.API: codeCont :: String -> Contents
+ Control.Monad.Takahashi.API: extructHBuilder :: Contents -> SlideOption -> HBuilder ()
+ Control.Monad.Takahashi.API: horizon :: [Contents] -> Taka ()
+ Control.Monad.Takahashi.API: horizonCont :: [Contents] -> Contents
+ Control.Monad.Takahashi.API: img :: DrawType -> String -> Taka ()
+ Control.Monad.Takahashi.API: imgCont :: DrawType -> String -> Contents
+ Control.Monad.Takahashi.API: list :: [String] -> Taka ()
+ Control.Monad.Takahashi.API: list2 :: [String] -> Taka ()
+ Control.Monad.Takahashi.API: listCont :: [String] -> Contents
+ Control.Monad.Takahashi.API: listCont2 :: [String] -> Contents
+ Control.Monad.Takahashi.API: newtype Contents
+ Control.Monad.Takahashi.API: par :: String -> Taka ()
+ Control.Monad.Takahashi.API: par2 :: String -> Taka ()
+ Control.Monad.Takahashi.API: parCont :: String -> Contents
+ Control.Monad.Takahashi.API: parCont2 :: String -> Contents
+ Control.Monad.Takahashi.API: taka :: String -> Taka ()
+ Control.Monad.Takahashi.API: taka2 :: String -> Taka ()
+ Control.Monad.Takahashi.API: takaCont :: String -> Contents
+ Control.Monad.Takahashi.API: takaCont2 :: String -> Contents
+ Control.Monad.Takahashi.API: title :: String -> String -> Taka ()
+ Control.Monad.Takahashi.API: titleCont :: String -> String -> Contents
+ Control.Monad.Takahashi.API: twinBottom :: Contents -> Contents -> Taka ()
+ Control.Monad.Takahashi.API: twinBottomCont :: Contents -> Contents -> Contents
+ Control.Monad.Takahashi.API: twinLeft :: Contents -> Contents -> Taka ()
+ Control.Monad.Takahashi.API: twinLeftCont :: Contents -> Contents -> Contents
+ Control.Monad.Takahashi.API: twinRight :: Contents -> Contents -> Taka ()
+ Control.Monad.Takahashi.API: twinRightCont :: Contents -> Contents -> Contents
+ Control.Monad.Takahashi.API: twinTop :: Contents -> Contents -> Taka ()
+ Control.Monad.Takahashi.API: twinTopCont :: Contents -> Contents -> Contents
+ Control.Monad.Takahashi.API: vertical :: [Contents] -> Taka ()
+ Control.Monad.Takahashi.API: verticalCont :: [Contents] -> Contents
+ Control.Monad.Takahashi.HtmlBuilder.Style: SansSelif :: FontFamily
+ Control.Monad.Takahashi.Monad: BlockOption :: Maybe Color -> Maybe Color -> Maybe Color -> Maybe BorderStyle -> Maybe Int -> BlockOption
+ Control.Monad.Takahashi.Monad: SlideOption :: String -> Maybe Int -> BlockOption -> BlockOption -> BlockOption -> BlockOption -> BlockOption -> SlideOption
+ Control.Monad.Takahashi.Monad: _annotationOption :: SlideOption -> BlockOption
+ Control.Monad.Takahashi.Monad: _bgColor :: BlockOption -> Maybe Color
+ Control.Monad.Takahashi.Monad: _blockFontSize :: BlockOption -> Maybe Int
+ Control.Monad.Takahashi.Monad: _codeOption :: SlideOption -> BlockOption
+ Control.Monad.Takahashi.Monad: _contentsOption :: SlideOption -> BlockOption
+ Control.Monad.Takahashi.Monad: _contentsOption2 :: SlideOption -> BlockOption
+ Control.Monad.Takahashi.Monad: _fontColor :: BlockOption -> Maybe Color
+ Control.Monad.Takahashi.Monad: _frameColor :: BlockOption -> Maybe Color
+ Control.Monad.Takahashi.Monad: _frameStyle :: BlockOption -> Maybe BorderStyle
+ Control.Monad.Takahashi.Monad: _slideFontSize :: SlideOption -> Maybe Int
+ Control.Monad.Takahashi.Monad: _slideTitle :: SlideOption -> String
+ Control.Monad.Takahashi.Monad: _titleOption :: SlideOption -> BlockOption
+ Control.Monad.Takahashi.Monad: annotationOption :: Lens' SlideOption BlockOption
+ Control.Monad.Takahashi.Monad: bgColor :: Lens' BlockOption (Maybe Color)
+ Control.Monad.Takahashi.Monad: blockFontSize :: Lens' BlockOption (Maybe Int)
+ Control.Monad.Takahashi.Monad: codeOption :: Lens' SlideOption BlockOption
+ Control.Monad.Takahashi.Monad: contentsOption :: Lens' SlideOption BlockOption
+ Control.Monad.Takahashi.Monad: contentsOption2 :: Lens' SlideOption BlockOption
+ Control.Monad.Takahashi.Monad: data BlockOption
+ Control.Monad.Takahashi.Monad: data SlideOption
+ Control.Monad.Takahashi.Monad: defaultSlideOption :: SlideOption
+ Control.Monad.Takahashi.Monad: fontColor :: Lens' BlockOption (Maybe Color)
+ Control.Monad.Takahashi.Monad: frameColor :: Lens' BlockOption (Maybe Color)
+ Control.Monad.Takahashi.Monad: frameStyle :: Lens' BlockOption (Maybe BorderStyle)
+ Control.Monad.Takahashi.Monad: instance Eq BlockOption
+ Control.Monad.Takahashi.Monad: instance Eq SlideOption
+ Control.Monad.Takahashi.Monad: instance MonadState SlideOption Taka
+ Control.Monad.Takahashi.Monad: instance Ord BlockOption
+ Control.Monad.Takahashi.Monad: instance Ord SlideOption
+ Control.Monad.Takahashi.Monad: instance Read BlockOption
+ Control.Monad.Takahashi.Monad: instance Read SlideOption
+ Control.Monad.Takahashi.Monad: instance Show BlockOption
+ Control.Monad.Takahashi.Monad: instance Show SlideOption
+ Control.Monad.Takahashi.Monad: slideFontSize :: Lens' SlideOption (Maybe Int)
+ Control.Monad.Takahashi.Monad: slideTitle :: Lens' SlideOption String
+ Control.Monad.Takahashi.Monad: titleOption :: Lens' SlideOption BlockOption
+ Control.Monad.Takahashi.Monad: type Taka = Skeleton TakahashiBase
+ Control.Monad.Takahashi.Util: interpret :: Monad m => (forall a. instr a -> m a) -> Skeleton instr b -> m b
- Control.Monad.Takahashi.HtmlBuilder.Monad: type HtmlBuilder o = Program (HtmlBuilderBase o)
+ Control.Monad.Takahashi.HtmlBuilder.Monad: type HtmlBuilder o = Skeleton (HtmlBuilderBase o)
- Control.Monad.Takahashi.HtmlBuilder.Style: align :: Lens Style Style Align Align
+ Control.Monad.Takahashi.HtmlBuilder.Style: align :: Lens' Style Align
- Control.Monad.Takahashi.HtmlBuilder.Style: backGround :: Lens Style Style (Maybe Color) (Maybe Color)
+ Control.Monad.Takahashi.HtmlBuilder.Style: backGround :: Lens' Style (Maybe Color)
- Control.Monad.Takahashi.HtmlBuilder.Style: border :: Lens Style Style Border Border
+ Control.Monad.Takahashi.HtmlBuilder.Style: border :: Lens' Style Border
- Control.Monad.Takahashi.HtmlBuilder.Style: borderColor :: Lens Border Border (Maybe Color) (Maybe Color)
+ Control.Monad.Takahashi.HtmlBuilder.Style: borderColor :: Lens' Border (Maybe Color)
- Control.Monad.Takahashi.HtmlBuilder.Style: borderStyle :: Lens Border Border (Maybe BorderStyle) (Maybe BorderStyle)
+ Control.Monad.Takahashi.HtmlBuilder.Style: borderStyle :: Lens' Border (Maybe BorderStyle)
- Control.Monad.Takahashi.HtmlBuilder.Style: borderWidth :: Lens Border Border (Maybe Int) (Maybe Int)
+ Control.Monad.Takahashi.HtmlBuilder.Style: borderWidth :: Lens' Border (Maybe Int)
- Control.Monad.Takahashi.HtmlBuilder.Style: boxSizing :: Lens Border Border (Maybe BoxSizing) (Maybe BoxSizing)
+ Control.Monad.Takahashi.HtmlBuilder.Style: boxSizing :: Lens' Border (Maybe BoxSizing)
- Control.Monad.Takahashi.HtmlBuilder.Style: display :: Lens Style Style (Maybe Display) (Maybe Display)
+ Control.Monad.Takahashi.HtmlBuilder.Style: display :: Lens' Style (Maybe Display)
- Control.Monad.Takahashi.HtmlBuilder.Style: float :: Lens Style Style (Maybe FloatOption) (Maybe FloatOption)
+ Control.Monad.Takahashi.HtmlBuilder.Style: float :: Lens' Style (Maybe FloatOption)
- Control.Monad.Takahashi.HtmlBuilder.Style: font :: Lens Style Style Font Font
+ Control.Monad.Takahashi.HtmlBuilder.Style: font :: Lens' Style Font
- Control.Monad.Takahashi.HtmlBuilder.Style: fontFamily :: Lens Font Font (Maybe [FontFamily]) (Maybe [FontFamily])
+ Control.Monad.Takahashi.HtmlBuilder.Style: fontFamily :: Lens' Font (Maybe [FontFamily])
- Control.Monad.Takahashi.HtmlBuilder.Style: fontSize :: Lens Font Font (Maybe Int) (Maybe Int)
+ Control.Monad.Takahashi.HtmlBuilder.Style: fontSize :: Lens' Font (Maybe Int)
- Control.Monad.Takahashi.HtmlBuilder.Style: foreColor :: Lens Font Font (Maybe Color) (Maybe Color)
+ Control.Monad.Takahashi.HtmlBuilder.Style: foreColor :: Lens' Font (Maybe Color)
- Control.Monad.Takahashi.HtmlBuilder.Style: height :: Lens Size Size (Maybe Len) (Maybe Len)
+ Control.Monad.Takahashi.HtmlBuilder.Style: height :: Lens' Size (Maybe Len)
- Control.Monad.Takahashi.HtmlBuilder.Style: margin :: Lens Style Style Margin Margin
+ Control.Monad.Takahashi.HtmlBuilder.Style: margin :: Lens' Style Margin
- Control.Monad.Takahashi.HtmlBuilder.Style: marginBottom :: Lens Margin Margin (Maybe Len) (Maybe Len)
+ Control.Monad.Takahashi.HtmlBuilder.Style: marginBottom :: Lens' Margin (Maybe Len)
- Control.Monad.Takahashi.HtmlBuilder.Style: marginLeft :: Lens Margin Margin (Maybe Len) (Maybe Len)
+ Control.Monad.Takahashi.HtmlBuilder.Style: marginLeft :: Lens' Margin (Maybe Len)
- Control.Monad.Takahashi.HtmlBuilder.Style: marginRight :: Lens Margin Margin (Maybe Len) (Maybe Len)
+ Control.Monad.Takahashi.HtmlBuilder.Style: marginRight :: Lens' Margin (Maybe Len)
- Control.Monad.Takahashi.HtmlBuilder.Style: marginTop :: Lens Margin Margin (Maybe Len) (Maybe Len)
+ Control.Monad.Takahashi.HtmlBuilder.Style: marginTop :: Lens' Margin (Maybe Len)
- Control.Monad.Takahashi.HtmlBuilder.Style: paddingBottom :: Lens Margin Margin (Maybe Len) (Maybe Len)
+ Control.Monad.Takahashi.HtmlBuilder.Style: paddingBottom :: Lens' Margin (Maybe Len)
- Control.Monad.Takahashi.HtmlBuilder.Style: paddingLeft :: Lens Margin Margin (Maybe Len) (Maybe Len)
+ Control.Monad.Takahashi.HtmlBuilder.Style: paddingLeft :: Lens' Margin (Maybe Len)
- Control.Monad.Takahashi.HtmlBuilder.Style: paddingRight :: Lens Margin Margin (Maybe Len) (Maybe Len)
+ Control.Monad.Takahashi.HtmlBuilder.Style: paddingRight :: Lens' Margin (Maybe Len)
- Control.Monad.Takahashi.HtmlBuilder.Style: paddingTop :: Lens Margin Margin (Maybe Len) (Maybe Len)
+ Control.Monad.Takahashi.HtmlBuilder.Style: paddingTop :: Lens' Margin (Maybe Len)
- Control.Monad.Takahashi.HtmlBuilder.Style: size :: Lens Style Style Size Size
+ Control.Monad.Takahashi.HtmlBuilder.Style: size :: Lens' Style Size
- Control.Monad.Takahashi.HtmlBuilder.Style: textAlign :: Lens Align Align (Maybe TextAlign) (Maybe TextAlign)
+ Control.Monad.Takahashi.HtmlBuilder.Style: textAlign :: Lens' Align (Maybe TextAlign)
- Control.Monad.Takahashi.HtmlBuilder.Style: verticalAlign :: Lens Align Align (Maybe VerticalAlign) (Maybe VerticalAlign)
+ Control.Monad.Takahashi.HtmlBuilder.Style: verticalAlign :: Lens' Align (Maybe VerticalAlign)
- Control.Monad.Takahashi.HtmlBuilder.Style: whiteSpace :: Lens Font Font (Maybe WhiteSpace) (Maybe WhiteSpace)
+ Control.Monad.Takahashi.HtmlBuilder.Style: whiteSpace :: Lens' Font (Maybe WhiteSpace)
- Control.Monad.Takahashi.HtmlBuilder.Style: width :: Lens Size Size (Maybe Len) (Maybe Len)
+ Control.Monad.Takahashi.HtmlBuilder.Style: width :: Lens' Size (Maybe Len)
- Control.Monad.Takahashi.Monad: GetSlideOption :: TakahashiBase o o
+ Control.Monad.Takahashi.Monad: GetSlideOption :: TakahashiBase SlideOption
- Control.Monad.Takahashi.Monad: PutSlideOption :: o -> TakahashiBase o ()
+ Control.Monad.Takahashi.Monad: PutSlideOption :: SlideOption -> TakahashiBase ()
- Control.Monad.Takahashi.Monad: Slide :: HtmlBuilder Style () -> TakahashiBase o ()
+ Control.Monad.Takahashi.Monad: Slide :: HtmlBuilder Style () -> TakahashiBase ()
- Control.Monad.Takahashi.Monad: data TakahashiBase o a
+ Control.Monad.Takahashi.Monad: data TakahashiBase a
- Control.Monad.Takahashi.Monad: getSlideOption :: Takahashi o o
+ Control.Monad.Takahashi.Monad: getSlideOption :: Taka SlideOption
- Control.Monad.Takahashi.Monad: putSlideOption :: o -> Takahashi o ()
+ Control.Monad.Takahashi.Monad: putSlideOption :: SlideOption -> Taka ()
- Control.Monad.Takahashi.Monad: slide :: HtmlBuilder Style () -> Takahashi o ()
+ Control.Monad.Takahashi.Monad: slide :: HtmlBuilder Style () -> Taka ()
- Control.Monad.Takahashi.Slide: annotationOption :: Lens SlideOption SlideOption BlockOption BlockOption
+ Control.Monad.Takahashi.Slide: annotationOption :: Lens' SlideOption BlockOption
- Control.Monad.Takahashi.Slide: bgColor :: Lens BlockOption BlockOption (Maybe Color) (Maybe Color)
+ Control.Monad.Takahashi.Slide: bgColor :: Lens' BlockOption (Maybe Color)
- Control.Monad.Takahashi.Slide: blockFontSize :: Lens BlockOption BlockOption (Maybe Int) (Maybe Int)
+ Control.Monad.Takahashi.Slide: blockFontSize :: Lens' BlockOption (Maybe Int)
- Control.Monad.Takahashi.Slide: codeOption :: Lens SlideOption SlideOption BlockOption BlockOption
+ Control.Monad.Takahashi.Slide: codeOption :: Lens' SlideOption BlockOption
- Control.Monad.Takahashi.Slide: contentsOption :: Lens SlideOption SlideOption BlockOption BlockOption
+ Control.Monad.Takahashi.Slide: contentsOption :: Lens' SlideOption BlockOption
- Control.Monad.Takahashi.Slide: contentsOption2 :: Lens SlideOption SlideOption BlockOption BlockOption
+ Control.Monad.Takahashi.Slide: contentsOption2 :: Lens' SlideOption BlockOption
- Control.Monad.Takahashi.Slide: fontColor :: Lens BlockOption BlockOption (Maybe Color) (Maybe Color)
+ Control.Monad.Takahashi.Slide: fontColor :: Lens' BlockOption (Maybe Color)
- Control.Monad.Takahashi.Slide: frameColor :: Lens BlockOption BlockOption (Maybe Color) (Maybe Color)
+ Control.Monad.Takahashi.Slide: frameColor :: Lens' BlockOption (Maybe Color)
- Control.Monad.Takahashi.Slide: frameStyle :: Lens BlockOption BlockOption (Maybe BorderStyle) (Maybe BorderStyle)
+ Control.Monad.Takahashi.Slide: frameStyle :: Lens' BlockOption (Maybe BorderStyle)
- Control.Monad.Takahashi.Slide: slideFontSize :: Lens SlideOption SlideOption (Maybe Int) (Maybe Int)
+ Control.Monad.Takahashi.Slide: slideFontSize :: Lens' SlideOption (Maybe Int)
- Control.Monad.Takahashi.Slide: slideTitle :: Lens SlideOption SlideOption String String
+ Control.Monad.Takahashi.Slide: slideTitle :: Lens' SlideOption String
- Control.Monad.Takahashi.Slide: titleOption :: Lens SlideOption SlideOption BlockOption BlockOption
+ Control.Monad.Takahashi.Slide: titleOption :: Lens' SlideOption BlockOption
- Control.Monad.Takahashi.Slide: type Taka a = Takahashi SlideOption a
+ Control.Monad.Takahashi.Slide: type Taka = Skeleton TakahashiBase

Files

html/Temp.html view
@@ -25,9 +25,21 @@     }      document.onkeydown = function(e){-      if(e.keyCode == 39) changeSlide(SlideIndex + 1);-      if(e.keyCode == 37) changeSlide(SlideIndex - 1);+      if(e.keyCode == 39 || e.keyCode == 34) changeSlide(SlideIndex + 1);+      if(e.keyCode == 37 || e.keyCode == 33) changeSlide(SlideIndex - 1);     }++    // -----++    function judgeMoveSlide(x){+      if(x > (window.innerWidth / 3 * 2)) changeSlide(SlideIndex + 1);+      if(x < (window.innerWidth / 3)) changeSlide(SlideIndex - 1);+    }++    document.ontouchend = function(e){+      judgeMoveSlide(e.changedTouches[0].pageX);+    }+   </script>   <style>     html, body {
src/Control/Monad/Takahashi.hs view
@@ -1,291 +1,18 @@ {-# LANGUAGE GADTs, ScopedTypeVariables #-} {-# LANGUAGE TemplateHaskell #-} module Control.Monad.Takahashi -  ( module Control.Monad.Takahashi.Monad-  , takaCont-  , parCont-  , listCont-  , takaCont2-  , parCont2-  , listCont2-  , horizonCont-  , verticalCont-  , annotationCont-  , imgCont-  , codeCont-  , titleCont-  , twinTopCont-  , twinBottomCont-  , twinLeftCont-  , twinRightCont-  -----  , title-  , taka-  , par-  , list-  , taka2-  , par2-  , list2-  , horizon-  , vertical-  , annotation-  , img-  , code-  , code2-  , twinTop-  , twinBottom-  , twinLeft-  , twinRight-  -----  , makePage-  -------  -- from Control.Monad.Takahashi.Slide-  , BlockOption-  , fontColor, bgColor, frameColor, frameStyle-  , SlideOption-  , slideTitle, slideFontSize, titleOption, codeOption-  , contentsOption, contentsOption2, annotationOption, blockFontSize-  , defaultSlideOption-  -----  , Taka(..) -  , buildTakahashi-  , writeSlide-  -----  , runTakahashi-  , showTakahashi-  , makeSlide -  -----  , contents-  , central-  -----  , Contents-  , bindPage-  -------  -- from Control.Monad.Takahashi.HtmlBuilder-  , Color(..)-  , DrawType(..)-  , BorderStyle(..)-  -------  -- from Control.Monad.Takahashi.Util-  , stateSandbox+  ( module Control.Monad.Takahashi.API+  , module Control.Monad.Takahashi.Slide+  , module Control.Monad.Takahashi.Monad+  , module Control.Monad.Takahashi.HtmlBuilder+  , module Control.Monad.Takahashi.Util   ) where import Control.Lens import Control.Monad.State +import Control.Monad.Takahashi.API import Control.Monad.Takahashi.Slide import Control.Monad.Takahashi.Monad import Control.Monad.Takahashi.HtmlBuilder import Control.Monad.Takahashi.Util -------- Contents--takaCont :: String -> Contents-takaCont = takaContBase makeContentsStyle--listCont :: [String] -> Contents-listCont = listContBase basicContents--parCont :: String -> Contents-parCont = parContBase basicContents--takaCont2 :: String -> Contents-takaCont2 = takaContBase makeContentsStyle2--listCont2 :: [String] -> Contents-listCont2 = listContBase basicContents2--parCont2 :: String -> Contents-parCont2 = parContBase basicContents2--imgCont :: DrawType -> String -> Contents-imgCont dt fp = Contents $-  \option -> central (return ()) $ drawPicture dt fp--codeCont :: String -> Contents-codeCont s = Contents $-  \option -> contents (codeContents option) $ writeParagraph s--------horizonCont :: [Contents] -> Contents-horizonCont cs = Contents $ -  \option -> horizonDiv . map (contents2DivInfo option) $ cs--verticalCont :: [Contents] -> Contents-verticalCont cs = Contents $-  \option -> verticalDiv . map (contents2DivInfo option) $ cs-    -annotationCont :: Contents -> String -> Contents-annotationCont p s = Contents $ \option -> do-    verticalDiv-      [ divInfo-          { divRatio = 11-          , divData = do-              display .= Just Table-              extructHBuilder p option-          }-      , divInfo-          { divData = do-              writeParagraph s-          , divMakeStyle = do-              display .= Just Table-              makeAnnotationStyle option-          }-      ]--twinTopCont :: Contents -> Contents -> Contents-twinTopCont c1 c2 = makeTwinCont verticalDiv 2 1 c1 c2--twinBottomCont :: Contents -> Contents -> Contents-twinBottomCont c1 c2 = makeTwinCont verticalDiv 1 2 c1 c2--twinLeftCont :: Contents -> Contents -> Contents-twinLeftCont c1 c2 = makeTwinCont horizonDiv 2 1 c1 c2--twinRightCont :: Contents -> Contents -> Contents-twinRightCont c1 c2 = makeTwinCont horizonDiv 2 1 c1 c2--titleCont :: String -> String -> Contents-titleCont t s = Contents $ -  \option -> central (makeTitleStyle option) $ do-    writeHeader1 t-    writeParagraph s-------subTitlePage :: String -> Contents -> Contents-subTitlePage s p = Contents $ \option -> do-  verticalDiv-    [ divInfo-      { divRatio = 10 -      , divData = do-          central (return ()) $ writeHeader2 s-      , divMakeStyle = do-          display .= Just Table-          makeTitleStyle option-      }-    , divInfo-      { divRatio = 45 -      , divData = extructHBuilder p option-      , divMakeStyle = display .= Just Table-      }-    ]--takaContBase :: (SlideOption -> MakeStyle ()) -> String -> Contents-takaContBase m s = Contents $ -  \option -> central (m option) $ writeHeader1 s--listContBase :: (SlideOption -> MakeStyle ()) -> [String] -> Contents-listContBase m xs = Contents $ -  \option -> contents (m option) $ writeList xs--parContBase :: (SlideOption -> MakeStyle ()) -> String -> Contents-parContBase m s = Contents $ -  \option -> contents (m option) $ writeParagraph s--------- slides--title :: String -> String -> Taka ()-title t s = get >>= slide . extructHBuilder (titleCont t s)--taka :: String -> Taka ()-taka s = makePage $ takaCont s--list :: [String] -> Taka ()-list xs = makePage $ listCont xs--par :: String -> Taka ()-par s = makePage $ parCont s--taka2 :: String -> Taka ()-taka2 s = makePage $ takaCont2 s--list2 :: [String] -> Taka ()-list2 xs = makePage $ listCont2 xs--par2 :: String -> Taka ()-par2 s = makePage $ parCont2 s--horizon :: [Contents] -> Taka ()-horizon ps = makePage $ horizonCont ps--vertical :: [Contents] -> Taka ()-vertical ps = makePage $ verticalCont ps--annotation :: Contents -> String -> Taka ()-annotation p s = makePage $ annotationCont p s--img :: DrawType -> String -> Taka ()-img dt s = makePage $ imgCont dt s--code :: String -> String -> Taka ()-code s c = twinBottom (parCont s) (codeCont c)--code2 :: String -> String -> Taka ()-code2 s c = twinBottom (parCont2 s) (codeCont c)--twinTop :: Contents -> Contents -> Taka ()-twinTop c1 c2 = makePage $ twinTopCont c1 c2--twinBottom :: Contents -> Contents -> Taka ()-twinBottom c1 c2 = makePage $ twinBottomCont c1 c2--twinLeft :: Contents -> Contents -> Taka ()-twinLeft c1 c2 = makePage $ twinLeftCont c1 c2--twinRight :: Contents -> Contents -> Taka ()-twinRight c1 c2 = makePage $ twinRightCont c1 c2--------- helper--makePage :: Contents -> Taka ()-makePage p = do-  s <- use slideTitle-  case s of-    "" -> bindPage p-    _  -> bindPage (subTitlePage s p)--------contents2DivInfo :: SlideOption -> Contents -> DivInfo Style-contents2DivInfo o f = divInfo { divData = extructHBuilder f o }--basicContents :: SlideOption -> MakeStyle ()-basicContents o = do-  makeContentsStyle o-  setPadding--basicContents2 :: SlideOption -> MakeStyle ()-basicContents2 o = do-  makeContentsStyle2 o-  setPadding--codeContents :: SlideOption -> MakeStyle ()-codeContents o = do-  makeCodeStyle o-  margin.paddingLeft .= Just (Per 8)--setPadding :: MakeStyle ()-setPadding = do-  margin.paddingTop .= Just (Per 3)-  margin.paddingLeft .= Just (Per 8)--makeTwinCont :: ([DivInfo Style] -> HBuilder ()) -  -> Int -> Int -> Contents -> Contents -> Contents-makeTwinCont builder i1 i2 c1 c2 = Contents $ \option -> do-  builder-    [ divInfo-        { divRatio = i1-        , divData = do-            display .= Just Table-            extructHBuilder c1 option-        }-    , divInfo-        { divRatio = i2-        , divData = do-            display .= Just Table-            extructHBuilder c2 option-        }-    ]
+ src/Control/Monad/Takahashi/API.hs view
@@ -0,0 +1,341 @@+{-# LANGUAGE RankNTypes #-}+module Control.Monad.Takahashi.API +  ( Contents(..)+  , bindPage+  ----+  , takaCont +  , listCont +  , parCont +  , takaCont2 +  , listCont2 +  , parCont2 +  , imgCont +  , codeCont +  , horizonCont +  , verticalCont +  , annotationCont +  , twinTopCont +  , twinBottomCont +  , twinLeftCont +  , twinRightCont +  , titleCont +  ----+  , title +  , taka +  , list +  , par +  , taka2 +  , list2 +  , par2 +  , horizon +  , vertical +  , annotation +  , img +  , code +  , code2 +  , twinTop +  , twinBottom +  , twinLeft +  , twinRight +  ) where+import Control.Monad.State+import Control.Lens++import Control.Monad.Takahashi.Monad+import Control.Monad.Takahashi.HtmlBuilder+import Control.Monad.Takahashi.Util++----++newtype Contents = Contents { extructHBuilder :: SlideOption -> HBuilder () }++bindPage :: Contents -> Taka ()+bindPage p = do+  o <- get+  slide . extructHBuilder p $ o++----+-- Contents++takaCont :: String -> Contents+takaCont = takaContBase makeContentsStyle++listCont :: [String] -> Contents+listCont = listContBase basicContents++parCont :: String -> Contents+parCont = parContBase basicContents++takaCont2 :: String -> Contents+takaCont2 = takaContBase makeContentsStyle2++listCont2 :: [String] -> Contents+listCont2 = listContBase basicContents2++parCont2 :: String -> Contents+parCont2 = parContBase basicContents2++imgCont :: DrawType -> String -> Contents+imgCont dt fp = Contents $+  \option -> central (return ()) $ drawPicture dt fp++codeCont :: String -> Contents+codeCont s = Contents $+  \option -> contents (codeContents option) $ writeParagraph s++----++horizonCont :: [Contents] -> Contents+horizonCont cs = Contents $ +  \option -> horizonDiv . map (contents2DivInfo option) $ cs++verticalCont :: [Contents] -> Contents+verticalCont cs = Contents $+  \option -> verticalDiv . map (contents2DivInfo option) $ cs+    +annotationCont :: Contents -> String -> Contents+annotationCont p s = Contents $ \option -> do+    verticalDiv+      [ divInfo+          { divRatio = 11+          , divData = do+              display .= Just Table+              extructHBuilder p option+          }+      , divInfo+          { divData = do+              writeParagraph s+          , divMakeStyle = do+              display .= Just Table+              makeAnnotationStyle option+          }+      ]++twinTopCont :: Contents -> Contents -> Contents+twinTopCont c1 c2 = makeTwinCont verticalDiv 2 1 c1 c2++twinBottomCont :: Contents -> Contents -> Contents+twinBottomCont c1 c2 = makeTwinCont verticalDiv 1 2 c1 c2++twinLeftCont :: Contents -> Contents -> Contents+twinLeftCont c1 c2 = makeTwinCont horizonDiv 2 1 c1 c2++twinRightCont :: Contents -> Contents -> Contents+twinRightCont c1 c2 = makeTwinCont horizonDiv 2 1 c1 c2++titleCont :: String -> String -> Contents+titleCont t s = Contents $ +  \option -> central (makeTitleStyle option) $ do+    writeHeader1 t+    writeParagraph s++----++subTitlePage :: String -> Contents -> Contents+subTitlePage s p = Contents $ \option -> do+  verticalDiv+    [ divInfo+      { divRatio = 10 +      , divData = do+          central (return ()) $ writeHeader2 s+      , divMakeStyle = do+          display .= Just Table+          makeTitleStyle option+      }+    , divInfo+      { divRatio = 45 +      , divData = extructHBuilder p option+      , divMakeStyle = display .= Just Table+      }+    ]++takaContBase :: (SlideOption -> MakeStyle ()) -> String -> Contents+takaContBase m s = Contents $ +  \option -> central (m option) $ writeHeader1 s++listContBase :: (SlideOption -> MakeStyle ()) -> [String] -> Contents+listContBase m xs = Contents $ +  \option -> contents (m option) $ writeList xs++parContBase :: (SlideOption -> MakeStyle ()) -> String -> Contents+parContBase m s = Contents $ +  \option -> contents (m option) $ writeParagraph s++----+-- slides++title :: String -> String -> Taka ()+title t s = get >>= slide . extructHBuilder (titleCont t s)++taka :: String -> Taka ()+taka s = makePage $ takaCont s++list :: [String] -> Taka ()+list xs = makePage $ listCont xs++par :: String -> Taka ()+par s = makePage $ parCont s++taka2 :: String -> Taka ()+taka2 s = makePage $ takaCont2 s++list2 :: [String] -> Taka ()+list2 xs = makePage $ listCont2 xs++par2 :: String -> Taka ()+par2 s = makePage $ parCont2 s++horizon :: [Contents] -> Taka ()+horizon ps = makePage $ horizonCont ps++vertical :: [Contents] -> Taka ()+vertical ps = makePage $ verticalCont ps++annotation :: Contents -> String -> Taka ()+annotation p s = makePage $ annotationCont p s++img :: DrawType -> String -> Taka ()+img dt s = makePage $ imgCont dt s++code :: String -> String -> Taka ()+code s c = twinBottom (parCont s) (codeCont c)++code2 :: String -> String -> Taka ()+code2 s c = twinBottom (parCont2 s) (codeCont c)++twinTop :: Contents -> Contents -> Taka ()+twinTop c1 c2 = makePage $ twinTopCont c1 c2++twinBottom :: Contents -> Contents -> Taka ()+twinBottom c1 c2 = makePage $ twinBottomCont c1 c2++twinLeft :: Contents -> Contents -> Taka ()+twinLeft c1 c2 = makePage $ twinLeftCont c1 c2++twinRight :: Contents -> Contents -> Taka ()+twinRight c1 c2 = makePage $ twinRightCont c1 c2++++------+-- helper ++makeTitleStyle :: SlideOption -> MakeStyle ()+makeTitleStyle = makeBlockStyle titleOption++makeContentsStyle :: SlideOption -> MakeStyle ()+makeContentsStyle = makeBlockStyle contentsOption++makeContentsStyle2 :: SlideOption -> MakeStyle ()+makeContentsStyle2 = makeBlockStyle contentsOption2++makeAnnotationStyle :: SlideOption -> MakeStyle ()+makeAnnotationStyle = makeBlockStyle annotationOption++makeCodeStyle :: SlideOption -> MakeStyle ()+makeCodeStyle o = do+  makeBlockStyle codeOption o+  align.verticalAlign .= Just AlignMiddle+  font.fontFamily .= Just +    [ FontName "Consolas"+    , FontName "Liberation Mono"+    , FontName "Menlo"+    , FontName "Courier"+    , Monospace+    ]+  font.whiteSpace .= Just Pre++makeBlockStyle :: Getter SlideOption BlockOption -> SlideOption -> MakeStyle ()+makeBlockStyle getter option = do+  border.borderStyle .= Just BorderSolid+  border.boxSizing .= Just BorderBox+  border.borderWidth .= Just 10++  border.borderColor .= option^.getter.frameColor+  font.foreColor .= option^.getter.fontColor+  font.fontSize .= option^.getter.blockFontSize+  border.borderStyle .= option^.getter.frameStyle+  backGround .= option^.getter.bgColor++----++contents :: MakeStyle () -> HBuilder () -> HBuilder ()+contents mStyle f = let+  innerDiv = do+      verticalDiv+        [ divInfo+          { divMakeStyle = do+              mStyle+              display .= Just TableCell+          , divData = f+          }+        ]+  in do+    verticalDiv+      [ divInfo+        { divMakeStyle = do+            display .= Just Table+        , divData = innerDiv+        }+      ]++central :: MakeStyle () -> HBuilder () -> HBuilder ()+central mStyle f = let+  newStyle = do+    mStyle+    align.textAlign .= Just AlignCenter+    align.verticalAlign .= Just AlignMiddle+  in contents newStyle f++----++makePage :: Contents -> Taka ()+makePage p = do+  s <- use slideTitle+  case s of+    "" -> bindPage p+    _  -> bindPage (subTitlePage s p)++----++contents2DivInfo :: SlideOption -> Contents -> DivInfo Style+contents2DivInfo o f = divInfo { divData = extructHBuilder f o }++basicContents :: SlideOption -> MakeStyle ()+basicContents o = do+  makeContentsStyle o+  setPadding++basicContents2 :: SlideOption -> MakeStyle ()+basicContents2 o = do+  makeContentsStyle2 o+  setPadding++codeContents :: SlideOption -> MakeStyle ()+codeContents o = do+  makeCodeStyle o+  margin.paddingLeft .= Just (Per 8)++setPadding :: MakeStyle ()+setPadding = do+  margin.paddingTop .= Just (Per 3)+  margin.paddingLeft .= Just (Per 8)++makeTwinCont :: ([DivInfo Style] -> HBuilder ()) +  -> Int -> Int -> Contents -> Contents -> Contents+makeTwinCont builder i1 i2 c1 c2 = Contents $ \option -> do+  builder+    [ divInfo+        { divRatio = i1+        , divData = do+            display .= Just Table+            extructHBuilder c1 option+        }+    , divInfo+        { divRatio = i2+        , divData = do+            display .= Just Table+            extructHBuilder c2 option+        }+    ]+
src/Control/Monad/Takahashi/HtmlBuilder.hs view
@@ -20,7 +20,7 @@  import Data.List import Data.Monoid-import Control.Monad.Operational+import Control.Monad.Skeleton import Control.Monad.RWS  ----@@ -96,3 +96,5 @@     drawType2MakeStyle Stretch = do       size.height .= Just (Per 90)       size.width .= Just (Per 90)++
src/Control/Monad/Takahashi/HtmlBuilder/Monad.hs view
@@ -2,7 +2,7 @@ {-# LANGUAGE MultiParamTypeClasses, TypeSynonymInstances #-} {-# LANGUAGE FlexibleInstances, UndecidableInstances #-} module Control.Monad.Takahashi.HtmlBuilder.Monad where-import Control.Monad.Operational+import Control.Monad.Skeleton import Control.Monad.State.Class(MonadState(..)) import Control.Monad.Takahashi.HtmlBuilder.Style import Control.Monad.Writer@@ -37,7 +37,7 @@   HorizonDiv :: [DivInfo o] -> HtmlBuilderBase o ()   WriteHtml :: Html -> HtmlBuilderBase o () -type HtmlBuilder o = Program (HtmlBuilderBase o) +type HtmlBuilder o = Skeleton (HtmlBuilderBase o)   instance MonadState x (HtmlBuilder x) where   put = putHtmlOption@@ -54,34 +54,34 @@ ----  getHtmlOption :: HtmlBuilder o o-getHtmlOption = singleton GetHtmlOption+getHtmlOption = bone GetHtmlOption  putHtmlOption :: o -> HtmlBuilder o ()-putHtmlOption v = singleton $ PutHtmlOption v+putHtmlOption v = bone $ PutHtmlOption v  writeHeader1 :: String -> HtmlBuilder o ()-writeHeader1 s = singleton $ WriteHeader1 s+writeHeader1 s = bone $ WriteHeader1 s  writeHeader2 :: String -> HtmlBuilder o ()-writeHeader2 s = singleton $ WriteHeader2 s+writeHeader2 s = bone $ WriteHeader2 s  writeHeader3 :: String -> HtmlBuilder o ()-writeHeader3 s = singleton $ WriteHeader3 s+writeHeader3 s = bone $ WriteHeader3 s  writeParagraph :: String -> HtmlBuilder o ()-writeParagraph ss = singleton $ WriteParagraph ss+writeParagraph ss = bone $ WriteParagraph ss  writeList :: [String] -> HtmlBuilder o ()-writeList ss = singleton $ WriteList ss+writeList ss = bone $ WriteList ss  drawPicture :: DrawType -> String -> HtmlBuilder o ()-drawPicture t fp = singleton $ DrawPicture t fp+drawPicture t fp = bone $ DrawPicture t fp  verticalDiv :: [DivInfo o] -> HtmlBuilder o ()-verticalDiv xs = singleton $ VerticalDiv xs+verticalDiv xs = bone $ VerticalDiv xs  horizonDiv :: [DivInfo o] -> HtmlBuilder o ()-horizonDiv xs = singleton $ HorizonDiv xs+horizonDiv xs = bone $ HorizonDiv xs  writeHtml :: Html -> HtmlBuilder o ()-writeHtml h = singleton $ WriteHtml h+writeHtml h = bone $ WriteHtml h
src/Control/Monad/Takahashi/HtmlBuilder/Style.hs view
@@ -48,7 +48,7 @@ data Color = Color Integer Integer Integer deriving (Show, Read, Eq, Ord) data BorderStyle = BorderNone | BorderSolid | BorderDouble deriving (Show, Read, Eq, Ord) data BoxSizing = ContentsBox | BorderBox  deriving (Show, Read, Eq, Ord)-data FontFamily = FontName String | Monospace | Selif | SensSelif deriving (Show, Read, Eq, Ord)+data FontFamily = FontName String | Monospace | Selif | SansSelif deriving (Show, Read, Eq, Ord) data WhiteSpace = Normal | Pre deriving (Show, Read, Eq, Ord)  data Margin = Margin @@ -202,7 +202,7 @@           FontName s -> "'" ++ s ++ "'"           Monospace -> "monospace"           Selif -> "selif"-          SensSelif -> "sens-selif"+          SansSelif -> "sans-selif"        showWhiteSpace x         = case x of
src/Control/Monad/Takahashi/Monad.hs view
@@ -1,31 +1,97 @@ {-# LANGUAGE GADTs #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE TemplateHaskell #-} module Control.Monad.Takahashi.Monad where-import Control.Monad.Operational+import Control.Lens+import Control.Monad.Skeleton import Control.Monad.State.Class(MonadState(..))  import Control.Monad.Takahashi.HtmlBuilder -data TakahashiBase o a where-  GetSlideOption :: TakahashiBase o o-  PutSlideOption :: o -> TakahashiBase o ()-  Slide :: HtmlBuilder Style () -> TakahashiBase o ()+data TakahashiBase a where+  GetSlideOption :: TakahashiBase SlideOption+  PutSlideOption :: SlideOption -> TakahashiBase ()+  Slide :: HtmlBuilder Style () -> TakahashiBase () -type Takahashi o = Program (TakahashiBase o)+type Taka = Skeleton TakahashiBase -instance MonadState x (Takahashi x) where+instance MonadState SlideOption Taka where   put = putSlideOption   get = getSlideOption  ---- -getSlideOption :: Takahashi o o-getSlideOption = singleton GetSlideOption+getSlideOption :: Taka SlideOption+getSlideOption = bone GetSlideOption -putSlideOption :: o -> Takahashi o ()-putSlideOption v = singleton $ PutSlideOption v+putSlideOption :: SlideOption -> Taka ()+putSlideOption v = bone $ PutSlideOption v -slide :: HtmlBuilder Style () -> Takahashi o ()-slide f = singleton $ Slide f+slide :: HtmlBuilder Style () -> Taka ()+slide f = bone $ Slide f +------+-- slide options++data BlockOption = BlockOption+  { _fontColor :: Maybe Color+  , _bgColor :: Maybe Color+  , _frameColor :: Maybe Color+  , _frameStyle :: Maybe BorderStyle+  , _blockFontSize :: Maybe Int+  } deriving (Show, Read, Eq, Ord)++data SlideOption = SlideOption +  { _slideTitle :: String+  , _slideFontSize :: Maybe Int+  , _titleOption :: BlockOption+  , _contentsOption :: BlockOption+  , _contentsOption2 :: BlockOption+  , _annotationOption :: BlockOption+  , _codeOption :: BlockOption+  } deriving (Show, Read, Eq, Ord)++makeLenses ''BlockOption+makeLenses ''SlideOption++defaultSlideOption :: SlideOption+defaultSlideOption = SlideOption+  { _slideTitle = ""+  , _slideFontSize = Nothing+  , _titleOption = BlockOption+    { _fontColor = Just $ Color 0 0 80+    , _bgColor = Just $ Color 100 100 255+    , _frameColor = Just $ Color 0 0 80+    , _frameStyle = Just BorderSolid+    , _blockFontSize = Nothing+    }+  , _contentsOption = BlockOption+    { _fontColor = Just $ Color 0 0 80+    , _bgColor = Just $ Color 200 200 255+    , _frameColor = Just $ Color 255 255 255+    , _frameStyle = Just BorderSolid+    , _blockFontSize = Nothing+    }+  , _contentsOption2 = BlockOption+    { _fontColor = Just $ Color 80 0 0+    , _bgColor = Just $ Color 255 200 200 +    , _frameColor = Just $ Color 255 255 255+    , _frameStyle = Just BorderSolid+    , _blockFontSize = Nothing+    }+  , _annotationOption = BlockOption+    { _fontColor = Just $ Color 255 0 0+    , _bgColor = Nothing+    , _frameColor = Just $ Color 255 255 255+    , _frameStyle = Nothing+    , _blockFontSize = Nothing+    }+  , _codeOption = BlockOption+    { _fontColor = Just $ Color 0 0 80+    , _bgColor = Nothing+    , _frameColor = Just $ Color 0 0 80+    , _frameStyle = Just BorderDouble+    , _blockFontSize = Nothing+    }+  }
src/Control/Monad/Takahashi/Slide.hs view
@@ -18,100 +18,25 @@   , showTakahashi   , makeSlideWithTemplate   , makeSlide -  , makeTitleStyle-  , makeContentsStyle-  , makeContentsStyle2-  , makeAnnotationStyle-  , makeCodeStyle-  -----  , contents-  , central-  -----  , Contents(..)-  , bindPage   ) where import Control.Lens import Control.Monad.RWS import Data.List-import Paths_takahashi+import Control.Monad.Skeleton+import Paths_takahashi   import Control.Monad.Takahashi.Monad import Control.Monad.Takahashi.HtmlBuilder import Control.Monad.Takahashi.Util-import Control.Monad.Operational -data BlockOption = BlockOption-  { _fontColor :: Maybe Color-  , _bgColor :: Maybe Color-  , _frameColor :: Maybe Color-  , _frameStyle :: Maybe BorderStyle-  , _blockFontSize :: Maybe Int-  } deriving (Show, Read, Eq, Ord)--data SlideOption = SlideOption -  { _slideTitle :: String-  , _slideFontSize :: Maybe Int-  , _titleOption :: BlockOption-  , _contentsOption :: BlockOption-  , _contentsOption2 :: BlockOption-  , _annotationOption :: BlockOption-  , _codeOption :: BlockOption-  } deriving (Show, Read, Eq, Ord)--makeLenses ''BlockOption-makeLenses ''SlideOption--defaultSlideOption :: SlideOption-defaultSlideOption = SlideOption-  { _slideTitle = ""-  , _slideFontSize = Nothing-  , _titleOption = BlockOption-    { _fontColor = Just $ Color 0 0 80-    , _bgColor = Just $ Color 100 100 255-    , _frameColor = Just $ Color 0 0 80-    , _frameStyle = Just BorderSolid-    , _blockFontSize = Nothing-    }-  , _contentsOption = BlockOption-    { _fontColor = Just $ Color 0 0 80-    , _bgColor = Just $ Color 200 200 255-    , _frameColor = Just $ Color 255 255 255-    , _frameStyle = Just BorderSolid-    , _blockFontSize = Nothing-    }-  , _contentsOption2 = BlockOption-    { _fontColor = Just $ Color 80 0 0-    , _bgColor = Just $ Color 255 200 200 -    , _frameColor = Just $ Color 255 255 255-    , _frameStyle = Just BorderSolid-    , _blockFontSize = Nothing-    }-  , _annotationOption = BlockOption-    { _fontColor = Just $ Color 255 0 0-    , _bgColor = Nothing-    , _frameColor = Just $ Color 255 255 255-    , _frameStyle = Nothing-    , _blockFontSize = Nothing-    }-  , _codeOption = BlockOption-    { _fontColor = Just $ Color 0 0 80-    , _bgColor = Nothing-    , _frameColor = Just $ Color 0 0 80-    , _frameStyle = Just BorderDouble-    , _blockFontSize = Nothing-    }-  }- type TakahashiRWS a = RWS () Html SlideOption a  ---- -type Taka a = Takahashi SlideOption a- buildTakahashi :: Taka a -> TakahashiRWS a buildTakahashi t = interpret advent t   where-    advent :: TakahashiBase SlideOption a -> TakahashiRWS a+    advent :: TakahashiBase a -> TakahashiRWS a     advent GetSlideOption = get     advent (PutSlideOption o) = put o     advent (Slide t) = do@@ -138,84 +63,10 @@   return $ sub "##Presentation" (showTakahashi t) instr  makeSlide :: Taka a -> IO String-makeSlide t = getDataFileName "html/Temp.html" >>= flip makeSlideWithTemplate t+makeSlide t = getDataFileName "html/Temp.html" >>= flip makeSlideWithTemplate t   writeSlideWithTemplate :: String -> String -> Taka a -> IO () writeSlideWithTemplate r w = makeSlideWithTemplate r >=> writeFile w  writeSlide :: String -> Taka a -> IO () writeSlide w = makeSlide >=> writeFile w----------- helper --makeTitleStyle :: SlideOption -> MakeStyle ()-makeTitleStyle = makeBlockStyle titleOption--makeContentsStyle :: SlideOption -> MakeStyle ()-makeContentsStyle = makeBlockStyle contentsOption--makeContentsStyle2 :: SlideOption -> MakeStyle ()-makeContentsStyle2 = makeBlockStyle contentsOption2--makeAnnotationStyle :: SlideOption -> MakeStyle ()-makeAnnotationStyle = makeBlockStyle annotationOption--makeCodeStyle :: SlideOption -> MakeStyle ()-makeCodeStyle o = do-  makeBlockStyle codeOption o-  align.verticalAlign .= Just AlignMiddle-  font.fontFamily .= Just [SensSelif, Monospace]-  font.whiteSpace .= Just Pre--makeBlockStyle :: Getter SlideOption BlockOption -> SlideOption -> MakeStyle ()-makeBlockStyle getter option = do-  border.borderStyle .= Just BorderSolid-  border.boxSizing .= Just BorderBox-  border.borderWidth .= Just 10--  border.borderColor .= option^.getter.frameColor-  font.foreColor .= option^.getter.fontColor-  font.fontSize .= option^.getter.blockFontSize-  border.borderStyle .= option^.getter.frameStyle-  backGround .= option^.getter.bgColor--------contents :: MakeStyle () -> HBuilder () -> HBuilder ()-contents mStyle f = let-  innerDiv = do-      verticalDiv-        [ divInfo-          { divMakeStyle = do-              mStyle-              display .= Just TableCell-          , divData = f-          }-        ]-  in do-    verticalDiv-      [ divInfo-        { divMakeStyle = do-            display .= Just Table-        , divData = innerDiv-        }-      ]--central :: MakeStyle () -> HBuilder () -> HBuilder ()-central mStyle f = let-  newStyle = do-    mStyle-    align.textAlign .= Just AlignCenter-    align.verticalAlign .= Just AlignMiddle-  in contents newStyle f--------newtype Contents = Contents { extructHBuilder :: SlideOption -> HBuilder () }--bindPage :: Contents -> Taka ()-bindPage p = do-  o <- get-  slide . extructHBuilder p $ o-
src/Control/Monad/Takahashi/Util.hs view
@@ -1,5 +1,8 @@+{-# LANGUAGE RankNTypes #-}+{-# LANGUAGE ScopedTypeVariables #-} module Control.Monad.Takahashi.Util where import Control.Monad.State+import Control.Monad.Skeleton import Data.List(isPrefixOf)  stateSandbox :: MonadState s m => m a -> m a@@ -15,3 +18,9 @@   | isPrefixOf x str = y ++ drop (length x) str   | otherwise = s:sub x y ss +interpret :: forall instr m b. Monad m => (forall a. instr a -> m a) -> Skeleton instr b -> m b+interpret f p = run $ unbone p+  where+    run :: MonadView instr (Skeleton instr) a -> m a+    run (Return x) = return x+    run (v :>>= n) = f v >>= run . unbone . n
takahashi.cabal view
@@ -2,9 +2,9 @@ -- documentation, see http://haskell.org/cabal/users-guide/  name:                takahashi-version:             0.2.0.2-synopsis:            Operational Monad implementation. It is more small but adequately.-description:         Just size Operational Monad implementation.+version:             0.2.1.0+description:         library for create slide for your presentation.+synopsis:            create slide for presentation. license:             MIT license-file:        LICENSE author:              tokiwoousaka@@ -23,10 +23,11 @@                        Control.Monad.Takahashi.HtmlBuilder,                         Control.Monad.Takahashi.Monad,                        Control.Monad.Takahashi.Slide,-                       Control.Monad.Takahashi.Util-  other-modules:       Paths_takahashi   -  build-depends:       base >=4.6 && <5, -                       reasonable-operational >=0.1, -                       mtl >=2.1,-                       reasonable-lens >=0.2.1+                       Control.Monad.Takahashi.Util,+                       Control.Monad.Takahashi.API+  other-modules:       Paths_takahashi+  build-depends:       base >=4.6 && <5 , +                       monad-skeleton,+                       lens,+                       mtl   hs-source-dirs:      src