Handbook
Glossary
div-tag ( str style -- str' )
Vocabulary
io
.
streams
.
markdown
.
private
Inputs
str
an
object
style
an
object
Outputs
str'
an
object
Definition
USING:
assocs
combinators
io.styles
kernel
math
sequences
splitting
;
IN:
io.streams.markdown.private
:
div-tag
( str style -- str' )
{
[
font-name
of
"monospace"
=
[
"\n\n"
"\n"
replace
"```\n"
"\n```"
surround
]
when
]
[
font-size
of
{
{
[
dup
not
]
[
drop
]
}
{
[
dup
18
>=
]
[
drop
"# "
prepend
]
}
{
[
dup
16
>=
]
[
drop
"## "
prepend
]
}
{
[
dup
14
>=
]
[
drop
"### "
prepend
]
}
[
drop
]
}
cond
]
}
cleave
;