Slice Show

A simple presentation engine in Elm

Features

    Running the engine

    main : Program Never
    main =
      SliceShow.init slides
      |> SliceShow.show
    

    Structuring the content

    bullet : String -> Content {} {}
    bullet str = item (li [] [text str])
    
    bullets : List (Content {} {}) -> Content {} {}
    bullets = container (ul [])
    
    bulletsSlide : List (Content {} {})
    bulletsSlide =
        [bullets [bullet "first", bullet "second"]]
    

    Syntax highlight

    code : String -> String -> Content {} {}
    code lang str =
      Markdown.toHtml
        []
        ("```" ++ lang ++ "\n" ++ str ++ "\n```")
      |> item
    
    codeSlide : List (Content {} {})
    codeSlide =
      [ code "elm" """bullet : String -> Content {} {}
      bullet str = item (li [] [text str])"""
      ]
    

    Prev and Next buttons

    nextButton : Content {} {}
    nextButton = next [] [text "Click to go to the next slide"]
    

    Custom content

    elapsed : Content Time Time
    elapsed = custom 0
    
    slide : List (Content {} {})
    slide = [item (text "Elapsed: "), elapsed]
    
    main : Program Never
    main = init [slide]
      |> setSubscriptions (\_ -> onAnimationFrameDelta identity)
      |> setUpdate (\dt time -> (time + dt, Cmd.none))
      |> setView (\time -> text ("Elapsed: " ++ (round time // 1000 |> String.fromInt) ++ " seconds"))
      |> show
    

    Elapsed: 0 seconds

    Questions?

    elm package install w0rm/elm-slice-show