Documentation
¶
Index ¶
- Constants
- type AtRuleCssStatementsReport
- type CaniuseDB
- type CssDimentionsReport
- type CssFunctionsReport
- type CssPropertyReport
- type CssPseudoSelectorsReport
- type CssSelectorType
- type CssSelectorTypeReport
- type CssVariablesReport
- type HTMLTagReport
- type HtmlAttributesReport
- type ImgFormatsReport
- type ParseReport
- type ParserEngine
Constants ¶
View Source
const ( WHITESPACE = " \t\r\n\f" LIMIT_REPORT_LINES = 30 TWO_KEYS_MERGE_FORMAT = "%s||%s" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CaniuseDB ¶
type CaniuseDB struct { HtmlTags map[string]map[string]interface{} `json:"html_tags"` HtmlAttributes map[string]map[string]interface{} `json:"html_attributes"` CssProperties map[string]map[string]interface{} `json:"css_properties"` AtRuleCssStatements map[string]map[string]interface{} `json:"at_rule_css_statements"` CssSelectorTypes map[string]interface{} `json:"css_selector_types"` CssDimentions map[string]interface{} `json:"css_dimentions"` CssFunctions map[string]interface{} `json:"css_functions"` CssPseudoSelectors map[string]interface{} `json:"css_pseudo_selectors"` ImgFormats map[string]interface{} `json:"img_formats"` CssVariables interface{} `json:"css_variables"` }
type CssDimentionsReport ¶
type CssFunctionsReport ¶
type CssPropertyReport ¶
type CssSelectorType ¶
type CssSelectorType int
css selectors
const ( ADJACENT_SIBLING_COMBINATOR_TYPE CssSelectorType = iota // The adjacent sibling combinator (`h1 + p`) allows to target an element that is directly after another. ATTRIBUTE_SELECTOR_TYPE // The attribute selector (`[attr]`) targets elements with this specific attribute. CHAINING_SELECTORS_TYPE // Chaining selectors (`.foo.bar`) allows to apply styles to elements matching all the corresponding selectors. CHILD_COMBINATOR_TYPE // The child combinator is represented by a superior sign (`>`) between two selectors and matches the second selector if it is a direct child of the first selector. CLASS_SELECTOR_TYPE // The class selector (`.className`) allows to apply styles to a group of elements with the corresponding `class` attribute. DESCENDANT_COMBINATOR_TYPE // The descendant combinator is represented by a space (` `) between two selectors and matches the second selector if it has ancestor matching the first selector. GENERAL_SIBLING_COMBINATOR_TYPE // The general sibling combinator (`img ~ p`) allows to target any element that after another (directly or indirectly). GROUPING_SELECTORS_TYPE // Grouping selectors (`.foo, .bar`) allows to apply the same styles to the different corresponding elements. ID_SELECTOR_TYPE // The ID selector (`#id`) allows to apply styles to an element with the corresponding `id` attribute. TYPE_SELECTOR_TYPE // Type selector or element selectors allow to apply styles by HTML element names. UNIVERSAL_SELECTOR_STAR_TYPE // The universal selector (`*`) allows to apply styles to every elements. )
func (CssSelectorType) String ¶
func (d CssSelectorType) String() string
type CssSelectorTypeReport ¶
type CssVariablesReport ¶
type HTMLTagReport ¶
type HtmlAttributesReport ¶
type ImgFormatsReport ¶
type ParseReport ¶
type ParseReport struct { HtmlTags map[string]map[string]HTMLTagReport `json:"html_tags"` HtmlAttributes map[string]map[string]HtmlAttributesReport `json:"html_attributes"` CssProperties map[string]map[string]CssPropertyReport `json:"css_properties"` AtRuleCssStatements map[string]map[string]AtRuleCssStatementsReport `json:"at_rule_css_statements"` CssSelectorTypes map[string]CssSelectorTypeReport `json:"css_selector_types"` CssDimentions map[string]CssDimentionsReport `json:"css_dimentions"` CssFunctions map[string]CssFunctionsReport `json:"css_functions"` CssPseudoSelectors map[string]CssPseudoSelectorsReport `json:"css_pseudo_selectors"` ImgFormats map[string]ImgFormatsReport `json:"img_formats"` CssVariables CssVariablesReport `json:"css_variables"` }
func ReportFromHTML ¶
func ReportFromHTML(document []byte) (*ParseReport, error)
type ParserEngine ¶
type ParserEngine struct {
// contains filtered or unexported fields
}
func InitParser ¶
func InitParser() *ParserEngine
func (*ParserEngine) Report ¶
func (prs *ParserEngine) Report(document []byte) (*ParseReport, error)
Click to show internal directories.
Click to hide internal directories.