Shpadoinkle-html: A typed, template generated Html DSL, and helpers.

This is a package candidate release! Here you can preview how this package release will appear once published to the main package index (which can be accomplished via the 'maintain' link below). Please note that once a package has been published to the main package index it cannot be undone! Please consult the package uploading documentation for more information.

[maintain] [Publish]

Shpadoinkle Html is a typed template generated Html DSL building on types provided by Shpadoinkle Core. This exports a large namespace of terms covering most of the Html specifications. Some Elm API style helpers are present but as outlaw type classes.


[Skip to Readme]

Properties

Versions 0.0.0.1, 0.0.0.1, 0.1.0.0, 0.2.0.0, 0.2.0.1, 0.3.0.0, 0.3.0.1, 0.3.0.2
Change log CHANGELOG.md
Dependencies base (>=4.12.0 && <4.13), containers (>=0.6.0 && <0.7), ghcjs-dom (>=0.9.4 && <0.20), jsaddle (>=0.9.7 && <0.20), jsaddle-dom (>=0.9.3 && <0.20), Shpadoinkle (<0.1), stm (>=2.5.0 && <2.6), template-haskell (>=2.14.0 && <2.15), text (>=1.2.3 && <1.3), unliftio (>=0.2.12 && <0.3) [details]
License BSD-3-Clause
Author Isaac Shapira
Maintainer fresheyeball@protonmail.com
Category Web
Source repo head: git clone https://gitlab.com/fresheyeball/Shpadoinkle.git
Uploaded by fresheyeball at 2020-05-09T20:02:51Z

Modules

[Index] [Quick Jump]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees


Readme for Shpadoinkle-html-0.0.0.1

[back to package description]

Shpadoinkle Html

Goldwater Hackage Hackage Deps Hackage CI

This module provides named functions for generating Html, and other browser utilities.

For example, instead of writing

view = h "div" [ ("class", PText "foo") ]
  [ h "span" [] [ text "hi there" ] ]

we can write

view = div "foo" [ span_ [ "hi there" ] ]

which is a bit nicer, and eleminates the risk of typeos in tag names. It also provies some nice IsString instances for ergonomics.

Keyboard

This module provides pattern synonyms for common key codes. For example:

div [ onKeyup $ \case
    Enter -> fireLazors
    UpArrow -> jump
    DownArrow -> crouch
    LeftArrow -> move -1
    RightArrow -> move 1
  ]

which is a bit nicer, and harder to get wrong than using magic int's to identify keys.

Browser utilities

We provide high level apis to lower level browser apis. Including

I know it's just one right now. But this is the place to contribute more. Such as