htmlize-stream ( path stream -- xml )


Vocabulary
xmode.code2html

Definition
USING: io kernel locals sequences xml.data xml.syntax.private
xmode.catalog ;

IN: xmode.code2html

:: htmlize-stream ( path stream -- xml )
stream stream-lines
[ "" ] [ path over first find-mode htmlize-lines ] if-empty
:> input default-stylesheet :> stylesheet H{
{ "stylesheet" stylesheet }
{ "input" input }
{ "path" path }
} T{ xml
{ prolog
T{ prolog { version "1.0" } { encoding "UTF-8" } }
}
{ before V{ } }
{ body
T{ tag
{ name
T{ name
{ space "" }
{ main "html" }
{ url "" }
}
}
{ children
V{
"\n "
~tag~
"\n "
~tag~
"\n "
}
}
}
}
{ after V{ "" } }
} interpolate-xml ;