static void generateResourceListing(
            DocGenerationContext context,
            DocWriter writer,
            EntityShape shape,
            List<ResourceShape> resources
    ) {
        writer.pushState(new BoundResourcesSection(context, shape, resources));

        if (resources.isEmpty()) {
            writer.popState();
            return;
        }

        var parentLinkId = context.symbolProvider()
                .toSymbol(shape)
                .expectProperty(DocSymbolProvider.LINK_ID_PROPERTY, String.class);
        var heading = shape.isServiceShape() ? "Resources" : "Sub-Resources";
        writer.openHeading(heading, parentLinkId + "-" + heading.toLowerCase(Locale.ENGLISH));
        writer.openList(ListType.UNORDERED);

        for (var resource : resources) {
            writer.pushState(new BoundResourceSection(context, shape, resource));
            writeListingElement(context, writer, resource);
            writer.popState();
        }

        writer.closeList(ListType.UNORDERED);
        writer.closeHeading();
        writer.popState();
    }
Provides common generation methods for services and resources.
smithy-docgen/src/main/java/software/amazon/smithy/docgen/generators/GeneratorUtils.java