File tree 5 files changed +17
-22
lines changed
5 files changed +17
-22
lines changed Original file line number Diff line number Diff line change 1
- require https://github.com/yorickpeterse/inko-wobsite 0.19.0 fa5e47733423aa6a902028e69de5a374a1757377
2
- require https://github.com/yorickpeterse/inko-builder 0.13.0 7a38803e1fcd80e19ad2ea8fd90b9babf70e93a6
3
- require https://github.com/yorickpeterse/inko-markdown 0.21.0 3726c10b499242cb3febc931a82e35217e2f987a
4
- require https://github.com/yorickpeterse/inko-syntax 0.16.0 21cd93afb84c093c28bb3629e0b8b9441f6b1822
1
+ require https://github.com/yorickpeterse/inko-wobsite 0.20.0 1b22d32a1bfa1805c0e93699e659186c15664386
2
+ require https://github.com/yorickpeterse/inko-builder 0.14.0 6a30e6d8cfaf2f9c20f17e872e9e9acf586e5f23
3
+ require https://github.com/yorickpeterse/inko-markdown 0.22.0 85b35aaf19098b5ba36b7328d70a5f12257f9438
4
+ require https://github.com/yorickpeterse/inko-syntax 0.17.0 9eecb84894f1ab240989142e6057be72b5f9d13b
5
+ require inko 0.18.0
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ import wobsite (Page)
6
6
7
7
let MENU_FILE = 'menu.json'
8
8
9
- class pub Config {
9
+ type pub Config {
10
10
# The name of the website.
11
11
let pub @title: String
12
12
@@ -39,7 +39,7 @@ class pub Config {
39
39
}
40
40
}
41
41
42
- impl Clone[Config] for Config {
42
+ impl Clone for Config {
43
43
fn pub clone -> Config {
44
44
Config(title: @title, base_url: @base_url, menu: @menu.clone, main: @main)
45
45
}
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ import wobsite (Page)
6
6
import wobsite.url (relative_to_absolute)
7
7
8
8
# A filter that automatically inserts a table of contents.
9
- class AutoTableOfContents {
9
+ type AutoTableOfContents {
10
10
fn static new -> AutoTableOfContents {
11
11
AutoTableOfContents()
12
12
}
@@ -23,7 +23,7 @@ impl Filter for AutoTableOfContents {
23
23
}
24
24
}
25
25
26
- class AddCopyButton {
26
+ type AddCopyButton {
27
27
fn static new -> AddCopyButton {
28
28
AddCopyButton()
29
29
}
@@ -54,7 +54,7 @@ impl Filter for AddCopyButton {
54
54
# A filter that turns relative document links (e.g. `[](ivm)`) into the correct
55
55
# URLs, optionally setting the link text if left out. This makes it easier to
56
56
# link to different documents.
57
- class RelativeLinks {
57
+ type RelativeLinks {
58
58
let @menu: ref Menu
59
59
let @page: ref Page
60
60
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ fn parse_front_matter(path: ref Path) -> Result[FrontMatter, String] {
18
18
})
19
19
}
20
20
21
- class Item {
21
+ type Item {
22
22
let @title: String
23
23
let @url: String
24
24
@@ -30,25 +30,19 @@ class Item {
30
30
}
31
31
}
32
32
33
- impl Clone[Item] for Item {
33
+ impl Clone for Item {
34
34
fn pub clone -> Item {
35
35
Item(title: @title, url: @url)
36
36
}
37
37
}
38
38
39
- class Menu {
39
+ type Menu {
40
40
let @items: Map[String, Array[Item]]
41
41
let @titles: Map[String, String]
42
42
43
43
fn static parse(source: ref Path, path: ref Path) -> Result[Menu, String] {
44
- let bytes = ByteArray.new
45
-
46
- try ReadOnlyFile
47
- .new(path.clone)
48
- .then(fn (f) { f.read_all(bytes) })
49
- .map_error(fn (e) { e.to_string })
50
-
51
- let root = match Json.parse(bytes) {
44
+ let file = try ReadOnlyFile.new(path).map_error(fn (e) { e.to_string })
45
+ let root = match Json.parse(file) {
52
46
case Ok(Object(map)) -> map
53
47
case Ok(_) -> throw 'the top-level value must be an object'
54
48
case Error(e) -> throw e.to_string
@@ -89,7 +83,7 @@ class Menu {
89
83
}
90
84
}
91
85
92
- impl Clone[Menu] for Menu {
86
+ impl Clone for Menu {
93
87
fn pub clone -> Menu {
94
88
Menu(
95
89
items: @items.iter.reduce(Map.new, fn (map, pair) {
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import docs.config (Config)
2
2
import docs.layouts
3
3
import wobsite (Site)
4
4
5
- class async Main {
5
+ type async Main {
6
6
fn async main {
7
7
Site.build(fn (site) {
8
8
# Each page needs this data, so we panic if we can't parse it as we can't
You can’t perform that action at this time.
0 commit comments