on master help sign in
/# docs
3466e08Ted Blackman
docs/arvo/internals/ford/runes.md+18
@@ -206,6 +206,24 @@ produces: `1`
206
206
207Without the cast, we wouldn't be able to access the 'i' face of the list.
207Without the cast, we wouldn't be able to access the 'i' face of the list.
208
208
209+### `/#` insert dephash
210+
211+`/#` takes a horn and produces a cell of the dependency
212+hash of the result of the horn, and the result itself.
213+
214+Example:
215+```
216+/= inline /^ {dep/@uvH txt/@t} /# /: /%/my-script /js/
217+::
218+;= ;script: (trip txt.inline) :: set script contents
219+ ;script@"/~/on/{<dep.inline>}.js"; :: set script src
220+==
221+```
222+produces two `<script>` tags. The first has its contents set to the contents
223+of the JavaScript file we loaded from clay. The second is an auto-update
224+script that polls the server to check whether the dependency hash has changed.
225+This pattern is used in urbit's `tree` web publishing system.
226+
209### `/+` import from lib/
227### `/+` import from lib/
210
228
211The `/+` rune accepts a filename as an argument. It interprets that filename
229The `/+` rune accepts a filename as an argument. It interprets that filename