xuxinx / html2go

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Generate html to htmlgo code

Install

$ go get github.com/sunfmin/html2go

Run

$ html2go # enter and then copy paste html code
<nav class="navbar navbar-expand-lg navbar-light bg-light">
  <input readonly required disabled checked tabindex="-1">
  <input readonly="false">
</nav>
# enter a new line here

Then ctrl+d, the terminal will show:

package hello

var n = Body(
	Nav(
		Input("").Readonly(true).
			Required(true).
			Disabled(true).
			Checked(true).
			TabIndex(-1),
		Input("").Readonly(true),
	).Class("navbar navbar-expand-lg navbar-light bg-light"),
)

Use -pkg if you need to generate a different package prefix

$ html2go -pkg=h

About

License:MIT License


Languages

Language:Go 100.0%