doc.go 905 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. // Package premailer is for inline styling.
  2. //
  3. // import (
  4. // "fmt"
  5. // "github.com/vanng822/go-premailer/premailer"
  6. // "log"
  7. // )
  8. //
  9. // func main() {
  10. // prem, err := premailer.NewPremailerFromFile(inputFile, premailer.NewOptions())
  11. // if err != nil {
  12. // log.Fatal(err)
  13. // }
  14. // html, err := prem.Transform()
  15. // if err != nil {
  16. // log.Fatal(err)
  17. // }
  18. //
  19. // fmt.Println(html)
  20. // }
  21. // // Input
  22. //
  23. // <html>
  24. // <head>
  25. // <title>Title</title>
  26. // <style type="text/css">
  27. // h1 { width: 300px; color:red; }
  28. // strong { text-decoration:none; }
  29. // </style>
  30. // </head>
  31. // <body>
  32. // <h1>Hi!</h1>
  33. // <p><strong>Yes!</strong></p>
  34. // </body>
  35. // </html>
  36. //
  37. // // Output
  38. //
  39. // <html>
  40. // <head>
  41. // <title>Title</title>
  42. // </head>
  43. // <body>
  44. // <h1 style="color:red;width:300px" width="300">Hi!</h1>
  45. // <p><strong style="text-decoration:none">Yes!</strong></p>
  46. // </body>
  47. // </html>
  48. package premailer