Skip to content
This repository was archived by the owner on Dec 21, 2018. It is now read-only.

Commit a0adea6

Browse files
authored
Merge pull request #10 from TechforgoodCAST/part3
Part2
2 parents d7b90ac + 836094b commit a0adea6

File tree

16 files changed

+335
-2
lines changed

16 files changed

+335
-2
lines changed

README.md

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,19 @@
1-
# elm-week
2-
Planning for running Elm week at Founders & Coders
1+
# Elm Week
2+
3+
Elm week at Founders & Coders
4+
5+
6+
## Core Resources
7+
8+
+ Elm Lang gitbook - https://guide.elm-lang.org/
9+
+ Frontend Masters videos - https://frontendmasters.com/courses/elm/
10+
+ Frontend Masters workshop - https://github.com/rtfeldman/elm-workshop
11+
+ Elm Package - http://package.elm-lang.org/
12+
+ Elm Core docs - http://package.elm-lang.org/packages/elm-lang/core/latest
13+
+ Html docs - http://package.elm-lang.org/packages/elm-lang/html/latest
14+
15+
16+
## Useful Resources
17+
18+
+ Cheat sheet - https://www.elm-tutorial.org/en/
19+
+ Great tutorial but gets pretty advanced later on - https://www.elm-tutorial.org/en/

part2/README.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Part 2
2+
3+
+ Html Primer
4+
+ The Elm Architecture
5+
+ Exploring types
6+
7+
8+
## Short exercise writing Html in Elm
9+
10+
+ Work through exercise in [html workshop](https://github.com/TechforgoodCAST/elm-week/tree/master/part3/html-workshop)
11+
12+
13+
## The Elm Architecture
14+
15+
How an Elm app fits together
16+
17+
+ Frontend masters section on The Elm Architecture (TEA) - https://frontendmasters.com/courses/elm/the-elm-architecture/
18+
+ Read through the page on the elm-lang guide - https://guide.elm-lang.org/architecture/
19+
+ Work through first 3 User input exercises (up to `Form`) - https://guide.elm-lang.org/architecture/user_input/
20+
21+
22+
## Exploring Types
23+
24+
+ Read types section on elm-lang guide - https://guide.elm-lang.org/types/
25+
+ Error handling (Maybe and Result) - https://guide.elm-lang.org/error_handling/
26+
+ Video on Union Types - https://frontendmasters.com/courses/elm/union-types
27+
+ [Map workshop](https://github.com/TechforgoodCAST/elm-week/tree/master/part3/map-workshop)
28+
29+
30+
## A short exercise to tie it all together
31+
32+
[mini-todos-workshop](https://github.com/TechforgoodCAST/elm-week/tree/master/part3/mini-todos-workshop) - Implement a todo app based on the first example in the union types section

part2/html-workshop/Main.elm

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
module Main exposing (..)
2+
3+
import Html exposing (..)
4+
import Html.Attributes exposing (..)
5+
6+
7+
main : Html msg
8+
main =
9+
div []
10+
[ stylesheetLink
11+
-- add your components here
12+
]
13+
14+
15+
stylesheetLink : Html msg
16+
stylesheetLink =
17+
-- this appends the tachyons stylesheet to the DOM
18+
node "link"
19+
[ rel "stylesheet"
20+
, href "https://unpkg.com/tachyons@4.8.0/css/tachyons.min.css"
21+
]
22+
[]

part2/html-workshop/README.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# Html Exercise
2+
3+
Try recreating some of your components from the tachyons workshop in elm
4+
5+
https://github.com/TechforgoodCAST/prototyping-workshop/tree/master/tachyons-workshop
6+
7+
### Getting Started
8+
9+
1. cd into this directory
10+
2. run `elm-reactor` in the terminal - this will let you preview an elm app straight away
11+
3. visit `localhost:8000`
12+
4. Click on `Main.elm` - this will run the program in `Main.elm` (all output comes from the `main` function in `Main.elm`)
13+
5. add your components to the `main` function to see them on the page
14+
15+
16+
An example to get you started:
17+
18+
This:
19+
```html
20+
<button class="bg-blue white br2">Click Me</button>
21+
```
22+
23+
Can be written in Elm as:
24+
```elm
25+
myButton =
26+
button [ class "bg-blue white br2" ] [ text "Click Me" ]
27+
```
28+
29+
Just remember:
30+
+ `button` is a function that takes two `List`s
31+
+ The first is a list of `Attribute`s (like `class` or `style`)
32+
+ The second a list of child nodes (i.e. other html elements)
33+
34+
35+
### Resources
36+
37+
+ Html and the Virtual DOM - https://frontendmasters.com/courses/elm/html-and-the-virtual-dom
38+
+ Elm Html Docs - http://package.elm-lang.org/packages/elm-lang/html/2.0.0/Html
39+
+ Html Attributes - http://package.elm-lang.org/packages/elm-lang/html/2.0.0/Html-Attributes
40+
41+
42+
### Tachyons Stylesheet
43+
44+
The tachyons stylesheet is included in `Main.elm`, at the moment it's not possible to include external scripts and stylsheets in `elm-reactor` so elm appends this to the DOM
45+
46+
This:
47+
```elm
48+
stylesheetLink : Html msg
49+
stylesheetLink =
50+
node "link"
51+
[ rel "stylesheet"
52+
, href "https://unpkg.com/tachyons@4.8.0/css/tachyons.min.css"
53+
]
54+
[]
55+
```
56+
57+
Becomes this:
58+
```html
59+
<link rel="stylesheet" href="https://unpkg.com/tachyons@4.8.0/css/tachyons.min.css"/>
60+
```
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"version": "1.0.0",
3+
"summary": "helpful summary of your project, less than 80 characters",
4+
"repository": "https://github.com/user/project.git",
5+
"license": "BSD3",
6+
"source-directories": [
7+
"."
8+
],
9+
"exposed-modules": [],
10+
"dependencies": {
11+
"elm-lang/core": "5.1.1 <= v < 6.0.0",
12+
"elm-lang/html": "2.0.0 <= v < 3.0.0"
13+
},
14+
"elm-version": "0.18.0 <= v < 0.19.0"
15+
}
File renamed without changes.

0 commit comments

Comments
 (0)