strapi

package module
v0.0.0-...-fc7c7cc Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2024 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseStrapi

func ParseStrapi(b []byte, opts ...ParseOption) (*html.Node, *html.Node, error)

ParseStrapi takes a Strapi rich JSON response and parses it into an *html.Node tree and a style sheet.

Types

type ParseOption

type ParseOption func(*parser)

func ParseOptionClassMap

func ParseOptionClassMap(m StyleMap) ParseOption

Styling to include in the output. Will override default values. See DefaultStyle for example structure.

func ParseOptionReturnDoc

func ParseOptionReturnDoc(shouldReturnDoc bool) ParseOption

If true, the parsing includes the full HTML tree, including <html>, <head>, and <body> tags; good for rendering the response as-is. If false, only includes the parsed tags, which is better for embedding (e.g. in a template).

type StyleMap

type StyleMap map[string]map[string]string

func DefaultStyle

func DefaultStyle() StyleMap

Jump to

Keyboard shortcuts

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