INNER CODE UNIT · Python

get_first_para

fralau/mkdocs-macros-plugin · mkdocs_macros/context.py:60

def get_first_para(s) -> str:
    "Get the first para of a docstring"
    first_lines = []
    for row in s.strip().splitlines():
        if not row:
            break
        else:
            first_lines.append(row)
    r = ' '.join(first_lines).strip()
    # fix last character that ends with a semi-colon
    if r.endswith(':'):
        r = r[:-1] + '.'
    return r


def format_value(value):
    "Properly format the value, to make it descriptive"
    # those classes will be processed as "dictionary type"

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…