public void setCurrentSectionLevel()

in log4j-docgen/src/main/java/org/apache/logging/log4j/docgen/processor/AsciiDocData.java [154:171]


    public void setCurrentSectionLevel(final int sectionLevel) {
        if (sectionLevel < currentSectionLevel) {
            // Close all subsections
            while (sectionLevel < currentSectionLevel) {
                popNode();
                currentSectionLevel--;
            }
            // Create sibling section
            popNode();
            pushChildNode(SectionImpl::new);
        } else {
            // Create missing section levels
            while (sectionLevel > currentSectionLevel) {
                pushChildNode(SectionImpl::new);
                currentSectionLevel++;
            }
        }
    }