Python bindings for Rust crate md-ulb-pwrap.
Project description
md-ulb-pwrap
Markdown paragraph wrapper using Unicode Line Breaking Algorithm. Includes a Rust library with Python bindings.
Wrap a Markdown paragraph using a maximum desired width. Only works for paragraphs without other container blocks. Respects the prohibition against wrapping text inside inline code blocks and other tweaks for Markdown inlines syntax.
Rust library
cargo add md-ulb-pwrap
use md_ulb_pwrap::{ulb_wrap_paragraph};
assert_eq!(
ulb_wrap_paragraph(
&"aaa ``` `` ` a b c ``` ccc",
3,
3,
),
"aaa\n``` `` ` a b c ```\nccc",
);
Python bindings
pip install md-ulb-pwrap
from md_ulb_pwrap import ulb_wrap_paragraph
markdown = "aaa ``` `` ` a b c ``` ccc"
expected_result = "aaa\n``` `` ` a b c ```\nccc"
assert ulb_wrap_paragraph(markdown, 3, 3) == expected_result
Reference
ulb_wrap_paragraph(text: str, width: int, first_line_width: int) -> str
- text (str): The text to wrap.
- width (int): The maximum width of the lines after the first.
- first_line_width (int): The maximum width of the first line.
Returns (str): The wrapped text.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
md_ulb_pwrap-0.0.2.tar.gz
(9.2 kB
view hashes)
Built Distributions
Close
Hashes for md_ulb_pwrap-0.0.2-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0fbb8b1887507541dc9e95030af0bf95356d1adb0bb85c537b786aa402512933 |
|
MD5 | b26618def2ac7fd1389be7abc6d9d4b1 |
|
BLAKE2b-256 | ad75e5092bceabe649d9d42a939d1ee16d40f0f51a9542870d1e8d4535f313df |
Close
Hashes for md_ulb_pwrap-0.0.2-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 69ad7e3f1216eb9f421ddb54ae5a4cf8d6474452688fca7dce2940db8eae97ce |
|
MD5 | c23b213dcbafa3daf29d9bf3abf16fb1 |
|
BLAKE2b-256 | 4a0fbed0a9490ead930ecfdcc6aed114a16fd363ea82998a5e6c663ed7e5bd64 |
Close
Hashes for md_ulb_pwrap-0.0.2-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | efa44be897fab30d5435083831622b0053647f6d80621666c7f8031f2e246885 |
|
MD5 | a11cac9d8c37225c682a1048130fd591 |
|
BLAKE2b-256 | 49bbd840a006a01366b8a4cddc5096d52153335db75bd74f8351dd1bc8f6cdcb |
Close
Hashes for md_ulb_pwrap-0.0.2-cp311-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3e524fa4ebb360db4c1a04cdb6a5f3c8a01f55e1205c089a3ed46a0e4c2485d6 |
|
MD5 | 7c2e56da1b0014743fc9f839f0dd0f89 |
|
BLAKE2b-256 | f54992b19cbab1414c28d518279099c86466b3de974a4c261cded2aba1d2d210 |
Close
Hashes for md_ulb_pwrap-0.0.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a75d06221a8f1f231099c2292f46190772e03f8cdf884701418ff9593294ec7d |
|
MD5 | 3328f49b939122de5daf344b5c036515 |
|
BLAKE2b-256 | d63bdc31a7d3c8494ac08819ea496f7d78f80984b482cd6c245aee884e705788 |
Close
Hashes for md_ulb_pwrap-0.0.2-cp311-cp311-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5f86c00dba0958d9b465bf185a797c7360af1d7df44f590556cd54206e6da9e7 |
|
MD5 | 3bdf5e8fe2759f2107e4425d679f81f0 |
|
BLAKE2b-256 | d5f0d21bc6d94f3c4ef7772357fed4b44f94a249292d6db68389a2de07486e75 |
Close
Hashes for md_ulb_pwrap-0.0.2-cp310-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1e12da80022b7ce460fbe94eb08183eaf9a0304e7db3c3a0e3b27c07bd7d1219 |
|
MD5 | 7bf2f91fe394d0dae889412fa0c62dff |
|
BLAKE2b-256 | aa56a1afa726aa1f9fdb1ed744d2a00e5a653b1eda22a7b1359d45228a9ea867 |
Close
Hashes for md_ulb_pwrap-0.0.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 98f189edfa48849a4f5ab46a35750fc9b6ec5609a9a159f20e52ab307c6f1433 |
|
MD5 | 6a620707cb2d08cf8b782d53277d4af7 |
|
BLAKE2b-256 | 2f14bd12bb4842efb270e0036922a3c14768e055cb9d078d9a78d5951d95ee4d |
Close
Hashes for md_ulb_pwrap-0.0.2-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1e8dd758d048293f653a67d8d20cf6a77d5b029b41ef791f1179a9201d792e9e |
|
MD5 | a31ece5ba818e34c89c9eb3148c61c63 |
|
BLAKE2b-256 | 59e04aa560f7fbf0b8bbc70481f087843ac7c7cabe291c4dad7037984ba8c019 |
Close
Hashes for md_ulb_pwrap-0.0.2-cp39-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bf767148aa54ddf3f40c7da3c8cdc1ae5a63326234d6e3a40496256ea739fd1c |
|
MD5 | e118fb023e75c33a0380354c4e8d9bf5 |
|
BLAKE2b-256 | b1034583fccb5fb6140a5bb550cceee2c6e563cbc732af3d8bc07f86dcae95cb |
Close
Hashes for md_ulb_pwrap-0.0.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7f07984084b5d5ca9975e4f611420ec92f35a36866a9bacec41191a86711c1b5 |
|
MD5 | d70a27f79dd727081cbbdaa1ea78b72f |
|
BLAKE2b-256 | d6d1c23f74b4729102c22e09ebc26580c19acf4cd5b9882ae41638dfcb0a0b61 |
Close
Hashes for md_ulb_pwrap-0.0.2-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1a217e75419c12820fa35d2690620ba2c8cb3ba1ad74cb3ba6ba93859da069f7 |
|
MD5 | 35bec93af9b5a5a1956214367117c9ad |
|
BLAKE2b-256 | 27707697b21d78f901ab9208ed32687d8867dbde8eacc616def5bc61666db69f |
Close
Hashes for md_ulb_pwrap-0.0.2-cp38-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9a2ae202fa795411028be2f2f62e383dc1edde2f0c62aba9e9803c8a3c6cba84 |
|
MD5 | db046a6852ca5c283ee3f37195cd9c3d |
|
BLAKE2b-256 | 9e0d6f6412a4d4d647537ceb85ab11193b9e83e28ef167ef8ee4e53115997aa8 |
Close
Hashes for md_ulb_pwrap-0.0.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 49c92f8041af3188190b4d6f4d885c58965a3cb2b56e74da6c6d5619b0ce871a |
|
MD5 | 74852beaa065b44b4b16eb21bfcf22a5 |
|
BLAKE2b-256 | e65bfaa86cef6f02be04691223c9a2763c763555ed9ffc847c186ddaed22d70b |
Close
Hashes for md_ulb_pwrap-0.0.2-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 606e2b8b442d61a265baeffb96f70f1860ebcf3cbfaefa0f301c2106c759531d |
|
MD5 | 0ff0aa7e0e898ceac9cb83d59c6ee213 |
|
BLAKE2b-256 | baa0cc3c727b9b9e638eb4a42c3bc8ee5124629a0719153b29e6121484b41771 |
Close
Hashes for md_ulb_pwrap-0.0.2-cp37-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d848c052a36a9f6358f74a6395859808e34228b4c34f4e62a416807c81455d07 |
|
MD5 | 73f35c710bc5f80ca8ee7a8308eba9d5 |
|
BLAKE2b-256 | 1ad2b92b31c9bc027033e360df74b4a5d82ab91be666712aae6c3d694b487845 |
Close
Hashes for md_ulb_pwrap-0.0.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c1e8af0eb6859316561a3d483614779f9ea85c9d6c3700f1f65464505c519df4 |
|
MD5 | 2f70c179b5118ab67d4eb6d62b067164 |
|
BLAKE2b-256 | a06e56a0f1876ad965569588cebea2a66fed42c8f0dc8bb19ffcbc69fa242c76 |
Close
Hashes for md_ulb_pwrap-0.0.2-cp37-cp37m-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4f528d2506bfc4cb1d2db8cef3b3e0603dff3a61fed832c4973535e5a2445fa1 |
|
MD5 | 219a62e6557162f03c912b8ae7887bb1 |
|
BLAKE2b-256 | 4ed91e95b6458c0dbd0aaacc0728e2e8a2f84dbc3577342d839e37952bbc5173 |