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 that don't contain other container blocks. Respects the prohibition against wrapping text inside inline code blocks and links.
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.1.0.tar.gz
(9.3 kB
view hashes)
Built Distributions
Close
Hashes for md_ulb_pwrap-0.1.0-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | aef0c3b53e9787d67e45d2a0dfd601858f6f28fd723fbd90b7e86e79fb63ae8c |
|
MD5 | 4ebf476f1c621e62c7738280cf6e4206 |
|
BLAKE2b-256 | 2c7ba34e5627a9923614c34c35d757cbcedf290d65613afff98da80516ec2058 |
Close
Hashes for md_ulb_pwrap-0.1.0-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 53810119f0154bc57db5e6d786d424e1cf96ecb7435028a558c8c7b6698ff744 |
|
MD5 | 9d09c9a9378e9ab519078ca6932d627e |
|
BLAKE2b-256 | e84f0904666ae64ea98e499c1905d50c842ddcda2dc32ee8122279c88fc8cedf |
Close
Hashes for md_ulb_pwrap-0.1.0-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4d9ad555c4a5af23254863e1df16cf73925fbaec2ee787a41a3162f12cf393c6 |
|
MD5 | 55b7812282ce9ec995478c5110dac0dd |
|
BLAKE2b-256 | 258ae4edf0056bd075017d9895fdfcb50ce331b6fbf16a93d04f9b399aca5f19 |
Close
Hashes for md_ulb_pwrap-0.1.0-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7c6ebc4d23b4df6df5bc7cd884ec2eb4a07be71dd6ee07c1af808fa19c87e986 |
|
MD5 | 734554d79e3eef3d155e9ce53c0dbedc |
|
BLAKE2b-256 | b0ecf65d2541a3a71e8d16304b09ed6f7da3b4bbd94e48f39c9d04d99f5e328a |
Close
Hashes for md_ulb_pwrap-0.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 14ca8f0d811b6ade80f6bdbcb858ddc03940aa0f419858adf01c1570c66b530c |
|
MD5 | 9aa1aacf547417e6e9894370d0bf8bcf |
|
BLAKE2b-256 | c51b02b90d11753fe0517f145c2108070b0270276b2b8fd13fc71bb135dba87a |
Close
Hashes for md_ulb_pwrap-0.1.0-cp311-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7f538778cdbd8736d94e71fe749b1b43300b1a4e608fcd9df23be2ea75eea610 |
|
MD5 | 889107bc278c0e73b39b63b96da32564 |
|
BLAKE2b-256 | a80148b74db3c9a52e412bbf52112f37b740a7e1adeb7753db317d12a29ec13f |
Close
Hashes for md_ulb_pwrap-0.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d64353d9bfc24cec01508a5d48b8afcd5cb139728b67721524ae59098bb1d75b |
|
MD5 | 0269fbc643fc47a6393fccfc78bd7cc4 |
|
BLAKE2b-256 | dbb3f8ec15def9e433afee7fb20070b5880ff3227a5090565369402e0ffee440 |
Close
Hashes for md_ulb_pwrap-0.1.0-cp311-cp311-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0bb6cfc8cc9808cff31336c1a5de4210487012f9ee3c8cfcf8084ef86077597e |
|
MD5 | 048cd81aad395d20a4dff5d1bfd2d08c |
|
BLAKE2b-256 | f7afaed056b646606394cd1812b67fb205f39c705d9340efa2868e1b8ce198c8 |
Close
Hashes for md_ulb_pwrap-0.1.0-cp310-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 75c80c7beb254ef012d41e02714e9e950d8f6c40d08d0116cf0973711a2c9d11 |
|
MD5 | 6161c2be9c8ddb4379ccd3637f472872 |
|
BLAKE2b-256 | c89943044965dc6ec067ede15c7bed163858d2baf2ef6c8174ae841c11bd9819 |
Close
Hashes for md_ulb_pwrap-0.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ddfec1f48d1a595bd1514c7d9bf726936598dd7ed0221e961e6581bfb87db5da |
|
MD5 | b38d6b8685df271f550734f56b429030 |
|
BLAKE2b-256 | 5f3a74f721bad179d15e73975fcf94caa2a1ac21422c826ce38df3b2b41240f8 |
Close
Hashes for md_ulb_pwrap-0.1.0-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 66ee735f9a59e40dfa56befe5974807bbdac40f7212adea86ed90fcaf0bc1531 |
|
MD5 | 2edcaa1fec3c713a37ffb16f2607cc6f |
|
BLAKE2b-256 | a134d050703d1ccd890e220a6111090d6c4151a4ea412bfc657561cab7b0886b |
Close
Hashes for md_ulb_pwrap-0.1.0-cp39-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b6ceccba13d7a857daec1de72c2f1a017c3e4b887cac0f7b4c2148b6dd52991e |
|
MD5 | 2d16c482c6ed04ee6113cc831e595bf8 |
|
BLAKE2b-256 | c3505d244bc1f445af5f57bbb8779e9fa68c4cf2b8e560e60868d83fa1e4b196 |
Close
Hashes for md_ulb_pwrap-0.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c2bf48cd5c542a856aaa918648ca3122fb02c06961218663b6e7ba458ae9a50a |
|
MD5 | bd2ee3a6bdb3e3eaa17479fe573cb9b3 |
|
BLAKE2b-256 | 6ed0a9344864f546fddd5c1e242ee5fd1070e88735d16d309af9dd6b8adb5966 |
Close
Hashes for md_ulb_pwrap-0.1.0-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7437ade5a4789d8c21a850bff161b27927b29101900dd5027a2d35bfa1f123c6 |
|
MD5 | 91fd8273263851c6c4ff35a2e01f25c5 |
|
BLAKE2b-256 | 9fe9cbd93f7b2c86f787f57fb7dc34dc2196031d7c7c904839e3cdc7e193c10f |
Close
Hashes for md_ulb_pwrap-0.1.0-cp38-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b5d7d9a3fb837e7a7e66e5b2dcef73c3b5fccba3f46c9b3aa3a90422eb49ca32 |
|
MD5 | bf4d08bc3f61e565c7426459282b8438 |
|
BLAKE2b-256 | 57594c450520eeba271d74e4ca51bbd90f3c75f26024238271ee9488a734e9f3 |
Close
Hashes for md_ulb_pwrap-0.1.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 03068dc1b6256a5bac5cb700e60f539a350fc2fa4042ea608f4358d2667853d0 |
|
MD5 | ac0d00e52f3619d34e9799c3fc541505 |
|
BLAKE2b-256 | abc7664261e08de53ddb9247532a050e7c51e80f9263811c1da2fe7fd2c60d7a |
Close
Hashes for md_ulb_pwrap-0.1.0-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | be3816a3081242f03afef31f26c6b1c4ec8f62e693f1a1a39dea578c2f16d48d |
|
MD5 | c66b95a0331f4e8f58aac1262a5a2442 |
|
BLAKE2b-256 | c5fb16b0d03a368be57894df42468103b246746742c3ad0d2172dc42e59411b3 |
Close
Hashes for md_ulb_pwrap-0.1.0-cp37-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | aee967a6086fec0fe40dc04878087e2de44119877a159fa39071bcb57cb01e88 |
|
MD5 | 61d26f9b7bdb20ec1f1020ff95df56e4 |
|
BLAKE2b-256 | 578570309f51a686fc0d6af2a9fe0f856f6205b115994aa5e7a84d6c5052380f |
Close
Hashes for md_ulb_pwrap-0.1.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ef482a25cca7f890f7276f35bbf0d1940177b3baf6d10a9198a57cc0cb7824bb |
|
MD5 | 3e14a7c81789cdc03afc6a09463f777a |
|
BLAKE2b-256 | 66184871f1e1c84ad6a9c4b7797ba18ce6a684be681d66c2c6fff1b6229e9de2 |
Close
Hashes for md_ulb_pwrap-0.1.0-cp37-cp37m-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d080699e9ecc0e04fdab129624c6f676fbee3225d7f8bde44e35756db270e738 |
|
MD5 | dc52a2bbd4259536a7258a3a9bc5212d |
|
BLAKE2b-256 | 223946758130865130c8d9646956e0a829636eb92bdd3d23e3fb086f3efc2fa5 |