htmltojs

command
v0.0.0-...-ce0ea8a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 25, 2023 License: MIT Imports: 6 Imported by: 0

README

htmltojs

Convert HTML to JavaScript for command line


install

go get github.com/saihon/htmltojs/cmd/htmltojs

example

Pipe the output from cat command into htmltojs

$ cat index.html | htmltojs

Specifies the output file

$ cat index.html | htmltojs -o index.js

Specifies the input file

$ htmltojs -i index.html

Specifies the output file

$ htmltojs -i index.html -o index.js

Redirect

$ htmltojs << EOS
<ins class="adsbygoogle"
     style="display:block"
     data-ad-client="ca-pub-xxxxxxxx"
     data-ad-slot="xxxxxxxxx"
     data-ad-format="auto"
     data-full-width-responsive="true"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>
EOS

var _a = document.createElement("ins");
_a.className = "adsbygoogle";
_a.style.display = "block";
_a.dataset.adClient = "ca-pub-xxxxxxxx";
_a.dataset.adSlot = "xxxxxxxxx";
_a.dataset.adFormat = "auto";
_a.dataset.fullWidthResponsive = "true";
document.body.appendChild(_a);
(adsbygoogle = window.adsbygoogle || []).push({});



Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL