~/bend-docscommunity

Md.bend checks

raw source on the hub · import hhefesto-markdown@1.0.0.0/Md.bend as Md

2 imports
import Base
import hhefesto-text@1.0.0.0/Text.bend as X

Types

type md.I source · line 18 · raw

Data

Inlines

type md.Al source · line 32 · raw

Data

Blocks. A list's items are md.Item blocks; md.Gap is a blank line between blocks (it shows nothing); a list is tight when no blank line parts its items or the blocks in them.

type md.B source · line 38 · raw

Data

type md.T source · line 182 · raw

Data

A token: an inline read whole, or a run of * _ ~ that may open or close emphasis (its character, how many are left of it, how long it was)

type md.L source · line 188 · raw

Data

what the reader has so far: the text not yet a token (reversed), the tokens (reversed)

type md.Run source · line 215 · raw

Data

a run of c: how many, and what follows

type md.Got source · line 240 · raw

Data

Code spans: the closing run of exactly k backticks

type md.Dest source · line 487 · raw

Data

type md.Bare source · line 637 · raw

Data

a bare link at s (www: it starts "www."): its target, its text, and what follows it

type md.S source · line 658 · raw

Data

type md.F source · line 717 · raw

Data

an opener searched for: found (the stack below it, the items between it and the closer, oldest first, and it) or not (the stack as it was)

type md.Step source · line 791 · raw

Data

What the text at the reader's place is: plain text, an inline read whole, a delimiter run, a link (its inner text still to read), a line's end, or the end; each with what follows and the last character read.

type md.Ind source · line 1077 · raw

Data

a line's indentation in columns (a tab to the next multiple of 4) and what follows it

type md.Fence source · line 1194 · raw

Data

a fence: its character and length (0: none), and its info string

type md.Mark source · line 1212 · raw

Data

a list marker: none, or bullet/ordered, its character (- + * or . )), its number, its width, and the item's text after it

type md.Cut source · line 1373 · raw

Data

type md.PCut source · line 1454 · raw

Data

a paragraph's lines, and a setext heading's level if a line of = or - ends it (0: none)

type md.IL source · line 1500 · raw

Data

type md.LCut source · line 1503 · raw

Data

type md.BS source · line 1576 · raw

Data

What the lines at the reader's place begin: a blank line, a block whole, a block quote or a list (their lines still to read), an item, or the end.

Definitions

def md.if source · line 54 · raw

@-A:Data -> @b:Bool -> @t:(@_:Unit -> A) -> @e:(@_:Unit -> A) -> A

def md.ascii.punct source · line 61 · raw

@+c:U32 -> Bool

def md.punct source · line 66 · raw

@+c:U32 -> Bool

Unicode punctuation (cmark's: ASCII's, and the general punctuation and symbol blocks a chat meets)

def md.white source · line 71 · raw

@+c:U32 -> Bool

def md.esc.pick source · line 77 · raw

@amp:Bool -> @lt:Bool -> @gt:Bool -> @q:Bool -> @+c:U32 -> String

def md.esc.c source · line 90 · raw

@+c:U32 -> String

def md.esc.at source · line 93 · raw

@plain:Bool -> @+c:U32 -> @rest:String -> String

def md.esc source · line 101 · raw

@s:String -> @out:String -> String

text as HTML text, before out

def md.hex source · line 108 · raw

@+n:U32 -> U32

def md.pct source · line 111 · raw

@+b:U32 -> @rest:String -> String

def md.pcts source · line 114 · raw

@bs:List<&2, U32> -> @rest:String -> String

def md.utf8 source · line 121 · raw

@+c:U32 -> List<&2, U32>

def md.href.safe source · line 127 · raw

@+c:U32 -> Bool

characters a link's target keeps as they are (houdini's HREF_SAFE)

def md.href.c source · line 133 · raw

@+c:U32 -> @+rest:String -> String

def md.href source · line 139 · raw

@s:String -> @out:String -> String

a link's target as cmark writes it in href

def md.title source · line 149 · raw

@+t:String -> @+out:String -> String

def md.inl source · line 154 · raw

@xs:List<&2, md.I> -> @+hard:Bool -> @out:String -> String

The inlines xs as HTML, before out (hard: a soft break is a <br />, as cmark's HARDBREAKS has it)

def md.l.flush source · line 191 · raw

@l:md.L -> List<&2, md.T>

def md.l.c source · line 198 · raw

@+c:U32 -> @l:md.L -> md.L

def md.l.s source · line 203 · raw

@s:String -> @l:md.L -> md.L

def md.l.tok source · line 208 · raw

@t:md.T -> @l:md.L -> md.L

def md.l.node source · line 211 · raw

@i:md.I -> @l:md.L -> md.L

def md.run.at source · line 218 · raw

@hit:Bool -> @+c:U32 -> @+n:Nat -> @+h:Char -> @+t:String -> @more:(@_:Unit -> md.Run) -> md.Run

def md.run source · line 225 · raw

@s:String -> @+c:U32 -> @+n:Nat -> md.Run

def md.first source · line 232 · raw

@s:String -> U32

def md.code.at source · line 243 · raw

@close:Bool -> @+k:Nat -> @+j:Nat -> @+acc:String -> @+rest:String -> @more:(@_:String -> Maybe<&2, md.Got>) -> Maybe<&2, md.Got>

def md.code.run source · line 250 · raw

@r:md.Run -> @+k:Nat -> @+acc:String -> @more:(@_:String -> @_:String -> Maybe<&2, md.Got>) -> Maybe<&2, md.Got>

def md.code.find source · line 255 · raw

@+fuel:Nat -> @s:String -> @+k:Nat -> @+acc:String -> Maybe<&2, md.Got>

def md.nl.space source · line 265 · raw

@s:String -> String

def md.all.spaces source · line 272 · raw

@s:String -> Bool

def md.code.trim source · line 279 · raw

@both:Bool -> @+s:String -> String

def md.code.text source · line 283 · raw

@+s:String -> String

a code span's text: line ends as spaces; one space off each end when both ends have one and it is not all spaces

def md.delim.lr source · line 287 · raw

@+c:U32 -> @+n:Nat -> @+p:U32 -> @+x:U32 -> @+left:Bool -> @+right:Bool -> md.T

def md.delim source · line 294 · raw

@+c:U32 -> @+n:Nat -> @+p:U32 -> @+x:U32 -> md.T

Delimiter runs: whether one may open and close emphasis (CommonMark's flanking rules; _ also by what is on its outer side)

def md.ents source · line 299 · raw

List<&2, 0x55b8d1266f49d25f847b58f9466c3721/Text.tx.Two>

Entities: &name; &#ddd; &#xhh;

def md.ent.find source · line 315 · raw

@es:List<&2, 0x55b8d1266f49d25f847b58f9466c3721/Text.tx.Two> -> @+name:String -> Maybe<&2, String>

def md.alnum source · line 322 · raw

@+c:U32 -> Bool

def md.digit source · line 325 · raw

@+c:U32 -> Bool

def md.hexd source · line 328 · raw

@+c:U32 -> Bool

def md.got.cons source · line 331 · raw

@+h:Char -> @g:md.Got -> md.Got

def md.span.at source · line 337 · raw

@take:Bool -> @+h:Char -> @+t:String -> @more:(@_:Unit -> md.Got) -> md.Got

the characters while ok, at most max of them: them and what follows

def md.code.point source · line 353 · raw

@+n:Nat -> String

def md.hexval source · line 357 · raw

@s:String -> @+n:Nat -> Nat

def md.decval source · line 364 · raw

@s:String -> @+n:Nat -> Nat

def md.ent.close source · line 371 · raw

@ok:Bool -> @v:String -> @rest:String -> Maybe<&2, md.Got>

def md.ent.num source · line 378 · raw

@g:md.Got -> @hex:Bool -> Maybe<&2, md.Got>

def md.ent.named.at source · line 385 · raw

@m:Maybe<&2, String> -> @rest:String -> Maybe<&2, md.Got>

def md.ent.named source · line 392 · raw

@g:md.Got -> Maybe<&2, md.Got>

def md.entity source · line 398 · raw

@s:String -> Maybe<&2, md.Got>

what an entity after "&" stands for, and what follows its ";"

def md.angle.ok source · line 407 · raw

@+c:U32 -> Bool

Autolinks <scheme:...> and <user@host>, and raw HTML (kept as text)

def md.scheme.c source · line 410 · raw

@+c:U32 -> Bool

def md.letter source · line 413 · raw

@+c:U32 -> Bool

def md.is.url.g source · line 416 · raw

@g:md.Got -> Bool

def md.is.url source · line 421 · raw

@+s:String -> Bool

def md.is.mail source · line 424 · raw

@+s:String -> Bool

def md.auto.got source · line 427 · raw

@g:md.Got -> Maybe<&2, md.Got>

def md.auto source · line 436 · raw

@s:String -> Maybe<&2, md.Got>

an autolink after "<": its target and what follows its ">"

def md.tag.c source · line 439 · raw

@+c:U32 -> Bool

def md.tag.got source · line 442 · raw

@g:md.Got -> Maybe<&2, md.Got>

def md.comment.go source · line 449 · raw

@fuel:Nat -> @s:String -> @+acc:String -> Maybe<&2, md.Got>

def md.raw source · line 460 · raw

@+s:String -> Maybe<&2, md.Got>

raw HTML after "<" (a tag, or a comment): itself and what follows

def md.brk.at source · line 466 · raw

@close:Bool -> @open:Bool -> @+depth:Nat -> @+h:Char -> @+t:String -> @+acc:String -> @more:(@_:Nat -> @_:String -> Maybe<&2, md.Got>) -> Maybe<&2, md.Got>

Links: [text](target "title")

def md.brk source · line 476 · raw

@+fuel:Nat -> @s:String -> @+depth:Nat -> @+acc:String -> Maybe<&2, md.Got>

the text up to the "]" that closes the "[" before s, and what follows it

def md.skip.ws source · line 490 · raw

@s:String -> String

def md.unesc source · line 498 · raw

@s:String -> String

backslashes before punctuation dropped

def md.depth.of source · line 507 · raw

@+c:U32 -> @+d:Nat -> Nat

def md.dest.raw.at source · line 510 · raw

@stop:Bool -> @+depth:Nat -> @+c:U32 -> @+t:String -> @+acc:String -> @more:(@_:Nat -> @_:String -> Maybe<&2, md.Got>) -> Maybe<&2, md.Got>

def md.dest.raw source · line 518 · raw

@+fuel:Nat -> @s:String -> @+depth:Nat -> @+acc:String -> Maybe<&2, md.Got>

a target written bare: up to white space, or a ")" that closes nothing

def md.title.close source · line 529 · raw

@+q:U32 -> U32

def md.title.at source · line 532 · raw

@hit:Bool -> @+q:U32 -> @+h:Char -> @+t:String -> @+acc:String -> @more:(@_:String -> Maybe<&2, md.Got>) -> Maybe<&2, md.Got>

def md.title.go source · line 540 · raw

@+fuel:Nat -> @s:String -> @+q:U32 -> @+acc:String -> Maybe<&2, md.Got>

a title's text, up to its closing quote (q), and what follows

def md.dest.end source · line 551 · raw

@+url:String -> @+title:String -> @s:String -> Maybe<&2, md.Dest>

def md.dest.title.got source · line 558 · raw

@+url:String -> @m:Maybe<&2, md.Got> -> Maybe<&2, md.Dest>

def md.dest.title source · line 565 · raw

@+url:String -> @+s:String -> Maybe<&2, md.Dest>

def md.dest.got source · line 570 · raw

@m:Maybe<&2, md.Got> -> Maybe<&2, md.Dest>

def md.dest.angle source · line 577 · raw

@g:md.Got -> Maybe<&2, md.Got>

def md.not.angle.nl source · line 584 · raw

@+c:U32 -> Bool

def md.dest.at source · line 587 · raw

@+s:String -> Maybe<&2, md.Dest>

def md.dest source · line 592 · raw

@+s:String -> Maybe<&2, md.Dest>

after "](": the target, the title, and what follows the ")"

def md.trail.drop source · line 596 · raw

@+c:U32 -> Bool

GitHub's bare links: www.x, http://x, https://x after white space or *_~(

def md.count source · line 599 · raw

@s:String -> @+c:U32 -> @+n:Nat -> Nat

def md.ent.tail.g source · line 606 · raw

@g:md.Got -> String

def md.ent.tail source · line 613 · raw

@r:String -> String

def md.trim.go source · line 618 · raw

@+fuel:Nat -> @+r:String -> String

a bare link's end: trailing punctuation dropped, a ")" it does not open, an entity at its end (on its reversed text r)

def md.link.c source · line 629 · raw

@+c:U32 -> Bool

def md.domain.c source · line 632 · raw

@+c:U32 -> Bool

def md.got.a source · line 640 · raw

@g:md.Got -> String

def md.bare.dom source · line 645 · raw

@+www:Bool -> @+l:String -> String

def md.bare.got source · line 648 · raw

@+www:Bool -> @+all:String -> @+l:String -> Maybe<&2, md.Bare>

def md.bare source · line 652 · raw

@+www:Bool -> @+s:String -> Maybe<&2, md.Bare>

def md.chars source · line 662 · raw

@+c:U32 -> @n:Nat -> String

def md.s.node source · line 665 · raw

@s:md.S -> md.I

def md.s.list source · line 673 · raw

@xs:List<&2, md.S> -> List<&2, md.I>

items in order as inlines

def md.s.out source · line 681 · raw

@st:List<&2, md.S> -> @acc:List<&2, md.I> -> List<&2, md.I>

a stack (newest first) as inlines, oldest first

def md.merge.flush source · line 688 · raw

@m:Maybe<&2, String> -> @rest:List<&2, md.I> -> List<&2, md.I>

def md.merge.add source · line 695 · raw

@m:Maybe<&2, String> -> @s:String -> Maybe<&2, String>

def md.merge.go source · line 703 · raw

@xs:List<&2, md.I> -> @m:Maybe<&2, String> -> List<&2, md.I>

neighbouring texts joined

def md.merge source · line 712 · raw

@xs:List<&2, md.I> -> List<&2, md.I>

def md.rule3 source · line 722 · raw

@+ol:Nat -> @+oc:Bool -> @+cl:Nat -> @+co:Bool -> Bool

CommonMark's rule of 3

def md.find.at source · line 725 · raw

@hit:Bool -> @+c:U32 -> @+n2:Nat -> @+l2:Nat -> @+o2:Bool -> @+cl2:Bool -> @below:List<&2, md.S> -> @between:List<&2, md.S> -> @more:(@_:List<&2, md.S> -> md.F) -> md.F

def md.find source · line 732 · raw

@st:List<&2, md.S> -> @+c:U32 -> @+n:Nat -> @+len:Nat -> @+co:Bool -> @between:List<&2, md.S> -> md.F

def md.wrap source · line 742 · raw

@+c:U32 -> @+k:Nat -> @+xs:List<&2, md.I> -> md.I

def md.close.found source · line 745 · raw

@+c:U32 -> @+n:Nat -> @+k:Nat -> @+below:List<&2, md.S> -> @between:List<&2, md.S> -> @+n2:Nat -> @+l2:Nat -> @+o2:Bool -> @+cl2:Bool -> @more:(@_:Nat -> @_:List<&2, md.S> -> List<&2, md.S>) -> List<&2, md.S>

def md.close.f source · line 749 · raw

@r:md.F -> @+c:U32 -> @+n:Nat -> @+len:Nat -> @+co:Bool -> @+cl:Bool -> @more:(@_:Nat -> @_:List<&2, md.S> -> List<&2, md.S>) -> List<&2, md.S>

def md.close source · line 757 · raw

@+fuel:Nat -> @+c:U32 -> @+n:Nat -> @+len:Nat -> @+co:Bool -> @+cl:Bool -> @+st:List<&2, md.S> -> List<&2, md.S>

a closing run of c (n of it left) against the stack

def md.delim.push source · line 765 · raw

@+c:U32 -> @+n:Nat -> @+len:Nat -> @+o:Bool -> @+cl:Bool -> @st:List<&2, md.S> -> List<&2, md.S>

def md.emph.go source · line 772 · raw

@ts:List<&2, md.T> -> @st:List<&2, md.S> -> List<&2, md.I>

def md.emph source · line 782 · raw

@ts:List<&2, md.T> -> List<&2, md.I>

the tokens read, emphasis matched

def md.special source · line 799 · raw

@+c:U32 -> Bool

def md.plain source · line 803 · raw

@+c:U32 -> Bool

def md.skip.sp source · line 806 · raw

@s:String -> String

def md.last source · line 813 · raw

@+s:String -> @+d:U32 -> U32

def md.step.bs source · line 817 · raw

@t:String -> md.Step

"\": a hard break at a line's end, a punctuation character as itself, else itself

def md.step.code.got source · line 826 · raw

@+k:Nat -> @+rest:String -> @m:Maybe<&2, md.Got> -> md.Step

def md.step.code source · line 833 · raw

@r:md.Run -> md.Step

def md.step.delim source · line 838 · raw

@+c:U32 -> @+prev:U32 -> @r:md.Run -> md.Step

def md.step.link.dest source · line 844 · raw

@+bang:String -> @+inner:String -> @+after:String -> @m:Maybe<&2, md.Dest> -> md.Step

def md.step.link.got source · line 851 · raw

@+bang:String -> @+t:String -> @m:Maybe<&2, md.Got> -> md.Step

def md.step.raw source · line 863 · raw

@+t:String -> @m:Maybe<&2, md.Got> -> md.Step

def md.mail.text source · line 870 · raw

@+u:String -> String

def md.step.lt.got source · line 873 · raw

@+t:String -> @m:Maybe<&2, md.Got> -> md.Step

def md.step.amp source · line 880 · raw

@+t:String -> @m:Maybe<&2, md.Got> -> md.Step

def md.step.bare source · line 887 · raw

@+c:U32 -> @+t:String -> @m:Maybe<&2, md.Bare> -> md.Step

def md.bare.prev source · line 894 · raw

@+p:U32 -> Bool

def md.scheme.at source · line 897 · raw

@+s:String -> Bool

def md.bare.here source · line 903 · raw

@+p:U32 -> @+s:String -> Bool

where a bare link may start: www. after white space or *_~(; a URL after anything but a letter (cmark-gfm reads its scheme back to the first non-letter)

def md.cut.bare.at source · line 906 · raw

@hit:Bool -> @+h:Char -> @+t:String -> @+acc:String -> @more:(@_:String -> md.Got) -> md.Got

def md.cut.bare source · line 914 · raw

@s:String -> @+p:U32 -> @+acc:String -> md.Got

a run of plain text cut before a bare link in it (p: the character before)

def md.step.plain.g source · line 921 · raw

@g:md.Got -> @+after:String -> md.Step

def md.step.plain source · line 926 · raw

@+prev:U32 -> @g:md.Got -> md.Step

def md.step.word source · line 931 · raw

@+c:U32 -> @+t:String -> @+prev:U32 -> md.Step

def md.next.c source · line 936 · raw

@+c:U32 -> @+t:String -> @+prev:U32 -> md.Step

def md.next source · line 949 · raw

@s:String -> @+prev:U32 -> md.Step

the step at s, after prev

def md.l.brk.sp source · line 958 · raw

@s:String -> @+n:Nat -> md.Got

a line's end: a hard break after two spaces, else a soft one; the spaces before it dropped

def md.l.brk.g source · line 965 · raw

@g:md.Got -> @ts:List<&2, md.T> -> md.L

def md.l.brk source · line 970 · raw

@l:md.L -> md.L

def md.l.done source · line 975 · raw

@l:md.L -> List<&2, md.T>

def md.lex source · line 980 · raw

@+fuel:Nat -> @st:md.Step -> @l:md.L -> List<&2, md.T>

The reader: steps until the end (fuel: the text's length, as every step reads a character at least)

def md.local.c source · line 999 · raw

@+c:U32 -> Bool

GitHub's bare e-mail addresses (cmark-gfm finds them in text nodes, after the rest is read): a local part, "@", a domain with a "." in it

def md.dots source · line 1002 · raw

@s:String -> Nat

def md.mail.ok source · line 1011 · raw

@+local:String -> @+dom:String -> Bool

def md.mail.trim source · line 1015 · raw

@+dom:String -> String

def md.mail.at source · line 1018 · raw

@ok:Bool -> @+pre:String -> @+local:String -> @+dom:String -> @+rest:String -> @more:(@_:String -> List<&2, md.I>) -> List<&2, md.I>

def md.mail.dom source · line 1026 · raw

@+pre:String -> @+local:String -> @g:md.Got -> @more:(@_:String -> List<&2, md.I>) -> List<&2, md.I>

def md.got.rest source · line 1031 · raw

@g:md.Got -> String

def md.mail.local source · line 1036 · raw

@+before:String -> @+from:String -> @more:(@_:String -> List<&2, md.I>) -> List<&2, md.I>

def md.mail.two source · line 1041 · raw

@p:0x55b8d1266f49d25f847b58f9466c3721/Text.tx.Two -> @more:(@_:String -> List<&2, md.I>) -> List<&2, md.I>

def md.mails.go source · line 1046 · raw

@fuel:Nat -> @+s:String -> List<&2, md.I>

def md.mails source · line 1053 · raw

@xs:List<&2, md.I> -> List<&2, md.I>

def md.inline source · line 1069 · raw

@+s:String -> List<&2, md.I>

a paragraph's (or a heading's, or a cell's) text as inlines

def md.ind.go source · line 1080 · raw

@s:String -> @+n:Nat -> md.Ind

def md.ind source · line 1089 · raw

@s:String -> md.Ind

def md.ind.n source · line 1092 · raw

@i:md.Ind -> Nat

def md.ind.r source · line 1097 · raw

@i:md.Ind -> String

def md.cols source · line 1102 · raw

@+s:String -> Nat

def md.unind source · line 1105 · raw

@+s:String -> String

def md.blank source · line 1108 · raw

@s:String -> Bool

def md.dedent.go source · line 1116 · raw

@s:String -> @n:Nat -> String

up to n columns of indentation taken off a line

def md.dedent source · line 1127 · raw

@n:Nat -> @s:String -> String

def md.join source · line 1130 · raw

@ls:List<&2, String> -> String

def md.body source · line 1134 · raw

@ls:List<&2, String> -> String

each line ended by "\n"

def md.drop.blank source · line 1142 · raw

@ls:List<&2, String> -> List<&2, String>

the leading blank lines of lines dropped

def md.trim.blank source · line 1149 · raw

@ls:List<&2, String> -> List<&2, String>

def md.only source · line 1155 · raw

@s:String -> @+c:U32 -> @+n:Nat -> Nat

def md.is.rule source · line 1163 · raw

@+s:String -> Bool

a thematic break: three or more * - or _, nothing else but spaces

def md.atx.level source · line 1167 · raw

@r:md.Run -> Nat

an ATX heading: its level (0: none) and its text

def md.atx.close.g source · line 1172 · raw

@r:md.Run -> @+s:String -> String

def md.atx.close.r source · line 1178 · raw

@rv:String -> @+s:String -> String

def md.atx.close source · line 1182 · raw

@+s:String -> String

a closing sequence of #s (after a space, or the whole) dropped

def md.atx.text.r source · line 1185 · raw

@+r:String -> String

def md.atx.text source · line 1188 · raw

@r:md.Run -> String

def md.fence.r source · line 1197 · raw

@+c:U32 -> @r:md.Run -> md.Fence

def md.fence source · line 1202 · raw

@+s:String -> md.Fence

def md.fence.n source · line 1205 · raw

@f:md.Fence -> Nat

def md.mark.sp source · line 1217 · raw

@+ordered:Bool -> @+c:U32 -> @+start:Nat -> @+w:Nat -> @i:md.Ind -> md.Mark

the spaces after the marker: 1 to 4 belong to it, more mean code in the item

def md.mark.after source · line 1224 · raw

@+ordered:Bool -> @+c:U32 -> @+start:Nat -> @+w:Nat -> @+rest:String -> md.Mark

def md.mark.num source · line 1229 · raw

@g:md.Got -> md.Mark

def md.mark source · line 1235 · raw

@+s:String -> md.Mark

def md.mark.ok source · line 1239 · raw

@m:md.Mark -> Bool

def md.mark.breaks source · line 1248 · raw

@m:md.Mark -> Bool

a marker that may break into a paragraph: its item is not empty, and an ordered one starts at 1

def md.block.tags source · line 1256 · raw

List<&2, String>

HTML blocks: the kind of block a line starts (CommonMark's 1 to 7; 0 none)

def md.tag.end source · line 1262 · raw

@+s:String -> Bool

def md.tag.in source · line 1265 · raw

@ts:List<&2, String> -> @+s:String -> Bool

def md.html.seven source · line 1272 · raw

@+s:String -> Bool

def md.html.kind source · line 1276 · raw

@+low:String -> @+para:Bool -> Nat

def md.html.ends source · line 1286 · raw

@+kind:Nat -> @+low:String -> Bool

def md.breaks.s source · line 1292 · raw

@+s:String -> Bool

a line that ends a paragraph and starts a block of its own

def md.breaks source · line 1296 · raw

@+l:String -> Bool

def md.cells.go source · line 1300 · raw

@+fuel:Nat -> @s:String -> @+acc:String -> List<&2, String>

Tables (GitHub's): cells cut at "|" (not "\|"), the outer ones' pipes dropped

def md.cells.trim source · line 1313 · raw

@cs:List<&2, String> -> List<&2, String>

def md.cells.of source · line 1320 · raw

@+s:String -> List<&2, String>

def md.cells.inner.end source · line 1323 · raw

@+s:String -> String

def md.cells.inner source · line 1326 · raw

@+s:String -> String

def md.cells source · line 1329 · raw

@+l:String -> List<&2, String>

def md.dash.c source · line 1332 · raw

@+c:U32 -> Bool

def md.al.mk source · line 1335 · raw

@l:Bool -> @r:Bool -> md.Al

def md.al.mid source · line 1346 · raw

@l:Bool -> @r:Bool -> @g:md.Got -> Maybe<&2, md.Al>

def md.al.of source · line 1353 · raw

@+c:String -> Maybe<&2, md.Al>

a delimiter cell's alignment, if it is one (:?-+:?)

def md.aligns.cons source · line 1356 · raw

@a:Maybe<&2, md.Al> -> @r:Maybe<&2, List<&2, md.Al>> -> Maybe<&2, List<&2, md.Al>>

def md.aligns source · line 1363 · raw

@cs:List<&2, String> -> Maybe<&2, List<&2, md.Al>>

def md.cut.cons source · line 1376 · raw

@+l:String -> @c:md.Cut -> md.Cut

def md.take.code source · line 1381 · raw

@ls:List<&2, String> -> md.Cut

def md.fence.shut source · line 1388 · raw

@+c:U32 -> @+n:Nat -> @f:md.Fence -> Bool

def md.fence.closes source · line 1393 · raw

@+c:U32 -> @+n:Nat -> @+l:String -> Bool

def md.take.fence source · line 1398 · raw

@ls:List<&2, String> -> @+c:U32 -> @+n:Nat -> @+k:Nat -> md.Cut

a fenced block's lines (k: its fence's indentation, taken off each), the closing fence dropped

def md.quote.sp source · line 1405 · raw

@+s:String -> String

def md.quote.strip source · line 1408 · raw

@+s:String -> String

def md.is.quote source · line 1411 · raw

@+l:String -> Bool

def md.take.quote source · line 1416 · raw

@ls:List<&2, String> -> @+lazy:Bool -> md.Cut

a block quote's lines, its ">" taken off, and the lazy lines that go on its paragraph

def md.take.item source · line 1426 · raw

@ls:List<&2, String> -> @+w:Nat -> @+lazy:Bool -> md.Cut

a list item's lines after its first (w: the column its text starts at)

def md.take.rows source · line 1436 · raw

@ls:List<&2, String> -> md.Cut

def md.take.html source · line 1443 · raw

@ls:List<&2, String> -> @+kind:Nat -> md.Cut

def md.pcut.cons source · line 1457 · raw

@+l:String -> @c:md.PCut -> md.PCut

def md.setext.g source · line 1462 · raw

@r:md.Run -> Bool

def md.setext.s source · line 1467 · raw

@+s:String -> @+c:U32 -> Bool

def md.setext source · line 1470 · raw

@+l:String -> @+c:U32 -> Bool

def md.table.al.ok source · line 1473 · raw

@m:Maybe<&2, List<&2, md.Al>> -> @+l:String -> Bool

def md.table.next source · line 1481 · raw

@+l:String -> @t:List<&2, String> -> Bool

whether l and the line after it start a table (l its header)

def md.take.para source · line 1488 · raw

@ls:List<&2, String> -> md.PCut

def md.same.mark source · line 1506 · raw

@+o:Bool -> @+c:U32 -> @m:md.Mark -> Bool

def md.same.item source · line 1514 · raw

@+o:Bool -> @+c:U32 -> @+l:String -> Bool

whether a line starts an item of the same list

def md.task source · line 1518 · raw

@+s:String -> Nat

a task item's box: "[ ] " (1) or "[x] " (2)

def md.task.rest source · line 1522 · raw

@+k:Nat -> @+s:String -> String

def md.lcut.cons source · line 1525 · raw

@it:md.IL -> @+sep:Bool -> @c:md.LCut -> md.LCut

def md.list.lines source · line 1531 · raw

@+first:String -> @c:md.Cut -> @more:(@_:List<&2, String> -> md.LCut) -> md.LCut

an item's lines; its trailing blank lines go back to what follows it

def md.list.item source · line 1537 · raw

@m:md.Mark -> @+k:Nat -> @+t:List<&2, String> -> @more:(@_:List<&2, String> -> md.LCut) -> md.LCut

def md.next.line source · line 1544 · raw

@ls:List<&2, String> -> String

def md.lcut.spaced source · line 1551 · raw

@c:md.LCut -> md.LCut

def md.take.list source · line 1559 · raw

@+fuel:Nat -> @ls:List<&2, String> -> @+o:Bool -> @+c:U32 -> md.LCut

a list's items, each with its lines (the marker's width taken off), and whether blank lines part them (a blank line, then an item of the list: the list goes on, spaced)

def md.first.word source · line 1584 · raw

@ws:List<&2, String> -> String

def md.code.class source · line 1591 · raw

@+info:String -> String

def md.b.fence.cut source · line 1594 · raw

@+info:String -> @c:md.Cut -> md.BS

def md.b.fence source · line 1599 · raw

@f:md.Fence -> @+k:Nat -> @+t:List<&2, String> -> md.BS

def md.b.code source · line 1604 · raw

@c:md.Cut -> md.BS

def md.b.quote source · line 1609 · raw

@c:md.Cut -> md.BS

def md.b.html source · line 1614 · raw

@c:md.Cut -> md.BS

def md.b.list.cut source · line 1619 · raw

@+o:Bool -> @+s:Nat -> @c:md.LCut -> md.BS

def md.b.list source · line 1624 · raw

@m:md.Mark -> @+ls:List<&2, String> -> md.BS

def md.para.text source · line 1631 · raw

@ls:List<&2, String> -> String

def md.b.para source · line 1634 · raw

@+l:String -> @c:md.PCut -> md.BS

def md.row.fit source · line 1642 · raw

@als:List<&2, md.Al> -> @cs:List<&2, String> -> List<&2, List<&2, md.I>>

a table: its header (l), the delimiter row's alignments, its rows (a row's cells fit to the header's: missing ones empty, extra ones dropped)

def md.rows source · line 1651 · raw

@ls:List<&2, String> -> @+als:List<&2, md.Al> -> List<&2, List<&2, List<&2, md.I>>>

def md.b.table.cut source · line 1658 · raw

@+als:List<&2, md.Al> -> @+head:String -> @c:md.Cut -> md.BS

def md.b.table.al source · line 1663 · raw

@m:Maybe<&2, List<&2, md.Al>> -> @+l:String -> @+t:List<&2, String> -> Maybe<&2, md.BS>

def md.b.table source · line 1671 · raw

@+l:String -> @+t:List<&2, String> -> Maybe<&2, md.BS>

def md.b.table.or source · line 1678 · raw

@m:Maybe<&2, md.BS> -> @+l:String -> @+t:List<&2, String> -> md.BS

def md.bstart.s source · line 1685 · raw

@+l:String -> @+s:String -> @+t:List<&2, String> -> md.BS

def md.bstart source · line 1694 · raw

@+l:String -> @+t:List<&2, String> -> md.BS

def md.bnext source · line 1698 · raw

@ls:List<&2, String> -> md.BS

def md.items.next source · line 1705 · raw

@its:List<&2, md.IL> -> md.BS

def md.blocks source · line 1714 · raw

@+fuel:Nat -> @st:md.BS -> List<&2, md.B>

The reader of blocks (fuel: a bound on its steps, each of which reads a line or goes into a container's fewer lines)

def md.cr.drop source · line 1731 · raw

@+l:String -> String

def md.lines source · line 1734 · raw

@ls:List<&2, String> -> List<&2, String>

def md.parse source · line 1742 · raw

@s:String -> List<&2, md.B>

a text read as blocks

def md.gapped source · line 1749 · raw

@ks:List<&2, md.B> -> @+seen:Bool -> @+gap:Bool -> Bool

whether two of an item's blocks have a blank line between them

def md.loose source · line 1758 · raw

@items:List<&2, md.B> -> Bool

def md.cr source · line 1767 · raw

@+fresh:Bool -> String

def md.list.open source · line 1770 · raw

@+o:Bool -> @+s:Nat -> String

def md.box source · line 1773 · raw

@+k:Nat -> String

def md.class source · line 1777 · raw

@+info:String -> String

def md.al.attr source · line 1780 · raw

@a:md.Al -> String

def md.tds source · line 1791 · raw

@+tag:String -> @als:List<&2, md.Al> -> @cs:List<&2, List<&2, md.I>> -> @+hard:Bool -> String

def md.tr source · line 1798 · raw

@+tag:String -> @+als:List<&2, md.Al> -> @cs:List<&2, List<&2, md.I>> -> @+hard:Bool -> String

def md.trs source · line 1801 · raw

@+als:List<&2, md.Al> -> @rows:List<&2, List<&2, List<&2, md.I>>> -> @+hard:Bool -> String

def md.table source · line 1809 · raw

@+als:List<&2, md.Al> -> @head:List<&2, List<&2, md.I>> -> @+rows:List<&2, List<&2, List<&2, md.I>>> -> @+hard:Bool -> String

a table as Render.hs writes one (cmark-gfm's own form)

def md.raw.nl source · line 1813 · raw

@+h:String -> String

def md.blk source · line 1819 · raw

@xs:List<&2, md.B> -> @+tight:Bool -> @+hard:Bool -> @+fresh:Bool -> @+out:String -> String

The blocks xs as HTML, before out, as cmark writes them (tight: in a tight list's item, a paragraph is its inlines alone; fresh: what came before ends a line)

def md.html source · line 1849 · raw

@bs:List<&2, md.B> -> @+hard:Bool -> String

blocks as HTML (hard: soft breaks as <br />)

Templates

template md.span source · line 344 · raw

@-ok:(@+c:U32 -> Bool) -> @max:Nat -> @s:String -> md.Got