summaryrefslogtreecommitdiff
path: root/mar
diff options
context:
space:
mode:
Diffstat (limited to 'mar')
-rw-r--r--mar/bill.hoon34
-rw-r--r--mar/hoon.hoon36
-rw-r--r--mar/kelvin.hoon28
-rw-r--r--mar/mime.hoon32
-rw-r--r--mar/noun.hoon22
-rw-r--r--mar/ship.hoon20
6 files changed, 172 insertions, 0 deletions
diff --git a/mar/bill.hoon b/mar/bill.hoon
new file mode 100644
index 0000000..76cef34
--- /dev/null
+++ b/mar/bill.hoon
@@ -0,0 +1,34 @@
+|_ bil=(list dude:gall)
+++ grow
+ |%
+ ++ mime `^mime`[/text/x-bill (as-octs:mimes:html hoon)]
+ ++ noun bil
+ ++ hoon
+ ^- @t
+ |^ (crip (of-wall:format (wrap-lines (spit-duz bil))))
+ ::
+ ++ wrap-lines
+ |= taz=wall
+ ^- wall
+ ?~ taz ["~"]~
+ :- (weld ":~ " i.taz)
+ %- snoc :_ "=="
+ (turn t.taz |=(t=tape (weld " " t)))
+ ::
+ ++ spit-duz
+ |= duz=(list dude:gall)
+ ^- wall
+ (turn duz |=(=dude:gall ['%' (trip dude)]))
+ --
+ ++ txt (to-wain:format hoon)
+ --
+++ grab
+ |%
+ ++ noun (list dude:gall)
+ ++ mime
+ |= [=mite len=@ud tex=@]
+ ~_ tex
+ !<((list dude:gall) (slap !>(~) (ream tex)))
+ --
+++ grad %noun
+--
diff --git a/mar/hoon.hoon b/mar/hoon.hoon
new file mode 100644
index 0000000..428e105
--- /dev/null
+++ b/mar/hoon.hoon
@@ -0,0 +1,36 @@
+:::: /hoon/hoon/mar
+ ::
+/? 310
+::
+=, eyre
+|_ own=@t
+::
+++ grow :: convert to
+ |%
+ ++ mime `^mime`[/text/x-hoon (as-octs:mimes:html own)] :: convert to %mime
+ ++ hymn
+ ;html
+ ;head
+ ;title:"Source"
+ ;script@"//cdnjs.cloudflare.com/ajax/libs/codemirror/4.3.0/codemirror.js";
+ ;script@"/lib/syntax/hoon.js";
+ ;link(rel "stylesheet", href "//cdnjs.cloudflare.com/ajax/libs/".
+ "codemirror/4.3.0/codemirror.min.css");
+ ;link/"/lib/syntax/codemirror.css"(rel "stylesheet");
+ ==
+ ;body
+ ;textarea#src:"{(trip own)}"
+ ;script:'CodeMirror.fromTextArea(src, {lineNumbers:true, readOnly:true})'
+ ==
+ ==
+ ++ txt
+ (to-wain:format own)
+ --
+++ grab
+ |% :: convert from
+ ++ mime |=([p=mite q=octs] q.q)
+ ++ noun @t :: clam from %noun
+ ++ txt of-wain:format
+ --
+++ grad %txt
+--
diff --git a/mar/kelvin.hoon b/mar/kelvin.hoon
new file mode 100644
index 0000000..7f1b409
--- /dev/null
+++ b/mar/kelvin.hoon
@@ -0,0 +1,28 @@
+|_ kal=waft:clay
+++ grow
+ |%
+ ++ mime `^mime`[/text/x-kelvin (as-octs:mimes:html hoon)]
+ ++ noun kal
+ ++ hoon
+ %+ rap 3
+ %+ turn
+ %+ sort
+ ~(tap in (waft-to-wefts:clay kal))
+ |= [a=weft b=weft]
+ ?: =(lal.a lal.b)
+ (gte num.a num.b)
+ (gte lal.a lal.b)
+ |= =weft
+ (rap 3 '[%' (scot %tas lal.weft) ' ' (scot %ud num.weft) ']\0a' ~)
+ ::
+ ++ txt (to-wain:format hoon)
+ --
+++ grab
+ |%
+ ++ noun waft:clay
+ ++ mime
+ |= [=mite len=@ud tex=@]
+ (cord-to-waft:clay tex)
+ --
+++ grad %noun
+--
diff --git a/mar/mime.hoon b/mar/mime.hoon
new file mode 100644
index 0000000..83b4dae
--- /dev/null
+++ b/mar/mime.hoon
@@ -0,0 +1,32 @@
+::
+:::: /hoon/mime/mar
+ ::
+/? 310
+::
+|_ own=mime
+++ grow
+ ^?
+ |%
+ ++ jam `@`q.q.own
+ --
+::
+++ grab :: convert from
+ ^?
+ |%
+ ++ noun mime :: clam from %noun
+ ++ tape
+ |=(a=_"" [/application/x-urb-unknown (as-octt:mimes:html a)])
+ --
+++ grad
+ ^?
+ |%
+ ++ form %mime
+ ++ diff |=(mime +<)
+ ++ pact |=(mime +<)
+ ++ join |=([mime mime] `(unit mime)`~)
+ ++ mash
+ |= [[ship desk mime] [ship desk mime]]
+ ^- mime
+ ~|(%mime-mash !!)
+ --
+--
diff --git a/mar/noun.hoon b/mar/noun.hoon
new file mode 100644
index 0000000..ff5443e
--- /dev/null
+++ b/mar/noun.hoon
@@ -0,0 +1,22 @@
+::
+:::: /hoon/noun/mar
+ ::
+/? 310
+!:
+:::: A minimal noun mark
+|_ non=*
+++ grab |%
+ ++ noun *
+ --
+++ grow |%
+ ++ mime [/application/x-urb-jam (as-octs:mimes:html (jam non))]
+ --
+++ grad
+ |%
+ ++ form %noun
+ ++ diff |=(* +<)
+ ++ pact |=(* +<)
+ ++ join |=([* *] *(unit *))
+ ++ mash |=([[ship desk *] [ship desk *]] `*`~|(%noun-mash !!))
+ --
+--
diff --git a/mar/ship.hoon b/mar/ship.hoon
new file mode 100644
index 0000000..176bcad
--- /dev/null
+++ b/mar/ship.hoon
@@ -0,0 +1,20 @@
+|_ s=ship
+++ grad %noun
+++ grow
+ |%
+ ++ noun s
+ ++ json s+(scot %p s)
+ ++ mime
+ ^- ^mime
+ [/text/x-ship (as-octt:mimes:html (scow %p s))]
+
+ --
+++ grab
+ |%
+ ++ noun ship
+ ++ json (su:dejs:format ;~(pfix sig fed:ag))
+ ++ mime
+ |= [=mite len=@ tex=@]
+ (slav %p (snag 0 (to-wain:format tex)))
+ --
+--