Skip to content

Commit 88b2fb3

Browse files
committed
Update documentation code for 0.18.0
1 parent 467bf0f commit 88b2fb3

File tree

5 files changed

+17
-22
lines changed

5 files changed

+17
-22
lines changed

docs/inko.pkg

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
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

docs/src/docs/config.inko

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import wobsite (Page)
66

77
let MENU_FILE = 'menu.json'
88

9-
class pub Config {
9+
type pub Config {
1010
# The name of the website.
1111
let pub @title: String
1212

@@ -39,7 +39,7 @@ class pub Config {
3939
}
4040
}
4141

42-
impl Clone[Config] for Config {
42+
impl Clone for Config {
4343
fn pub clone -> Config {
4444
Config(title: @title, base_url: @base_url, menu: @menu.clone, main: @main)
4545
}

docs/src/docs/filters.inko

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import wobsite (Page)
66
import wobsite.url (relative_to_absolute)
77

88
# A filter that automatically inserts a table of contents.
9-
class AutoTableOfContents {
9+
type AutoTableOfContents {
1010
fn static new -> AutoTableOfContents {
1111
AutoTableOfContents()
1212
}
@@ -23,7 +23,7 @@ impl Filter for AutoTableOfContents {
2323
}
2424
}
2525

26-
class AddCopyButton {
26+
type AddCopyButton {
2727
fn static new -> AddCopyButton {
2828
AddCopyButton()
2929
}
@@ -54,7 +54,7 @@ impl Filter for AddCopyButton {
5454
# A filter that turns relative document links (e.g. `[](ivm)`) into the correct
5555
# URLs, optionally setting the link text if left out. This makes it easier to
5656
# link to different documents.
57-
class RelativeLinks {
57+
type RelativeLinks {
5858
let @menu: ref Menu
5959
let @page: ref Page
6060

docs/src/docs/menu.inko

+6-12
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ fn parse_front_matter(path: ref Path) -> Result[FrontMatter, String] {
1818
})
1919
}
2020

21-
class Item {
21+
type Item {
2222
let @title: String
2323
let @url: String
2424

@@ -30,25 +30,19 @@ class Item {
3030
}
3131
}
3232

33-
impl Clone[Item] for Item {
33+
impl Clone for Item {
3434
fn pub clone -> Item {
3535
Item(title: @title, url: @url)
3636
}
3737
}
3838

39-
class Menu {
39+
type Menu {
4040
let @items: Map[String, Array[Item]]
4141
let @titles: Map[String, String]
4242

4343
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) {
5246
case Ok(Object(map)) -> map
5347
case Ok(_) -> throw 'the top-level value must be an object'
5448
case Error(e) -> throw e.to_string
@@ -89,7 +83,7 @@ class Menu {
8983
}
9084
}
9185

92-
impl Clone[Menu] for Menu {
86+
impl Clone for Menu {
9387
fn pub clone -> Menu {
9488
Menu(
9589
items: @items.iter.reduce(Map.new, fn (map, pair) {

docs/src/main.inko

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import docs.config (Config)
22
import docs.layouts
33
import wobsite (Site)
44

5-
class async Main {
5+
type async Main {
66
fn async main {
77
Site.build(fn (site) {
88
# Each page needs this data, so we panic if we can't parse it as we can't

0 commit comments

Comments
 (0)