Skip to content

Instantly share code, notes, and snippets.

@etaque
Last active December 31, 2015 14:33
Show Gist options
  • Save etaque/19e7fca87c5673c30d6a to your computer and use it in GitHub Desktop.
Save etaque/19e7fca87c5673c30d6a to your computer and use it in GitHub Desktop.
Elm indentation for HTML
-- which style do you prefer?
-- commas/brackets first
rowView : Chart -> Html
rowView chart =
tr []
[ th []
[ text chart.label ]
, td
[ class "toggle"
, onClick Action.address (ToggleChart chart.id)
]
[ text <| if chart.visible then "<O>" else "<X> " ]
, td
[ class "remove"
, onClick Action.address (RemoveChart chart.id)
]
[ text "(X)"
]
]
-- commas/brackets last
rowView' : Chart -> Html
rowView' chart =
tr [] [
th [] [
text chart.label
],
td [
class "toggle",
onClick Action.address (ToggleChart chart.id)
][
text <| if chart.visible then "<O>" else "<X> "
],
td [
class "remove",
onClick Action.address (RemoveChart chart.id)
][
text "(X)"
]
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment