Python Bidi layout wrapping the Rust crate unicode-bidi
Overall
score
93%
A utility that processes mixed left-to-right (LTR) and right-to-left (RTL) text in code comments, ensuring proper visual display for documentation generators and IDE preview panes.
Process text containing mathematical operations alongside RTL text, ensuring both the mathematical operators and RTL content display correctly.
Process text with quoted content that may contain nested punctuation or parenthetical information in RTL context.
Handle text with embedded directional formatting to create explicit left-to-right or right-to-left regions within larger text blocks.
@generates
def format_comment(text: str, *, use_uppercase_as_rtl: bool = False) -> str:
"""
Format bidirectional text for display in documentation and IDEs.
Args:
text: The text to format containing mixed LTR/RTL content
use_uppercase_as_rtl: Debug mode to treat uppercase as RTL (for testing)
Returns:
Formatted text with proper bidirectional ordering for visual display
"""
passProvides bidirectional text algorithm implementation for proper text reordering.
@satisfied-by
Install with Tessl CLI
npx tessl i tessl/pypi-python-bididocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10