<commit_before>package org.jetbrains.dokka

public class ConsoleGenerator(val signatureGenerator : SignatureGenerator) {
    val IndentStep = "  "

    public fun generate(node: DocumentationNode, indent: String = "") {
        generateHeader(node, indent)
        //generateDetails(node, indent)
        generateMembers(node, indent)
        generateLinks(node, indent)
    }

    public fun generateHeader(node: DocumentationNode, indent: String = "") {
        println(indent + signatureGenerator.render(node))
        val docString = node.doc.toString()
        if (!docString.isEmpty())
            println("$indent\"${docString.replace("\n", "\n$indent")}\"")
        println()
    }

    public fun generateMembers(node: DocumentationNode, indent: String = "") {
        val items = node.members
        for (child in items)
            generate(child, indent + IndentStep)
    }

    public fun generateDetails(node: DocumentationNode, indent: String = "") {
        val items = node.details
        for (child in items)
            generate(child, indent + "  ")
    }

    public fun generateLinks(node: DocumentationNode, indent: String = "") {<commit_msg>Sort members by name for output.<commit_after>package org.jetbrains.dokka

public class ConsoleGenerator(val signatureGenerator : SignatureGenerator) {
    val IndentStep = "  "

    public fun generate(node: DocumentationNode, indent: String = "") {
        generateHeader(node, indent)
        //generateDetails(node, indent)
        generateMembers(node, indent)
        generateLinks(node, indent)
    }

    public fun generateHeader(node: DocumentationNode, indent: String = "") {
        println(indent + signatureGenerator.render(node))
        val docString = node.doc.toString()
        if (!docString.isEmpty())
            println("$indent\"${docString.replace("\n", "\n$indent")}\"")
        println()
    }

    public fun generateMembers(node: DocumentationNode, indent: String = "") {
        val items = node.members.sortBy { it.name }
        for (child in items)
            generate(child, indent + IndentStep)
    }

    public fun generateDetails(node: DocumentationNode, indent: String = "") {
        val items = node.details
        for (child in items)
            generate(child, indent + "  ")
    }

    public fun generateLinks(node: DocumentationNode, indent: String = "") {
{'fraction_non_alphanumeric': 0.11593591905564925, 'fraction_numerical': 0.0, 'mean_word_length': 2.852272727272727, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6796073', 'n_tokens_mistral': 636, 'n_tokens_neox': 615, 'n_words': 158}