mirror of
https://github.com/urbit/shrub.git
synced 2024-12-06 06:38:24 +03:00
Clean up some markdown stuff.
This commit is contained in:
parent
9f78133295
commit
f572cabe75
@ -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
|
||||
|
@ -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 '<html><body>' (abet don) '</body></html>')
|
||||
|%
|
||||
++ 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 ..$)]
|
||||
==
|
||||
|
Binary file not shown.
@ -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] :: <pre>
|
||||
[%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] :: <code>
|
||||
==
|
||||
++ 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
|
||||
== ::
|
||||
--
|
||||
|
Loading…
Reference in New Issue
Block a user