JuliaWeb / Hyperscript.jl

Hyperscript: A lightweight DOM representation for Julia
Other
101 stars 11 forks source link

Try out a Pretty wrapper for pretty-printing #9

Closed yurivish closed 6 years ago

yurivish commented 6 years ago

@tshort thoughts? If this feels like the right approach I'll add back the documentation, adjusted appropriately.

julia> using Hyperscript

julia> @tags h1 span a

julia> node = h1(span("This is "), a("a link"), span("to nowhere."))
<h1><span>This is </span><a>a link</a><span>to nowhere.</span></h1>

julia> Pretty(node)
<h1>
  <span>This is </span>
  <a>a link</a>
  <span>to nowhere.</span>
</h1>

julia> Pretty(node, indent="\t")
<h1>
    <span>This is </span>
    <a>a link</a>
    <span>to nowhere.</span>
</h1>
tshort commented 6 years ago

Looks good to me...