urbit/pub/doc/tree.md

35 lines
1.2 KiB
Markdown
Raw Normal View History

2015-08-04 04:37:19 +03:00
# Tree
2015-08-04 02:49:34 +03:00
`:tree` is the web filesystem interface.
2015-08-05 05:09:58 +03:00
# Data retrieval interface
Async provides loading by schema
`{path name sein sibs next prev}` are all immediately accesible from the store
a `getPath` method, if present (defaulting to current url), is used to determine the query root node.
2015-08-04 02:49:34 +03:00
# Internals
2015-08-04 04:37:19 +03:00
something something coffeescript
2015-08-04 02:49:34 +03:00
## `/[desk]/tree/{path}.json`
tree/json.hook accepts a query string schema `q` in light noun encoding
2015-08-04 02:49:34 +03:00
++ schema (dict ,[term $|(mark schema)])
++ dict |*(a=_,* $&([a (dict a)] a))
which is normalized and type-checked to a `query` list of
2015-08-04 02:49:34 +03:00
- `[%kids query]`, the only recursive value, which executes for all subpaths
XX descent is only currently supported to a single level as a performance optimization
- `[%name %t]`, the node name
2015-08-06 02:48:34 +03:00
- `[%path %t]`, the current path
2015-08-04 02:49:34 +03:00
- `[%snip %r]`, a snippet, extracted via `react-snip-json`
2015-08-06 05:13:41 +03:00
- `[%head %r]`, the first `<h1/>`, extracted via `react-head-json`
2015-08-04 02:49:34 +03:00
- `[%body %r]`, the `react-json` body
- `[%meta %j]`, json frontmatter per the `mdy` mark definition
The request types above are `%t` text, `%r` html-derived tree, and `%j`
arbitrary json; an example query, used by the main content renderer, is
`"q=body.r__kids_name.t"` (`body:'r' kids:{name:'t'}` )