[[fetch]] files = ["/reflow.py"] from reflow import reflow def run_reflow(): content = Element("input-text").element.value width = int(Element("input-width").element.value) indent = int(Element("input-indent").element.value) comments = Element("input-comment").element.value text = reflow(content, width, indent, comments) display(text, target="display-write", append=False)

Text Reflow - PyScript

This app will take any text included in the textbox below, and wrap it to the provided width and indentation. It was created to help with formatting python docstrings so that descriptive text could be written normally, and then pasted into here before being put into a function.

If you paste text and the output is not updated correctly, try pressing enter or clicking on an input field. This function is set to trigger on key down or click on an input parameter.

Output