Handbook
Glossary
print-opening-tag ( tag -- )
Vocabulary
html
.
parser
.
printer
Inputs
tag
an
object
Outputs
None
Definition
IN:
html.parser.printer
HOOK:
print-opening-tag
html-printer
( tag -- )
Methods
USING:
accessors
html.parser.printer
io
kernel
namespaces
sequences
;
M:
html-prettyprinter
print-opening-tag
name>>
[
indent
"<"
write
write
">\n"
write
]
[
{
"br"
"img"
}
member?
[
#indentations
inc
]
unless
]
bi
;
USING:
accessors
html.parser.printer
io
kernel
;
M:
src-printer
print-opening-tag
"<"
write
[
name>>
write
]
[
attributes>>
print-attributes
]
bi
">"
write
;
USING:
accessors
combinators
html.parser.printer
io
kernel
namespaces
;
M:
text-printer
print-opening-tag
name>>
{
{
"br"
[
nl
indent
]
}
{
"ol"
[
nl
indent
]
}
{
"ul"
[
nl
indent
]
}
{
"li"
[
" * "
write
]
}
{
"blockquote"
[
#indentations
inc
indent
]
}
{
"pre"
[
preformatted?
on
]
}
{
"script"
[
script?
on
]
}
{
"style"
[
style?
on
]
}
[
drop
]
}
case
;