Object PageSummaryIndexService

    • Constructor Detail

    • Method Detail

      • generate

         final String generate(FeaturedDocument document, String pageUrl, String title)

        Generate a WPSI YAML summary from a FeaturedDocument.

        Parameters:
        document - The parsed DOM document (never mutated — the algorithm works on a clone).
        pageUrl - The normalized page URL.
        title - The page title (from FeaturedDocument.title).
        Returns:

        A YAML string suitable for saving to a .yml file.

      • detectLinkGroups

         final List<PageSummaryIndexService.SummaryLinkGroup> detectLinkGroups(FeaturedDocument document)

        Detect link groups — coherent collections of item cards where each card contains one or more links.

        Algorithm: cluster by visual geometry (bounding box), then walk up the DOM to find the nearest container element.