on master help sign in
gall fixes
commite9fdef39cad195735eb442c73ff26e46c22c668d authorjoshuareagan <joshuareagan@gmail.com> dateThu 4 Oct 2018, 17:21 (8 years ago) parent27b9eda
7 files changed+115−116
docs/tutorials/gall/generators.umd+34−29 docs/tutorials/gall/http.umd+7−12 docs/tutorials/gall/marks.umd+18−24 docs/tutorials/gall/network.umd+5−2 docs/tutorials/gall/state.umd+1−1 docs/tutorials/gall/subscriptions.umd+7−3 docs/tutorials/gall/web-apps.umd+43−45
docs/tutorials/gall/generators.umd+34−29
@@ -31,10 +31,11 @@ Another generator is `+hood/merge`. Try running `+hood/merge` with the
3131normal arguments for `|merge`:
3232
3333```
34−~fintud-macrep:dojo> +hood/merge %home our %they
35−[syd=%home her=~fintud-macrep sud=%they gem=%auto]
36−~fintud-macrep:dojo> +hood/merge %home our %they, =gem %this
37−[syd=%home her=~fintud-macrep sud=%they gem=%auto]
34+> +hood/merge %home our %they
35+[syd=%home her=~zod sud=%they cas=[%da p=~2018.10.4..21.11.49..901c] gem=%auto]
36+
37+> +hood/merge %home our %they, =gem %this
38+[syd=%home her=~zod sud=%they cas=[%da p=~2018.10.4..21.12.11..ee32] gem=%this]
3839```
3940
4041This didn't run any merge, it just constructed the command that, if sent
@@ -56,47 +57,47 @@ pattern is so common, this can be abbreviated to
5657generators for the `:hood` app, `:hood|generator <args>` can be
5758shortened to `|generator <args>`.
5859
59−Let's write a generator for a modified version of `:examples-pong` from
60+Let's write a generator for a modified version of `:pong` from
6061the chapter on [Network Messages](/docs/arvo/system/network). Recall
61−that `:examples-pong` takes an urbit address, which is of mark `urbit`,
62+that `:pong` takes an urbit address, which is of mark `urbit`,
6263and sends that urbit the message `'howdy'`. First--without a
63−generator--let's make `:examples-ping` that does the same, except that
64+generator--let's make `:ping` that does the same, except that
6465it lets the user optionally specify the message as well.
6566
6667We'll need a new mark for our arguments. Let's call it
67−`examples-ping-message`.
68+`ping-message`.
6869
69−> For app-specific marks, it's good style to prefix the name of the mark with the name of the app. Since many apps have several such marks, subdirectories in `/mar` are rendered as `-`, so that `ping-message` is written in (/mar/examples/ping/message.hoon).
70+> For app-specific marks, it's good style to prefix the name of the mark with the name of the app. Since many apps have several such marks, subdirectories in `/mar` are rendered as `-`, so that `ping-message` is written in (/mar/ping/message.hoon).
7071
7172```
7273::
73−:::: /hoon/message/ping/examples/app
74+:::: /mar/ping/message/hoon
7475 ::
7576/? 314
7677|_ [to=@p message=@t]
7778++ grab
7879 |%
79− ++ noun [@p @t]
80+ +$ noun [@p @t]
8081 --
8182--
8283```
8384
84−The app can easily be modified to use this (`/app/examples/ping.hoon`):
85+The app can easily be modified to use this (`/app/ping.hoon`):
8586
8687```
8788:: Allows one ship to ping another with a string of text
8889::
89−:::: /hoon/ping/examples/app
90+:::: /app/ping/hoon
9091 ::
9192/? 314
9293|%
93− ++ move [bone term wire *]
94+ +$ move [bone term wire *]
9495--
9596!:
96−|_ [bowl:gall state=$~]
97+|_ [bowl:gall state=%~]
9798::
98−++ poke-examples-ping-message
99− |= [to=@p message/@t}
99+++ poke-ping-message
100+ |= [to=@p message=@t]
100101 ~& 'sent'
101102 ^- [(list move) _+>.$]
102103 :- ^- (list move)
@@ -119,27 +120,28 @@ The app can easily be modified to use this (`/app/examples/ping.hoon`):
119120Now we can run this with:
120121
121122```
122−~fintud-macrep:dojo> |start %examples-ping
123+~fintud-macrep:dojo> |start %ping
123124>=
124−~fintud-macrep:dojo> :examples-ping &examples-ping-message [~sampel-sipnym 'heyya']
125+
126+~fintud-macrep:dojo> :ping &ping-message [~sampel-sipnym 'heyya']
125127>=
126128```
127129
128−And on `~sampel-sipnym`, assuming it's running `:examples-ping` as well,
130+And on `~sampel-sipnym`, assuming it's running `:ping` as well,
129131we see `[%receiving 'heyya']`.
130132
131133This is an annoying way to invoke the app, though. The `[]` are
132134mandatory, and optional arguments are hard. Let's make a generator,
133−`+examples-send` to make everything nicer. Since it's specific to
134−`:examples-ping`, let's put it in `/gen/examples/ping/send.hoon`:
135+`+send` to make everything nicer. Since it's specific to
136+`:ping`, let's put it in `/gen/ping/send.hoon`:
135137
136138```
137139:- %say
138−|= [^ [to=@p message=?($~ [text=@t $~])] $~]
139−[%examples-ping-message to ?~(message 'howdy' text.message)]
140+|= [^ [to=@p message=?(%~ [text=@t %~])] %~]
141+[%ping-message to ?~(message 'howdy' text.message)]
140142```
141143
142−A couple of new things here. Firstly, `message=?($~ [text=@t $~])`
144+A couple of new things here. Firstly, `message=?(%~ [text=@t %~])] %~]`
143145should be read as "the message is either null or a pair of text and
144146null". Generator argument lists are always null-terminated, which makes
145147it convenient to accept lists in tail position (which are particularly
@@ -151,17 +153,20 @@ anything that's in either `a` or `b`. Thus, in our case,
151153This is run as follows:
152154
153155```
154−~fintud-macrep:dojo> :examples-ping|send ~sampel-sipnym
156+~fintud-macrep:dojo> :ping|send ~sampel-sipnym
155157>=
156−~fintud-macrep:dojo> :examples-ping|send ~sampel-sipnym 'how do you do'
158+
159+~fintud-macrep:dojo> :ping|send ~sampel-sipnym 'how do you do'
157160>=
158161```
159162
160163Which causes `~sampel-sipnym` to print `[%receiving 'howdy']` and
161164`[%receiving 'how do you do']`.
162165
166+(Note: `:ping|send ~sampel-sipnym` is short for `:ping +ping/send ~sampel-sipnym`.)
167+
163168*Exercises*:
164169
165−- Create a generator for `:examples-sum` from [State](../../state) so that you can run `:examples-sum|add 5` to add numbers to it.
170+- Create a generator for `:sum` from [State](../../state) so that you can run `:sum|add 5` to add numbers to it.
166171
167−- Create a generator for `:examples-click` from [Web Apps](../../web-apps) so that you can run `:examples-click|poke` to poke it.
172+- Create a generator for `:click` from [Web Apps](../../web-apps) so that you can run `:click|poke` to poke it.
docs/tutorials/gall/http.umd+7−12
@@ -13,12 +13,12 @@ Let's figure out how to make HTTP requests and set timers.
1313
1414Let's build an uptime-monitoring system. It'll ping a web
1515service periodically and print out an error when the response
16−code isn't 2xx. Here's `app/up.hoon`:
16+code isn't 2xx. Save the following as `app/up.hoon`:
1717
1818```
1919:: Up-ness monitor. Accepts atom url, 'on', or 'off'
2020::
21−:::: /hoon/up/examples/app
21+:::: /hoon/up/app
2222 ::
2323/? 314
2424|%
@@ -33,7 +33,7 @@ code isn't 2xx. Here's `app/up.hoon`:
3333 [%target p=cord] :: set poll target('http://...')
3434 ==
3535--
36−|_ [hid=bowl:gall on=_| in-progress=_| target=@t}
36+|_ [hid=bowl:gall on=_| in-progress=_| target=@t]
3737++ poke-atom
3838 |= url-or-command=@t ^- (quip move +>)
3939 =+ ^- act/action
@@ -140,12 +140,7 @@ Here's the move that sends the HTTP request:
140140[ost.hid %hiss /request ~ %httr %purl (need (epur target))]
141141```
142142
143−> Remember, we are expected to produce a *list* of moves. Note the `~`
144−> after the move in the full example. This is a convenient shortcut for
145−> creating a list of a single element. It's part of a small family of
146−> such shortcuts. `~[a b c]` is `[a b c ~]`, `[a b c]~` is `[[a b c]
147−> ~]` and `\`[a b c]` is `[~ a b c]`. These may be mixed and matched to
148−> create various convoluted structures and emojis.
143+> Remember, we are expected to produce a *list* of moves. Note the `~` after the move in the full example. This is a convenient shortcut for creating a list of a single element. It's part of a small family of such shortcuts. `~[a b c]` is `[a b c ~]`, `[a b c]~` is `[[a b c] ~]` and `\`[a b c]` is `[~ a b c]`. These may be mixed and matched to create various convoluted structures and emojis.
149144
150145The correspondence between this move and `[bone card]` can be hard to
151146visualize on one line. Here it is more pedantically:
@@ -182,14 +177,14 @@ Let's try it out:
182177```
183178~fintud-macrep:dojo> |start %up
184179>=
185−~fintud-macrep:dojo> :examples-up &atom 'http://www.google.com'
180+~fintud-macrep:dojo> :up &atom 'http://www.google.com'
186181>=
187182[%all-is-well 200]
188183[%all-is-well 200]
189−~fintud-macrep:dojo> :examples-up &atom 'http://example.com'
184+~fintud-macrep:dojo> :up &atom 'http://example.com'
190185>=
191186[%all-is-well 200]
192−~fintud-macrep:dojo> :examples-up &atom 'http://google.com'
187+~fintud-macrep:dojo> :up &atom 'http://google.com'
193188>=
194189[%we-have-a-problem 301]
195190[ %headers
docs/tutorials/gall/marks.umd+18−24
@@ -13,9 +13,9 @@ our own marks. Let's write a sample mark of our own, then chain
1313it together with some preexisting ones to have fun with type
1414conversions.
1515
16−Let's make a small "examples-cord" mark. "Cord" is a name we use for `@t`
16+Let's make a small "cord" mark. "Cord" is a name we use for `@t`
1717text, but there's no predefined mark for it. Let's put the following code in:
18−`/mar/examples/cord.hoon`:
18+`/mar/cord.hoon`:
1919
2020```
2121/? 314
@@ -63,10 +63,10 @@ marked atom and convert it to our new mark.
6363~fintud-macrep:dojo> &atom 9
64649
6565
66−~fintud-macrep:dojo> &examples-cord &atom 9
66+~fintud-macrep:dojo> &cord &atom 9
6767'9'
6868
69−~fintud-macrep:dojo> &examples-cord &atom &examples-cord &atom 9
69+~fintud-macrep:dojo> &cord &atom &cord &atom 9
7070 '57'
7171```
7272
@@ -78,16 +78,13 @@ same concept. They're not isomorphisms.
7878Let's play around a little more:
7979
8080```
81−~fintud-macrep:dojo> &md &examples-cord &atom 17
81+~fintud-macrep:dojo> &md &cord &atom 17
8282'17'
83−~fintud-macrep:dojo> &hymn &md &examples-cord &atom 17
83+
84+~fintud-macrep:dojo> &hymn &md &cord &atom 17
8485[ [%html ~]
85− [[%head ~] [[%title ~] [[%~. [%~. "Untitled"] ~] ~] ~] ~]
86− [ [%body ~]
87− [ i=[g=[n=%meta a=~[[n=%value v="{}"] [n=%name v="frontmatter"] [n=[%urb %front] v=""]]] c=~]
88− t=[i=[g=[n=%p a=~] c=~[[g=[n=%$ a=~[[n=%$ v="17"]]] c=~]]] t=~]
89− ]
90− ]
86+ [[%head ~] ~]
87+ [[%body ~] [g=[n=%pre a=~] c=~[[g=[n=%$ a=~[[n=%$ v="17"]]] c=~]]] ~]
9188 ~
9289]
9390```
@@ -100,35 +97,32 @@ the time this gets to the web page, it's plain html. Let's do
10097the final step in the conversion.
10198
10299```
103−~fintud-macrep:dojo> &mime &hymn &md &examples-cord &atom 17
104−[ [%text %html ~]
105− p=121
106− q='<html><head><title>Untitled</title></head><body><meta value="{}" name="frontmatter" urb:front="" /><p>17</p></body></html>'
107−]
100+~fintud-macrep:dojo> &mime &hymn &md &cord &atom 17
101+[[%text %html ~] p=52 q='<html><head></head><body><pre>17</pre></body></html>']
108102```
109103
110104This is a mime-typed octet stream with type `/text/html`, length
111105121 bytes, and our lowly number `17` rendered to a web page.
112−`examples-cord` was just one step in the chain.
106+`cord` was just one step in the chain.
113107
114108Of course, arvo can infer some parts of this chain:
115109
116110```
117−~fintud-macrep:dojo> &examples-cord 17
111+~fintud-macrep:dojo> &cord 17
118112'17'
119113```
120114
121−Likewise, `md` is the only way to get from `examples-cord` to `hymn`, so
115+Likewise, `md` is the only way to get from `cord` to `hymn`, so
122116that can be omitted. If we omit the `hymn`, though, we get:
123117
124118```
125−~fintud-macrep:dojo> &mime &examples-cord 17
126−[[%text %x-markdown ~] p=1 q='7']
119+~fintud-macrep:dojo> &mime &cord 17
120+[[%text %x-markdown ~] p=2 q='17']
127121```
128122
129−Here, we converted straight from `examples-cord` to `md` to `mime`. Arvo
123+Here, we converted straight from `cord` to `md` to `mime`. Arvo
130124decided that was the most straightforward conversion, but it
131125gives a different result than passing it through the `hymn`
132126mark.
133127
134−The minimal correct input, then, is `&mime &hymn &examples-cord &atom 17`.
128+The minimal correct input, then, is `&mime &hymn &cord &atom 17`.
docs/tutorials/gall/network.umd+5−2
@@ -33,6 +33,8 @@ Let's get our planets to talk to each other. To listen for and receive messages
3333-- :: end of poke-noun arm definition
3434```
3535
36+Save this as `echo.hoon` in the `/app` directory of your urbit's pier.
37+
3638This is a very simple app that does only one thing. If you poke it with
3739a value, it prints that value out. To try this out, you have to start
3840the app, then you can poke it from the command line with the following
@@ -85,8 +87,7 @@ particular address in our subject where our formal app state is stored.
8587It'll become clear why this is later on, but for now pretend that `+>.$`
8688is a magic invocation that means "app state".
8789
88−Let's look at another example (edit your code in
89−`/app/examples/echo/hoon` to reflect the code below). Say we want to
90+Let's look at another example. Say we want to
9091only accept a number, and then print out the square of that number.
9192
9293```
@@ -110,6 +111,8 @@ only accept a number, and then print out the square of that number.
110111--
111112```
112113
114+Save this as `square.hoon` in the `/app` directory of your urbit's pier.
115+
113116A few things have changed. Firstly, we no longer accept arbitrary nouns because
114117we can only square atoms (integers, in this case an unsigned one). Thus, our
115118argument is now `tom=@`. Secondly, it's `++poke-atom` rather than `++poke-noun`.
docs/tutorials/gall/state.umd+1−1
@@ -86,7 +86,7 @@ you like. But let's clarify a couple other things before we continue.
8686
8787First, `bowl` is a set of general global states. This set is managed by the
8888system. It includes things like `now` (the current time), `our` (our urbit
89−identity), and `eny` (256 bits of guaranteed-fresh entropy). For the full list
89+identity), and `eny` (512 bits of guaranteed-fresh entropy). For the full list
9090of things in `++bowl`, search for `++ bowl` (note: two spaces) in
9191`/arvo/zuse.hoon`.
9292
docs/tutorials/gall/subscriptions.umd+7−3
@@ -39,17 +39,17 @@ Let's take a look at two apps, `:source` and `:sink`. First,
3939 ^- [(list move) _+>.$]
4040 :_ +>.$
4141 %+ turn (prey /example-path bow)
42− |=({o=bone *} [o %diff %noun non])
42+ |=([o=bone *] [o %diff %noun non])
4343::
4444++ peer-example-path
45− |= pax/path
45+ |= pax=path
4646 ^- [(list move) _+>.$]
4747 ~& source+peer-notify+'Someone subscribed to you!'
4848 ~& source+[ship+src.bow path+pax]
4949 [~ +>.$]
5050::
5151++ coup
52− |= {wir=wire err=(unit tang)}
52+ |= [wir=wire err=(unit tang)]
5353 ^- [(list move) _+>.$]
5454 ?~ err
5555 ~& source+success+'Poke succeeded!'
@@ -71,6 +71,8 @@ Let's take a look at two apps, `:source` and `:sink`. First,
7171--
7272```
7373
74+Save this as `source.hoon` in the `/app` directory of your urbit's pier.
75+
7476And secondly, `:sink`:
7577
7678```
@@ -138,6 +140,8 @@ And secondly, `:sink`:
138140--
139141```
140142
143+Save this as `sink.hoon` in the `/app` directory of your urbit's pier.
144+
141145Two notes:
142146
143147- `bowl` is the type of the system state within our app. For example, it includes things like `our`, the name of the host urbit, and `now`, the current time.
docs/tutorials/gall/web-apps.umd+43−45
@@ -20,7 +20,7 @@ poke it. There'll be a button to poke the app, and line of text
2020below it saying how many times the app has been poked. We can
2121update this by subscribing our page to the relevant path on its app.
2222
23−Let's first checkout the app `/app/examples/click.hoon`:
23+Save the following as `click.hoon` in the `/app` directory of your urbit's pier.
2424
2525```
2626/? 314
@@ -30,26 +30,26 @@ Let's first checkout the app `/app/examples/click.hoon`:
3030--
3131!:
3232|_ [hid=bowl:gall clicks=@]
33−++ poke-examples-click-click
34− |= click/$click
33+++ poke-click
34+ |= click=%click
3535 ~& [%poked +(clicks)]
3636 :_ +>.$(clicks +(clicks))
37− %+ turn (prey /the-path hid)
38− |=({o=bone *} [o %diff %examples-click-clicks +(clicks)])
37+ %+ turn (prey:pubsub:userlib /the-path hid)
38+ |=([o=bone *] [o %diff %clicks +(clicks)])
3939++ peer-the-path
40− |= pax/path
41− [[[ost.hid %diff %examples-click-clicks clicks] ~] +>.$]
40+ |= pax=path
41+ [[[ost.hid %diff %clicks clicks] ~] +>.$]
4242--
4343```
4444
4545There's nothing really new here, except that we use a couple of
4646new marks, `click` and `clicks`. When we get poked with a
4747`click`, we increment the variable `clicks` in our state and tell
48−all our subcribers the new value. When someone subscribes to us
48+all our subscribers the new value. When someone subscribes to us
4949on the path `/the-path`, we immediately give them the current
5050number of clicks.
5151
52−Let's take a look at the new marks. Here's `/mar/examples/click/click.hoon`:
52+Let's take a look at the new marks. Save this as `/mar/click.hoon`:
5353
5454```
5555|_ click=%click
@@ -58,68 +58,66 @@ Let's take a look at the new marks. Here's `/mar/examples/click/click.hoon`:
5858 ++ noun |=(* %click)
5959 ++ json
6060 |= jon=^json
61− ?> =('click' (need (so:jo jon)))
61+ ?> =('click' (need (so:dejs-soft:format jon)))
6262 %click
6363 --
6464--
6565```
6666
67−The mark `examples-click-click` has type `%click`, which means the only
67+The mark `click` has type `%click`, which means the only
6868valid value is `%click`. We can convert from `noun` by just
6969producing `%click`.
7070
71−We also convert from json by parsing a json string with `so:jo`,
71+We also convert from json by parsing a json string with `so:dejs-soft:format`,
7272asserting the parsing succeeded with `need`, and asserting the
7373result was 'click' with `?>`, which asserts that its first child
7474is true.
7575
76−> Note the argument to `++json`is `jon=^json`. Why `^json`?
77−> `++json` shadows the type definition, so if we want to refer to
78−> the type, we have to prepend a `^`. This extends to multiple
79−> levels: `^^^foo` means the fourth most innermost instance of `foo`.
76+> Note the argument to `++json`is `jon=^json`. Why `^json`? `++json` shadows the type definition, so if we want to refer to the type, we have to prepend a `^`. This extends to multiple levels: `^^^foo` means the fourth most innermost instance of `foo`.
8077
81−> `++jo` in `zuse` is a useful library for parsing complex json
82−> into hoon structures. In this case, the `:` between `so` and
83−> `jo` means 'inside of', because `so` is an arm contained within
84−> the core `jo`. Our case is actually simple enough that the
85−> `?>` line could have been `?> =([%s 'click'] jon)`.
78+> `dejs-soft:format` in `zuse` is a useful library for parsing complex json into hoon structures. In this case, the `:` between `dejs-soft` and `format` means 'inside of', because `dejs-soft` is an arm contained within the core `format`. Our case is actually simple enough that the `?>` line could have been `?> =([%s 'click'] jon)`.
8679
87−We can test this mark from the command line (don't forget to start your app with `|start %examples-click`)
80+We can test this mark from the command line (don't forget to start your app with `|start %click`)
8881
8982```
90−~fintud-macrep:dojo> &examples-click-click %click
83+~fintud-macrep:dojo> &click %click
9184%click
92−~fintud-macrep:dojo> &examples-click-click &json [%s 'click']
85+
86+~fintud-macrep:dojo> &click &json [%s 'click']
9387%click
94−~fintud-macrep:dojo> &examples-click-click &json &mime [/text/json (taco '"click"')]
88+
89+~fintud-macrep:dojo> &click &json &mime [/text/json (as-octs:mimes:html '"click"')]
9590%click
96−~fintud-macrep:dojo> &examples-click-click &json &mime [/text/json (taco '"clickety"')]
91+
92+~fintud-macrep:dojo> &click &json &mime [/text/json (as-octs:mimes:html '"clickety"')]
9793/~fintud-macrep/home/0/mar/click:<[7 5].[8 11]>
9894ford: casting %json to %click
9995ford: cast %click
10096```
10197
102−And `/mar/examples/click/clicks.hoon`:
98+And save the following as `/mar/clicks.hoon`:
10399
104100```
105101|_ clicks=@
102+++ grab
103+ |%
104+ ++ noun @
105+ --
106106++ grow
107107 |%
108108 ++ json
109− (joba %clicks (jone clicks))
109+ (frond:enjs:format %clicks (numb:enjs:format clicks))
110110 --
111111--
112112```
113113
114−`examples-clicks-clicks` is just an atom. We convert to json by creating an
114+`clicks` is just an atom. We convert to json by creating an
115115object with a single field "clicks" with our value.
116116
117−> Be sure to checkout section 3bD, JSON and XML, in zuse.hoon
118−> `++joba` is just a function that takes a key-value pair and
119−> produces a JSON object with one element.
117+> Be sure to check out section 3bD, JSON and XML, in zuse.hoon `frond:enjs:format` is just a function that takes a key-value pair and produces a JSON object with one element.
120118
121119```
122−~fintud-macrep:dojo> &json &examples-click-clicks 6
120+~fintud-macrep:dojo> &json &clicks 6
123121[%o p={[p='clicks' q=[%n p=~.6]]}]
124122```
125123
@@ -128,26 +126,26 @@ above. Everything should be pretty straightforward. Let's poke
128126the app from the command line.
129127
130128```
131−~fintud-macrep:dojo> |start %examples-click
129+~fintud-macrep:dojo> |start %click
132130>=
133−~fintud-macrep:dojo> :examples-click &examples-click-click %click
131+~fintud-macrep:dojo> :click &click %click
134132[%poked 1]
135133>=
136−~fintud-macrep:dojo> :examples-click &examples-click-click %click
134+~fintud-macrep:dojo> :click &click %click
137135[%poked 2]
138136>=
139137```
140138
141−Please pardon the awkwardness of the name 'examples-click-click', but we used it to stay true to our examples naming convention.
142−
143139*Exercise*:
144140
145−- Modify `:sink` from the subcriptions chapter to listen to `:click` and print out the subscription updates on the command line.
141+- Modify `:sink` from the subscriptions chapter to listen to `:click` and print out the subscription updates on the command line.
146142
147143# Frontend
148144
145+> Note: the instructions below are outdated and do not work in the current version of Urbit. Feel free to experiment though.
146+
149147That's all that's needed for the back end. The front end is just
150−some "sail" html (Hoon markup for XML) and javascript. Here's `/web/pages/examples/click.hoon`:
148+some "sail" html (Hoon markup for XML) and javascript. Here's `/web/pages/click.hoon`:
151149
152150```
153151;html
@@ -162,7 +160,7 @@ some "sail" html (Hoon markup for XML) and javascript. Here's `/web/pages/examp
162160 ;div#err(class "disabled");
163161 ;div#clicks;
164162 ==
165− ;script(type "text/javascript", src "/pages/examples/click/click.js");
163+ ;script(type "text/javascript", src "/pages/click/click.js");
166164 ==
167165==
168166```
@@ -171,12 +169,12 @@ You should recognize the sail syntax from an earlier chapter.
171169Aside from jquery, we also include `urb.js`, which is a framework
172170for interacting with urbit.
173171
174−To view the frontend, point your browser at `ship-name.urbit.org/~~/pages/examples/click` if you're on the live network. If you're running a fake galaxy, navigate to whatever port it's running on, which is usually: `https://localhost:8443/~~/pages/examples/click`.
172+To view the frontend, point your browser at `ship-name.urbit.org/~~/pages/click` if you're on the live network. If you're running a fake galaxy, navigate to whatever port it's running on, which is usually: `https://localhost:8443/~~/pages/click`.
175173
176174We have a button labeled "Poke!" and a div with id `clicks` where
177175we'll put the number of clicks. We also include a small
178176javascript file where the client-side application logic can be
179−found. It's in `/web/pages/examples/click/click.js`:
177+found. It's in `/web/pages/click.js`:
180178
181179```
182180$(function() {
@@ -189,7 +187,7 @@ $(function() {
189187 $go.on("click",
190188 function() {
191189 window.urb.send(
192− "click", {mark: "examples-click-click"}
190+ "click", {mark: "click-click"}
193191 ,function(err,res) {
194192 if(err)
195193 return $err.text("There was an error. Sorry!")
@@ -202,7 +200,7 @@ $(function() {
202200 })
203201 })
204202
205− window.urb.appl = "examples-click"
203+ window.urb.appl = "click"
206204 window.urb.bind('/the-path',
207205 function(err,dat) {
208206 clicks = dat.data.clicks