def render_inline_code(text):
    """Return text surface representing given text as inline code."""

    text_surf = render_text(
        text=text,
        font_height = NOTO_SANS_MONO_MEDIUM_FONT_HEIGHT,
        font_path = NOTO_SANS_MONO_MEDIUM_FONT_PATH,
        foreground_color = HTSL_GENERAL_TEXT_FG,
    )

    text_rect = text_surf.get_rect()

    bg = Surface(text_rect.inflate(6, 0).size).convert()
    bg.fill(HTSL_CANVAS_BG)

    draw_rect(
        bg,
        HTSL_INLINE_CODE_TEXT_BG,
        bg.get_rect().inflate(0, -2).move(0, 1),
        border_radius=5,
    )

    bg.blit(text_surf, (3, 0))

    return bg
Return text surface representing given text as inline code.
nodezator/htsl/creation.py