mirror of
https://github.com/urbit/shrub.git
synced 2024-12-04 04:35:02 +03:00
half the markdown jet
This commit is contained in:
parent
7d9a4c6073
commit
445dd6b334
@ -626,13 +626,16 @@
|
||||
=+ man=`mane`n.g.mex
|
||||
=. unq |(unq =(%script man) =(%style man))
|
||||
=+ tam=(name man)
|
||||
=. rez :(weld "</" tam ">" rez)
|
||||
=+ att=`mart`a.g.mex
|
||||
:- '<'
|
||||
%+ welp tam
|
||||
=. rez ['>' (many c.mex rez)]
|
||||
?~(att rez [' ' (attr att rez)])
|
||||
::
|
||||
=- ?~(att rez [' ' (attr att rez)])
|
||||
^- rez=tape
|
||||
::?~ c.mex
|
||||
:: [' ' '/' '>' rez]
|
||||
:- '>'
|
||||
(many c.mex :(weld "</" tam ">" rez))
|
||||
:: ::
|
||||
++ attr :: attributes to tape
|
||||
|= [tat=mart rez=tape]
|
||||
^- tape
|
||||
@ -684,10 +687,10 @@
|
||||
%+ ifix [(star spa) (star spa)]
|
||||
;~ pose
|
||||
%+ sear |=([a=marx b=marl c=mane] ?.(=(c n.a) ~ (some [a b])))
|
||||
;~(plug head (more (star comt) ;~(pose apex chrd)) tail)
|
||||
;~(plug head many tail)
|
||||
empt
|
||||
==
|
||||
::
|
||||
::
|
||||
++ attr :: attributes
|
||||
%+ knee *mart |. ~+
|
||||
%- star
|
||||
@ -729,6 +732,9 @@
|
||||
++ head :: opening tag
|
||||
(ifix [gal gar] ;~(plug name attr))
|
||||
::
|
||||
++ many
|
||||
(more (star comt) ;~(pose apex chrd))
|
||||
::
|
||||
++ name :: tag name
|
||||
=+ ^= chx
|
||||
%+ cook crip
|
||||
|
@ -1,8 +1,43 @@
|
||||
~% %util +> ~
|
||||
|%
|
||||
++ kids (list inline)
|
||||
++ inline
|
||||
=+ ^= inlik
|
||||
$% [%emph p=?] :: strong?
|
||||
[%delt ~] :: strikethrough
|
||||
[%link p=tape q=(unit tape)]
|
||||
[%blot p=tape q=(unit tape)] :: image
|
||||
==
|
||||
=+ ^= inlin
|
||||
$% [%$ p=tape]
|
||||
[%line ~]
|
||||
[%code p=tape]
|
||||
[%html p=manx]
|
||||
==
|
||||
$&([p=inlik q=kids] inlin)
|
||||
::
|
||||
::
|
||||
++ elem $&(tops node)
|
||||
++ tops :: childful block
|
||||
$: $= p
|
||||
$% [%bloq ~]
|
||||
[%list p=? q=$|(char [p=@u q=char])] :: tight, ordered?
|
||||
[%item ~]
|
||||
==
|
||||
q=(list elem)
|
||||
==
|
||||
:: ++ mist |*(a=_,* ,[i=a t=$|(~ (mist a))]) :: .=(%mist +(%list))
|
||||
++ node :: childless block
|
||||
$% [%para p=kids]
|
||||
[%hrul ~]
|
||||
[%head p=@u q=kids]
|
||||
[%code p=(unit ,[p=char q=@u r=tape]) q=wain] :: info, contents
|
||||
[%html p=wain]
|
||||
[%defn ~] :: empty para
|
||||
==
|
||||
::
|
||||
++ sqar
|
||||
~/ %sqar
|
||||
|= @
|
||||
:: (dope +<)
|
||||
:(mul +< +< +<)
|
||||
|= @t
|
||||
*(list elem)
|
||||
--
|
||||
|
@ -1,10 +1,46 @@
|
||||
/+ sqar
|
||||
// /=try=/daun
|
||||
!:
|
||||
=-
|
||||
;html
|
||||
;head
|
||||
;title: skuaring
|
||||
==
|
||||
;body
|
||||
;p: 15 skwared is {<(sqar 15)>}
|
||||
;p: 15 skwared is *{(sing (sqar -))}
|
||||
==
|
||||
==
|
||||
'''
|
||||
## Why is a spec needed?
|
||||
|
||||
John Gruber's [canonical description of Markdown's
|
||||
syntax](http://daringfireball.net/projects/markdown/syntax)
|
||||
does not specify the syntax unambiguously. Here are some examples of
|
||||
questions it does not answer:
|
||||
|
||||
1. How much indentation is needed for a sublist? The spec says that
|
||||
continuation paragraphs need to be indented four spaces, but is
|
||||
not fully explicit about sublists. It is natural to think that
|
||||
they, too, must be indented four spaces, but `Markdown.pl` does
|
||||
not require that. This is hardly a "corner case," and divergences
|
||||
between implementations on this issue often lead to surprises for
|
||||
users in real documents. (See [this comment by John
|
||||
Gruber](http://article.gmane.org/gmane.text.markdown.general/1997).)
|
||||
|
||||
2. Is a blank line needed before a block quote or header?
|
||||
Most implementations do not require the blank line. However,
|
||||
this can lead to unexpected results in hard-wrapped text, and
|
||||
also to ambiguities in parsing (note that some implementations
|
||||
put the header inside the blockquote, while others do not).
|
||||
(John Gruber has also spoken [in favor of requiring the blank
|
||||
lines](http://article.gmane.org/gmane.text.markdown.general/2146).)
|
||||
|
||||
3. Is a blank line needed before an indented code block?
|
||||
(`Markdown.pl` requires it, but this is not mentioned in the
|
||||
documentation, and some implementations do not require it.)
|
||||
|
||||
``` markdown
|
||||
paragraph
|
||||
code?
|
||||
```
|
||||
'''
|
||||
|
Loading…
Reference in New Issue
Block a user