urbit/base/mar/hook/door.hook
2015-05-19 20:29:04 -07:00

55 lines
1.5 KiB
Plaintext

::
:::: /hook/door/hook/mar
::
/? 314
!:
|_ own=@t
::
++ grow :: convert to
|%
++ mime [/text/hoon (taco own)] :: convert to %mime
++ psal :: convert to %html
;div:(pre:"{(trip own)}")
:: =+ gen-id="src-{<`@ui`(mug own)>}"
:: ;div
:: ;textarea(id "{gen-id}"):"{(trip own)}"
:: ;script:"""
:: CodeMirror.fromTextArea(
:: window[{<gen-id>}],
:: \{lineNumbers:true, readOnly:true}
:: )
:: """
:: ==
++ hymn
:: ;html:(head:title:"Source" "+{psal}")
;html
;head
;title:"Source"
;script@"//cdnjs.cloudflare.com/ajax/libs/codemirror/4.3.0/codemirror.js";
;script@"/{(trip &2:%)}/lib/syntax/hoon.js";
;link(rel "stylesheet", href "//cdnjs.cloudflare.com/ajax/libs/".
"codemirror/4.3.0/codemirror.min.css");
;link/"/{(trip &2:%)}/lib/syntax/codemirror.css"(rel "stylesheet");
==
;body
;textarea#src:"{(trip own)}"
;script:'CodeMirror.fromTextArea(src, {lineNumbers:true, readOnly:true})'
==
==
++ txt (lore (cat 3 own '\0a'))
--
++ grab
|% :: convert from
++ mime |=([p=mite q=octs] q.q)
++ noun ,@t :: clam from %noun
++ txt
|= wan=wain
=+ (role wan)
(end 3 (dec (met 3 -)) -)
--
++ grad
|%
++ sted %txt
--
--