domdbg

package
v0.0.0-...-ada8b72 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2023 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Overview

Package domdbg implements helpers to debug a DOM tree.

______________________________________________________________________

License

Governed by a 3-Clause BSD license. License file may be found in the root folder of this module.

Copyright © 2017–2021 Norbert Pillmayer <norbert@pillmayer.com>

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dotty

func Dotty(doc *dom.W3CNode, t *testing.T)

Dotty is a helper for testing. Given a DOM node and a testing.T, it will create a Graphiviz image of the DOM tree under `doc` and write it to a file in the current folder, choosing a unique file name. The image is in SVG format.

If an error occurs, t.Error(…) will be set, causing the test to fail.

func ToGraphViz

func ToGraphViz(doc *dom.W3CNode, w io.Writer, styleGroups []string)

ToGraphViz outputs a diagram for a DOM tree. The diagram is in GraphViz (DOT) format. Clients have to provide the root node of the DOM, a Writer, and an optional list of style parameter groups. The diagram will include all styles belonging to one of the parameter groups.

If the client does not provide a list of style groups, the following default will be used:

  • Margins
  • Padding
  • Border
  • Display

Types

This section is empty.

Jump to

Keyboard shortcuts

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