File size: 839 Bytes
fe19632
528bf3d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fe19632
528bf3d
fe19632
 
 
528bf3d
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
from anyqa.config import get_sources


def generate_source_table():
    # Define the headers for the table
    headers = ["Type", "Name", "URL"]

    # Create the Markdown string for the headers
    header_str = " | ".join(headers)

    # Create the Markdown string for the header separator
    separator_str = " | ".join(["---"] * len(headers))

    # Initialize an empty list to hold the rows
    rows = []

    # Add each row to the list
    for source in get_sources():
        row = [
            source.get("domain", ""),
            source.get("name", ""),
            source.get("url", ""),
        ]

        row_str = " | ".join(row)
        rows.append(row_str)

    # Combine all the parts into the final Markdown table
    markdown_table = header_str + "\n" + separator_str + "\n" + "\n".join(rows)

    return markdown_table