better links, tree fix

This commit is contained in:
Galen Wolfe-Pauly 2015-04-23 13:58:43 -07:00
parent 8dc26c3eb6
commit 6e76dc5ecb
17 changed files with 27 additions and 24 deletions

View File

@ -1734,7 +1734,7 @@ Produce a parsed daily time format from an atomic date.
Accept a [`++tarp`](), a parsed daily time, and produces a time atom,
`@d`.
`rip` is a [`++tarp`]().
`rip` is a [`++tarp`](/doc/hoon/library/1#++tarp).
~zod/try=> =murica (yell ~1776.7.4)
~zod/try=> murica

View File

@ -57,7 +57,7 @@ Grab value by key
Produces a list retrieved from jar `a` using the key `b`.
`a` is a [`++jar`]().
`a` is a [`++jar`](/doc/hoon/library/1#++jar).
`b` is a key of the same type as the keys in `a`.

View File

@ -417,7 +417,7 @@ Conditional `++cook`
Conditional [`++cook`](). Slams the result through a gate that produces
a unit; if that unit is empty, fail.
`tub` is a [`++nail`]()
`tub` is a [`++nail`](/doc/hoon/library/1#++nail)
~zod/try=> ((sear |=(a=* ?@(a (some a) ~)) (just `a`)) [[1 1] "abc"])
[p=[p=1 q=2] q=[~ u=[p=97 q=[p=[p=1 q=2] q="bc"]]]]

View File

@ -46,7 +46,7 @@ Parse backslash
++ bas (just '\\')
Parses ASCII character 92, the backslash. Note the extra `\` in the slam
of `bas` with [`++just`]() is to escape the escape character, `\`.
of `bas` with [`++just`](/doc/hoon/library/2ec#++just) is to escape the escape character, `\`.
~zod/try=> (scan "\\" bas)
~~~5c.

View File

@ -88,7 +88,7 @@ Escape special chars
[i.vib $(vib t.vib)]
::
Escape special characters, used in [`++show`]()
Escape special characters, used in [`++show`](/doc/hoon/library/2ez#++show)
`vib` is a [tape]().

View File

@ -10,7 +10,7 @@ Pretty-printing engine
Pretty-printing engine.
`tac` is a [`++tank`]().
`tac` is a [`++tank`](/doc/hoon/library/1#++tank).
/~zod/try=> ~(. re leaf/"ham")
<2.ghl [[%leaf ""] <414.gly 100.xkc 1.ypj %164>]>

View File

@ -1855,7 +1855,7 @@ Parse span to path
|= zep=@ta ^- path
(rash zep ;~(pfix fas ;~(sfix (more fas urs:ab) fas)))
Parsing rule. Parses a span `zep` to a static [`++path`]().
Parsing rule. Parses a span `zep` to a static [`++path`](/doc/hoon/library/1#++path).
~zod/try=> (stab '/as/lek/tor')
/as/lek/tor

View File

@ -244,7 +244,7 @@ Reverse lookup byte in 256 sub box
df4d.225e.2d56.7fd6.1395.a3f8.c582
(cut 3 [a 1] b)
The inverse of [`++zyft`](). Looks up a byte `a` in a substituion box
The inverse of [`++zyft`](/doc/hoon/library/2en#++zyft). Looks up a byte `a` in a substituion box
with 256 values, producing a byte.
`a` is an [atom]() of one byte in length.

View File

@ -433,7 +433,7 @@ Kicks a `++trap`, producing its result as a noun or the tanks of any
error that occurs. Similar to [`++mule`](), but preserves no type
information.
`taq` is a [`++trap`]().
`taq` is a [`++trap`](/doc/hoon/library/1#++trap).
~zod/try=> (mute |.(leaf/"hello"))
[%.y p=[1.717.658.988 104 101 108 108 111 0]]

View File

@ -194,7 +194,7 @@ Find common
?:((gth p.lef p.rig) lef rig)
::
Finds a subsequence of repeated elements within two [`++list`]()s,
Finds a subsequence of repeated elements within two [`++list`](/doc/hoon/library/1#++list)s,
producing a [\`++tape]().
~zod/try=> (locz "samukot" "semelkot")

View File

@ -346,7 +346,7 @@ Back-shifted leap second dates
::
Produces a list of absolute dates ([`@da`]()) that represent the Urbit
Galactc Time equivalents of the UTC leap second dates in [`++les`]().
Galactc Time equivalents of the UTC leap second dates in [`++les`](/doc/hoon/library/3bc#++les).
~zod/try=/hom> lef:yu
~[

View File

@ -1648,7 +1648,7 @@ Escape JSON character
==
::
Produces a `++tape` of an escaped [`++json`]() character `a`.
Produces a `++tape` of an escaped [`++json`](/doc/hoon/library/3bi#++json) character `a`.
`a` is an atom

View File

@ -257,7 +257,7 @@ Parse beam to path
^- path
[(scot %p p.bem) q.bem (scot r.bem) (flop s.bem)]
Parses a [`++beam`]() to a [`++path`]().
Parses a [`++beam`]() to a [`++path`](/doc/hoon/library/1#++path).
~zod/try=/zop> (tope [~zod %main ud/1] /hook/down/sur)
/~zod/main/1/sur/down/hook

View File

@ -386,7 +386,7 @@ Top-level URL parser
Toplevel URL parser.
`a` is a [`++cord`]().
`a` is a [`++cord`](/doc/hoon/library/1#++cord).
~zod/main=> (epur 'http://127.0.0.1/')
[~ [p=[p=%.n q=~ r=[%.n p=.127.0.0.1]] q=[p=~ q=<||>] r=~]]

View File

@ -36,14 +36,15 @@ module.exports = recl
setPath: (href,hist) ->
if hist isnt false then history.pushState {}, "", window.tree.basepath href
TreeActions.setCurr href
TreeActions.setCurr href.split("#")[0]
goTo: (path) ->
@toggleFocus false
$("html,body").animate {scrollTop:0}
frag = path.split("#")[0]
@setPath path
if not @checkPath path
TreeActions.getPath path
if not @checkPath frag
TreeActions.getPath frag
checkURL: ->
if @state.url isnt window.location.pathname

View File

@ -124,16 +124,18 @@ module.exports = recl({
if (hist !== false) {
history.pushState({}, "", window.tree.basepath(href));
}
return TreeActions.setCurr(href);
return TreeActions.setCurr(href.split("#")[0]);
},
goTo: function(path) {
var frag;
this.toggleFocus(false);
$("html,body").animate({
scrollTop: 0
});
frag = path.split("#")[0];
this.setPath(path);
if (!this.checkPath(path)) {
return TreeActions.getPath(path);
if (!this.checkPath(frag)) {
return TreeActions.getPath(frag);
}
},
checkURL: function() {

View File

@ -17,13 +17,13 @@
;head
;title: urbit Tree
;meta(name "viewport", content "width=device-width, initial-scale=1");
::;link(type "text/css", rel "stylesheet", href "/docs/pub/tree/src/css/main.css");
;link(type "text/css", rel "stylesheet", href "http://localhost:8000/docs/pub/tree/src/css/main.css");
;link(type "text/css", rel "stylesheet", href "/docs/pub/tree/src/css/main.css");
::;link(type "text/css", rel "stylesheet", href "http://localhost:8000/docs/pub/tree/src/css/main.css");
;script(type "text/javascript", src "//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js");
;script(type "text/javascript", src "//cdnjs.cloudflare.com/ajax/libs/lodash.js/2.4.1/lodash.min.js");
;script(type "text/javascript", src "//cdnjs.cloudflare.com/ajax/libs/react/0.12.2/react.js");
::;script(type "text/javascript", src "/docs/pub/tree/src/js/main.js");
;script(type "text/javascript", src "http://localhost:8000/docs/pub/tree/src/js/main.js");
;script(type "text/javascript", src "/docs/pub/tree/src/js/main.js");
::;script(type "text/javascript", src "http://localhost:8000/docs/pub/tree/src/js/main.js");
==
;body
;script(type "text/javascript"):"""