on master help sign in
change ford headers, remove deprecated rune (#688)
23d6dfapoprox
tutorials/arvo/ford.md+17−22
@@ -111,7 +111,7 @@ One of the most common ways to use ford is through ford's runes, all of which be
111
111
112Another common use case is assembling and rendering markdown templates into a single HTML file, to be sent as an HTTP response in urbit's web server `%eyre`. It's important to keep in mind that %ford is quite flexible and generic, and is used in other parts of urbit -- such as the dojo -- that would not traditionally fall under the purview of a build system.
112Another common use case is assembling and rendering markdown templates into a single HTML file, to be sent as an HTTP response in urbit's web server `%eyre`. It's important to keep in mind that %ford is quite flexible and generic, and is used in other parts of urbit -- such as the dojo -- that would not traditionally fall under the purview of a build system.
113
113
114−### `/+` import from lib/
114+### `/+` "faslus"
115
115
116The `/+` rune accepts a filename as an argument. It interprets that filename
116The `/+` rune accepts a filename as an argument. It interprets that filename
117as a hoon source file within the `lib` directory. This is how we import a shared
117as a hoon source file within the `lib` directory. This is how we import a shared
@@ -162,7 +162,7 @@ Example:
162
162
163will load the `hep-to-cab` library from `~zod` at `%clay` revision `4`.
163will load the `hep-to-cab` library from `~zod` at `%clay` revision `4`.
164
164
165−### `/-` import from sur/
165+### `/-` "fashep"
166
166
167The `/-` rune accepts a filename as an argument. It interprets that filename as
167The `/-` rune accepts a filename as an argument. It interprets that filename as
168a hoon source file within the `sur` directory. The `sur` directory contains
168a hoon source file within the `sur` directory. The `sur` directory contains
@@ -183,7 +183,7 @@ produces: `0v0`
183arguments can be specified. See the `/+` docs for more details about the syntax
183arguments can be specified. See the `/+` docs for more details about the syntax
184for those features.
184for those features.
185
185
186−### `/~` twig by hand
186+### `/~` "fassig"
187
187
188`/~ <twig>` produces a "horn" that evaluates a twig and places the product in
188`/~ <twig>` produces a "horn" that evaluates a twig and places the product in
189the subject. Arbitrary hoon can be in the twig. A
189the subject. Arbitrary hoon can be in the twig. A
@@ -212,7 +212,7 @@ produces: `%something`
212```
212```
213produces: `[%a %b]`
213produces: `[%a %b]`
214
214
215−### `//` include a file by relative path
215+### `//` "fasfas"
216
216
217`// <rel-path>` parses `rel-path` as a hoon twig, and then adds the resulting
217`// <rel-path>` parses `rel-path` as a hoon twig, and then adds the resulting
218twig to the subject. Note that the result type of this rune is not a horn, but
218twig to the subject. Note that the result type of this rune is not a horn, but
@@ -240,7 +240,7 @@ directories the way unix filesystems do. Whereas in unix, a directory is a
240special kind of file, in %clay it's just a path prefix, and there is no file
240special kind of file, in %clay it's just a path prefix, and there is no file
241stored at that path._
241stored at that path._
242
242
243−### `/=` wrap a face around an included horn
243+### `/=` "fastis"
244
244
245`/=` runs a horn (usually produced by another ford rune), takes the result of
245`/=` runs a horn (usually produced by another ford rune), takes the result of
246that horn, and wraps a face around it.
246that horn, and wraps a face around it.
@@ -255,7 +255,7 @@ produces: `[0 1]`
255
255
256In wide-form, `/=` uses `=` as a delimiter: `/=foo=/~[a=0 b=1]`
256In wide-form, `/=` uses `=` as a delimiter: `/=foo=/~[a=0 b=1]`
257
257
258−### `/:` evaluate at path, and `/<mark>/` render mark at current path
258+### `/:` "fascol"
259
259
260`/:` takes a path and a horn, and evaluates the horn with the current path set to the supplied path.
260`/:` takes a path and a horn, and evaluates the horn with the current path set to the supplied path.
261`/mar/` renders the mark 'mar' at the current path.
261`/mar/` renders the mark 'mar' at the current path.
@@ -292,7 +292,7 @@ and the HTML itself.
292
292
293In wide-form, `/:` uses `:` as a delimiter: `/=page=/:/path/to/html/file:/mime/`
293In wide-form, `/:` uses `:` as a delimiter: `/=page=/:/path/to/html/file:/mime/`
294
294
295−### `/!mark/` evaluate as hoon, then pass through mark
295+### `/!mark/` "faszap"
296
296
297Example:
297Example:
298```hoon
298```hoon
@@ -305,7 +305,7 @@ mime
305```
305```
306produces: `[[%text %plain ~] 15 'produces-a-cord']`
306produces: `[[%text %plain ~] 15 'produces-a-cord']`
307
307
308−### `/&` pass through a series of marks
308+### `/&` "faspam"
309
309
310`/&` passes a horn through multiple marks, right-to-left. It has both a
310`/&` passes a horn through multiple marks, right-to-left. It has both a
311wide-form and a tall-form syntax. In wide-form, it takes a series of mark
311wide-form and a tall-form syntax. In wide-form, it takes a series of mark
@@ -349,7 +349,7 @@ just a mark: `/&c&b&/:path:/mark/`
349Tall-form `/&` takes only two arguments: a mark and a horn. The mark does not
349Tall-form `/&` takes only two arguments: a mark and a horn. The mark does not
350need to be enclosed in `/`'s: `/& html /elem/`
350need to be enclosed in `/`'s: `/& html /elem/`
351
351
352−### `/|` short-circuiting 'or'
352+### `/|` "fasbar"
353
353
354`/|` takes a series of horns and produces the first one (left-to-right) that
354`/|` takes a series of horns and produces the first one (left-to-right) that
355succeeds. If none succeed, it produces stack traces from all of its arguments.
355succeeds. If none succeed, it produces stack traces from all of its arguments.
@@ -374,7 +374,7 @@ file as hoon to be evaluated.
374Wide-form `/|` encloses its arguments in parentheses, with a single space as a delimiter:
374Wide-form `/|` encloses its arguments in parentheses, with a single space as a delimiter:
375`/|(/!elem/ /elem/)`
375`/|(/!elem/ /elem/)`
376
376
377−### `/_` unfiltered: run a horn on each file in the current directory
377+### `/_` "fascab"
378
378
379`/_` can be used in two ways: filtered and unfiltered.
379`/_` can be used in two ways: filtered and unfiltered.
380
380
@@ -418,7 +418,7 @@ to a cord of markdown-formatted text.
418
418
419Wide-form filtered `/_` uses `_` as a delimiter: `/= timed-posts /_@da_/md/`
419Wide-form filtered `/_` uses `_` as a delimiter: `/= timed-posts /_@da_/md/`
420
420
421−### `/;` operate on
421+### `/;` "fasmic"
422
422
423`/;` takes a twig and a horn. The twig should evaluate to a gate, which is then slammed
423`/;` takes a twig and a horn. The twig should evaluate to a gate, which is then slammed
424with the result of the horn as its sample.
424with the result of the horn as its sample.
@@ -444,7 +444,7 @@ file-length
444```
444```
445produces the number of bytes in the file "/%/path/to/hoon/file."
445produces the number of bytes in the file "/%/path/to/hoon/file."
446
446
447−### `/,` switch by path
447+### `/,` "fascom"
448
448
449`/,` is a switch statement, which picks a branch to evaluate based on
449`/,` is a switch statement, which picks a branch to evaluate based on
450whether the current path matches the path in the switch statement.
450whether the current path matches the path in the switch statement.
@@ -465,7 +465,7 @@ Example:
465
465
466produces: `'evaluate-me'`
466produces: `'evaluate-me'`
467
467
468−### `/.` list
468+### `/.` "fasdot"
469
469
470Produce a null-terminated list from a sequence of horns, terminated by a `==`. No wide-form.
470Produce a null-terminated list from a sequence of horns, terminated by a `==`. No wide-form.
471
471
@@ -486,12 +486,7 @@ vanes
486```
486```
487produces: `[%ames %behn %clay %dill %eyre %ford %gall ~]`.
487produces: `[%ames %behn %clay %dill %eyre %ford %gall ~]`.
488
488
489−### `/*` heterogeneous map
489+### `/^` "fasket"
490−
491−_DEPRECATED_
492−TODO: remove
493−
494−### `/^` cast
495
490
496`/^` takes a mold and a horn, and casts the result of the horn to the mold.
491`/^` takes a mold and a horn, and casts the result of the horn to the mold.
497
492
@@ -510,7 +505,7 @@ Without the cast, we wouldn't be able to access the 'i' face of the list.
510
505
511Wide-form `/^` uses `^` as a delimiter: `/^(list @)^/~[1 2 3 ~]`
506Wide-form `/^` uses `^` as a delimiter: `/^(list @)^/~[1 2 3 ~]`
512
507
513−### `/#` insert dephash
508+### `/#` "fashax"
514
509
515`/#` takes a horn and produces a cell of the dependency
510`/#` takes a horn and produces a cell of the dependency
516hash of the result of the horn, and the result itself.
511hash of the result of the horn, and the result itself.
@@ -531,7 +526,7 @@ This pattern is used in urbit's `tree` web publishing system.
531Wide-form `/#` does not need a delimiter:
526Wide-form `/#` does not need a delimiter:
532`/= inline /^ {dep/@uvH txt/@t} /#/:/%/my-script:/js/`
527`/= inline /^ {dep/@uvH txt/@t} /#/:/%/my-script:/js/`
533
528
534−### `/$` process extra arguments
529+### `/$` "fasbuc"
535
530
536`/$` will slam a gate on whatever extra arguments have been supplied to this build.
531`/$` will slam a gate on whatever extra arguments have been supplied to this build.
537At the moment, only HTTP requests forwarded by `%eyre` contain any extra arguments,
532At the moment, only HTTP requests forwarded by `%eyre` contain any extra arguments,
@@ -554,7 +549,7 @@ produces: [%who '~zod' %where /ford/pages/web %case 60]
554Wide-form `/$` takes its arguments inside brackets, like `/~`:
549Wide-form `/$` takes its arguments inside brackets, like `/~`:
555`/=gas=/$[fuel:html]`
550`/=gas=/$[fuel:html]`
556
551
557−### `/%` propagate extra arguments into renderers
552+### `/%` "fascen"
558
553
559`/%` will forward extra arguments (usually from `%eyre`) on to any enclosed `/renderer/`'s. Without this,
554`/%` will forward extra arguments (usually from `%eyre`) on to any enclosed `/renderer/`'s. Without this,
560renderers that use `/$` to read the extra arguments will crash.
555renderers that use `/$` to read the extra arguments will crash.