Handbook
Glossary
with-markdown-writer ( quot -- str )
Markdown streams
Prev:
<markdown-writer> ( -- markdown-writer )
Vocabulary
io
.
streams
.
markdown
Inputs
quot
a
quotation
Outputs
str
a
string
Word description
Calls the quotation in a new dynamic scope with
output-stream
rebound to an
markdown-writer
. When the quotation returns, outputs the accumulated Markdown markup.
Examples
USING: io io.styles io.streams.markdown prettyprint ; [ "Hello" { { font-style bold } } format nl ] with-markdown-writer .
"**Hello**\n\n"
Definition
USING:
accessors
io
kernel
sequences
;
IN:
io.streams.markdown
:
with-markdown-writer
( quot -- str )
<markdown-writer>
[
swap
with-output-stream
]
keep
data>>
""
concat-as
;
inline