module RubyLsp::Requests::Support::Common

def markdown_from_index_entries(title, entries, max_entries = nil, extra_links: nil)

: (String title, (Array[RubyIndexer::Entry] | RubyIndexer::Entry) entries, ?Integer? max_entries, ?extra_links: String?) -> String
def markdown_from_index_entries(title, entries, max_entries = nil, extra_links: nil)
  categorized_markdown = categorized_markdown_from_index_entries(title, entries, max_entries)
  markdown = +(categorized_markdown[:title] || "")
  markdown << "\n\n#{extra_links}" if extra_links
  <<~MARKDOWN.chomp
    #{markdown}
    #{categorized_markdown[:links]}
    #{categorized_markdown[:documentation]}
  MARKDOWN
end