From f572cabe7526f6e59cba621c505b6ecf89f984b9 Mon Sep 17 00:00:00 2001 From: "C. Guy Yarvin" Date: Wed, 30 Jul 2014 21:28:48 -0700 Subject: [PATCH] Clean up some markdown stuff. --- arvo/ford.hoon | 2 +- main/pro/down/core.hoon | 94 +++++++++++++++---------------- main/sur/markdown/.gate.hoon.swp | Bin 12288 -> 12288 bytes main/sur/markdown/gate.hoon | 39 +++++++------ 4 files changed, 67 insertions(+), 68 deletions(-) diff --git a/arvo/ford.hoon b/arvo/ford.hoon index f42c768e2..7d1f9302e 100644 --- a/arvo/ford.hoon +++ b/arvo/ford.hoon @@ -40,7 +40,7 @@ [%man p=(map term horn)] :: /* map by hand [%nap p=horn] :: /% map by @tas [%now p=horn] :: /& map by @da - [%saw p=twig q=horn] :: /_ operate on + [%saw p=twig q=horn] :: /_ operate on /; [%see p=beam q=horn] :: /. relative to [%sic p=tile q=horn] :: /^ cast [%toy p=mark] :: /mark/ static diff --git a/main/pro/down/core.hoon b/main/pro/down/core.hoon index 5b2f4359f..35cee7750 100644 --- a/main/pro/down/core.hoon +++ b/main/pro/down/core.hoon @@ -4,8 +4,8 @@ /? 314 /- markdown =+ markdown - :: -:::: compute +!: +:::: :: |_ don=down ++ grab :: convert from @@ -27,23 +27,23 @@ %- some :_ [p.sep ~] (turn p.u.q.sep |=(a=tape (scan a blos))) :: - ++ base %+ stag %para + ++ base %+ stag %par ;~ plug - (stag %text (plus ;~(pose prn eol))) + (stag %tex (plus ;~(pose prn eol))) (easy ~) == :: ++ blos :: block element - %+ knee *bloc |. ~+ + %+ knee *barb |. ~+ ;~ pose head quot lasd horz code codf html para base == :: - ++ brek (stag %brek (cold ~ ;~(plug fas fas))) :: line break - ++ chrd ;~(pose escp prn (cold ' ' eol)) :: span character data + ++ brek (stag %cut (cold ~ ;~(plug fas fas))) :: line break + ++ chrd ;~(pose escp prn (cold ' ' eol)) :: shin character data ++ code :: code block - %+ stag %code + %+ stag %pre %- full %- plus ;~ pfix (stun [4 4] ace) @@ -55,7 +55,7 @@ == :: ++ codf :: fenced code block - %+ stag %code + %+ stag %pre %- full %+ ifix [;~(plug tec tec tec eol) ;~(plug tec tec tec)] @@ -66,8 +66,8 @@ (full (plus ;~(less ;~(plug tec tec tec) prn))) == :: - ++ cods :: code span - %+ stag %cods + ++ cods :: code shin + %+ stag %cod =+ chx=;~(pose (cold ' ' eol) prn) ;~ pose %+ ifix [(jest '```') (jest '```')] @@ -82,7 +82,7 @@ ;~(plug sig sig) ;~(plug fas fas) == - ++ spas :: all span elements + ++ spas :: all shin elements |* res=_rule %- plus ;~ pose emph stri link @@ -91,8 +91,8 @@ :: ++ eol (just `@`10) :: newline ++ emph :: emphasis - %+ knee *spel |. ~+ - %+ stag %emph + %+ knee *shin |. ~+ + %+ stag %emp =+ inn=(plus ;~(pose cods stri link (text fail))) ;~ pose (ifix [(jest '***') (jest '***')] (stag %both inn)) @@ -103,8 +103,8 @@ (ifix [(jest '___') (jest '___')] (stag %both inn)) (ifix [(jest '**') (jest '**')] (stag %bold inn)) (ifix [(jest '__') (jest '__')] (stag %bold inn)) - (ifix [tar tar] (stag %ital inn)) - (ifix [cab cab] (stag %ital inn)) + (ifix [tar tar] (stag %bent inn)) + (ifix [cab cab] (stag %bent inn)) == :: ++ escp :: escapable chars @@ -122,7 +122,7 @@ == :: ++ head :: header - %+ stag %head + %+ stag %had =+ ^= hed ;~ pose ;~ plug @@ -152,7 +152,7 @@ == :: ++ horz :: horizontal rule - %+ stag %horz + %+ stag %hot %+ cold ~ %- full ;~ pose @@ -161,9 +161,9 @@ ;~(plug (stun [0 3] ace) cab wits cab wits cab (star ;~(pose cab wite))) == :: - ++ html (stag %html apex:xmlp) :: html bloc + ++ html (stag %hem apex:xmlp) :: html barb ++ lasd :: top level list - %+ stag %list + %+ stag %lit %- full ;~ pose (stag & (lisd ;~(plug (star nud) dot))) @@ -179,7 +179,7 @@ =+ chx=;~(plug (plus prn) (cold "\0a" eol)) =- ?~ q.pre pre :- p.pre %- some - [(turn `wall`p.u.q.pre |=(a=tape [%lise (scan a apex)])) [p.pre ~]] + [(turn `wall`p.u.q.pre |=(a=tape [%lie (scan a apex)])) [p.pre ~]] ^= pre %. tub %+ most ;~(pose ;~(plug wits eol) (easy ~)) %+ cook |=(a=wall `tape`(zing a)) :: XX core dump w/o cast @@ -198,8 +198,8 @@ == :: ++ link :: link element - %+ knee *spel |. ~+ - %+ stag %link + %+ knee *shin |. ~+ + %+ stag %lin ;~ plug (ifix [sel ser] (plus ;~(pose emph stri cods (text ser)))) ;~ pose @@ -213,9 +213,9 @@ == == :: - ++ para (stag %para (full (spas fail))) :: paragraph + ++ para (stag %par (full (spas fail))) :: paragraph ++ quot :: blockquotes - %+ stag %quot + %+ stag %quo %- full |= tub=nail ^- (like down) @@ -232,7 +232,7 @@ == == :: - ++ sepa :: separate blocs + ++ sepa :: separate barbs %+ knee *wall |. ~+ =+ lin=;~(plug eol wits eol) %+ ifix [(star whit) (star whit)] @@ -269,11 +269,11 @@ == :: ++ stri :: strikethrough text - %+ stag %stri + %+ stag %ike %+ ifix [(jest '~~') (jest '~~')] (plus ;~(pose emph cods link (text fail))) :: - ++ text |*(res=_rule (stag %text (plus ;~(less ;~(pose res dont) chrd)))) + ++ text |*(res=_rule (stag %tex (plus ;~(less ;~(pose res dont) chrd)))) ++ whit (mask ~[`@`0x20 `@`0x9 `@`0xa]) :: whitespace w/nl ++ wite (mask ~[`@`0x20 `@`0x9]) :: whitespace ++ wits (star wite) @@ -287,7 +287,7 @@ :: ++ grow :: convert into |% - ++ html :: convert into %html + ++ html :: convert into %heml =< :(appd '' (abet don) '') |% ++ abet @@ -297,37 +297,37 @@ ^- @ (cat 3 p q) :: - ++ apex |=(don=down (turn don |=(bol=bloc (blok bol)))) + ++ apex |=(don=down (turn don |=(bol=barb (blok bol)))) ++ blok - |= bol=bloc + |= bol=barb ^- manx ?- bol - [%head *] + [%had *] :_ (turn q.bol sank) [(cat 3 'h' (scot %ud p.bol)) ?~(r.bol ~ [[%id u.r.bol] ~])] - [%para *] [[%p ~] (turn p.bol sank)] - [%horz *] [[%hr ~] ~] - [%code *] [[%pre ~] ~[[[%$ [[%$ (zing p.bol)] ~]] ~]]] - [%quot *] [[%blockquote ~] (apex p.bol)] - [%lise *] [[%li ~] (apex p.bol)] - [%list *] ?: =(& p.bol) [[%ol ~] (apex q.bol)] + [%par *] [[%p ~] (turn p.bol sank)] + [%hot *] [[%hr ~] ~] + [%pre *] [[%pre ~] ~[[[%$ [[%$ (zing p.bol)] ~]] ~]]] + [%quo *] [[%blockquote ~] (apex p.bol)] + [%lie *] [[%li ~] (apex p.bol)] + [%lit *] ?: =(& p.bol) [[%ol ~] (apex q.bol)] [[%ul ~] (apex q.bol)] - [%html *] p.bol + [%hem *] p.bol == :: ++ sank - |= san=spel + |= san=shin ^- manx ?- san - [%text *] [[%$ [[%$ p.san] ~]] ~] - [%brek *] [[%br ~] ~] - [%stri *] [[%del ~] (turn p.san ..$)] - [%cods *] [[%code ~] ~[[[%$ [[%$ p.san] ~]] ~]]] - [%emph *] - ?: =(%ital p.san) [[%em ~] (turn q.san ..$)] + [%tex *] [[%$ [[%$ p.san] ~]] ~] + [%cut *] [[%br ~] ~] + [%ike *] [[%del ~] (turn p.san ..$)] + [%cod *] [[%pre ~] ~[[[%$ [[%$ p.san] ~]] ~]]] + [%emp *] + ?: =(%bent p.san) [[%em ~] (turn q.san ..$)] ?: =(%bold p.san) [[%strong ~] (turn q.san ..$)] [[%em ~] ~[[[%strong ~] (turn q.san ..$)]]] - [%link *] + [%lin *] ?~ r.san [[%a ~[[%href q.san]]] (turn p.san ..$)] [[%a ~[[%href q.san] [%title u.r.san]]] (turn p.san ..$)] == diff --git a/main/sur/markdown/.gate.hoon.swp b/main/sur/markdown/.gate.hoon.swp index 1a4a861022a06e6e2b9824c585a7cb9ef83165e5..b50dec50b07d73c2a671de5b984164a2fec4faa6 100644 GIT binary patch literal 12288 zcmeI2&ui2`6vy9s@SwJe#iKC(2(+}@R4b?ps~)@vih}56@i0lIo3N8iI+<~6krwMHS z$WM8a`GwVZqI;3*XMUF(u^KCNbQFipOwWkGF(+WnM)TGjtY5#j=15$*e2Fcbe|F5F zQ2IoG2oM1xKm>>Y5g-CY;CK-*c>{Ja111FhD)Zc9FvYkib173+p14GHmSt-w2J`^N;u}OgzwpC^2Pbr zJ6&cLiQL31Si+fc``cGo5|yPKa2>epXKAA{IbJM4UNo(8 zZ4N96OVgyk=`qKxvzN2o?fPvuO17MqwKuI=x$oUECa|NQ5DV!(@sVs%kYGP*5l+QL zDc#xOn68P-x<8f?56K=mT)b&Y_m{04GqX@lma;$2r7tn0N5!n((@?P2zAZM2Q=JA8 NC(xze@A9fgJ^{Wmsl5OI diff --git a/main/sur/markdown/gate.hoon b/main/sur/markdown/gate.hoon index b708fe572..53d35cf23 100644 --- a/main/sur/markdown/gate.hoon +++ b/main/sur/markdown/gate.hoon @@ -1,22 +1,21 @@ |% -++ down (list bloc) :: markdown structure -++ bloc :: block elements - $% [%head p=@ud q=(list span) r=(unit tape)] :: depth, contents, id - [%para p=(list span)] :: paragraph - [%lise p=down] :: list element - [%list p=? q=down] :: - [%quot p=down] - [%horz ~] - [%code p=wall] ::
-      [%html p=manx]
-  ==
-::
-++  span                                                ::  span elements
-  $%  [%text p=tape] 
-      [%emph p=term q=(list span)]
-      [%stri p=(list span)]
-      [%brek ~]
-      [%link p=(list span) q=tape r=(unit tape)]
-      [%cods p=tape]                                    ::  
-  ==
+++  down  (list barb)                                   ::  markdown structure
+++  barb                                                ::  block elements
+  $%  [%had p=@ud q=(list shin) r=(unit tape)]          ::  depth, contents, id
+      [%hem p=manx]                                     ::  html tag
+      [%hot ~]                                          ::  horizontal rule
+      [%lie p=down]                                     ::  list element
+      [%lit p=? q=down]                                 ::  list
+      [%par p=(list shin)]                              ::  paragraph
+      [%pre p=wall]                                     ::  preformatted text
+      [%quo p=down]                                     ::  blockquote
+  ==                                                    ::
+++  shin                                                ::  span elements
+  $%  [%cod p=tape]                                     ::  inline code
+      [%cut ~]                                          ::  break
+      [%emp p=?(%bent %bold %both) q=(list shin)]       ::  emphasis
+      [%ike p=(list shin)]                              ::  strikethrough
+      [%lin p=(list shin) q=tape r=(unit tape)]         ::  link
+      [%tex p=tape]                                     ::  text
+  ==                                                    ::
 --