From a8dd15c34df9773263a68ee3822485c64316aedb Mon Sep 17 00:00:00 2001 From: Galen Wolfe-Pauly Date: Wed, 22 Apr 2015 17:43:52 -0700 Subject: [PATCH] a cleaner library --- docs/pub/doc/hoon/library.md | 4 +- docs/pub/doc/hoon/library/0.md | 2 +- docs/pub/doc/hoon/library/2ez.md | 4 +- .../src/js/components/ListComponent.coffee | 5 ++- docs/pub/tree/src/js/main.js | 45 +++++++++++-------- docs/pub/tree/src/js/stores/TreeStore.coffee | 4 +- docs/tree/hymn.hook | 6 ++- docs/tree/json.hook | 11 +++-- main/mar/react-snip/door.hook | 6 +++ 9 files changed, 55 insertions(+), 32 deletions(-) diff --git a/docs/pub/doc/hoon/library.md b/docs/pub/doc/hoon/library.md index 2820a2843..128db6dad 100644 --- a/docs/pub/doc/hoon/library.md +++ b/docs/pub/doc/hoon/library.md @@ -1,4 +1,4 @@ Library -======= +======== - + diff --git a/docs/pub/doc/hoon/library/0.md b/docs/pub/doc/hoon/library/0.md index 0345065d2..286ca83b6 100644 --- a/docs/pub/doc/hoon/library/0.md +++ b/docs/pub/doc/hoon/library/0.md @@ -1,4 +1,4 @@ -volume 0, Kelvin Versioning +volume 0, Kelvin Versioning. =========================== ### ++hoon diff --git a/docs/pub/doc/hoon/library/2ez.md b/docs/pub/doc/hoon/library/2ez.md index 93f2a68c6..9e8142dec 100644 --- a/docs/pub/doc/hoon/library/2ez.md +++ b/docs/pub/doc/hoon/library/2ez.md @@ -1,7 +1,5 @@ section 2eZ, OLD rendering --------------------------- - ------------------------------------------------------------------------- +========================== ### ++show diff --git a/docs/pub/tree/src/js/components/ListComponent.coffee b/docs/pub/tree/src/js/components/ListComponent.coffee index 3456bab77..d4ddbad11 100644 --- a/docs/pub/tree/src/js/components/ListComponent.coffee +++ b/docs/pub/tree/src/js/components/ListComponent.coffee @@ -45,7 +45,10 @@ module.exports = recl _path = @state.path+"/"+v if @props.dataPreview? c = "preview" - prev = @state.snip[_path] + if @props.titlesOnly + prev = @state.snip[_path].head + else + prev = @state.snip[_path] else c = "" prev = (h1 {},v) diff --git a/docs/pub/tree/src/js/main.js b/docs/pub/tree/src/js/main.js index 0f6a4d410..51afd8737 100644 --- a/docs/pub/tree/src/js/main.js +++ b/docs/pub/tree/src/js/main.js @@ -1,4 +1,4 @@ -(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o @mergePathToTree path,_.pluck(snip,"name") for k,v of snip - _snip[path+"/"+v.name] = window.tree.reactify v.body + _snip[path+"/"+v.name] = + head: window.tree.reactify v.body.head + body: window.tree.reactify v.body.body loadKids: (path,kids) -> @mergePathToTree path,_.pluck(kids,"name") diff --git a/docs/tree/hymn.hook b/docs/tree/hymn.hook index 66d785d8b..3cec27ac0 100644 --- a/docs/tree/hymn.hook +++ b/docs/tree/hymn.hook @@ -17,11 +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 "/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 "/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"):""" diff --git a/docs/tree/json.hook b/docs/tree/json.hook index d5abda64f..2d3e02d9b 100644 --- a/docs/tree/json.hook +++ b/docs/tree/json.hook @@ -8,9 +8,9 @@ /_ /react-js/ :: /= sal /: /=docs=/pub - /; |= a=(map ,@ta cord) a + /; |= a=(map ,@ta json) a /% 2 - /_ /react-snip-js/ + /_ /react-snip-json/ :: :::: :: @@ -23,6 +23,7 @@ :: ^- json =+ ~(. util gas) +:: .json?kids ?: (~(has by qix.gas) %kids) %+ joba %kids =. pal (~(del by pal) %md) :: XX haxor @@ -32,15 +33,17 @@ name/s/a body/s/b == +:: .json?snip ?: (~(has by qix.gas) %snip) %+ joba %snip =. sal (~(del by sal) %md) :: XX haxor =- [%a (turn (~(tap by sal)) -)] - |= [a=span b=cord] + |= [a=span b=json] %- jobe :~ name/s/a - body/s/b + body/b == +:: .json %- jobe :~ kids/[%a (turn get-kids |=(a=span s/a))] body/[%s ral] diff --git a/main/mar/react-snip/door.hook b/main/mar/react-snip/door.hook index 360368cba..561e3c881 100644 --- a/main/mar/react-snip/door.hook +++ b/main/mar/react-snip/door.hook @@ -53,6 +53,12 @@ ")" == ++ react-snip-js (crip tape) + ++ react-snip-json + ::?> ?=([[%div ~] [[%h1 ~] *] [[%div ~] *] ~]] own) :: xx mystery fish-loop + %^ jobe + head/(jape tape(own &2.own)) + body/(jape tape(own &3.own)) + ~ :: ++ js react-snip-js :: convert to %js ++ mime [/text/javascript (taco react-snip-js)] :: convert to %mime --