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.3.tar.gz
(9.3 kB
view hashes)
Built Distributions
Close
Hashes for md_ulb_pwrap-0.0.3-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9df907194b627308a3f57d767bde37b1794a0959805a4aa8246810b3df94dd8a |
|
MD5 | de59b95d8a7947ec9f9ea7e03d544ffd |
|
BLAKE2b-256 | a8be355ef29f1594bfff823b7a527ee29819bb26dba38228a725d56f78bd4c49 |
Close
Hashes for md_ulb_pwrap-0.0.3-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f8f3a2b1e9a9e5b0b9c48ca1b43f28f7da8776f28ae45dd0cad089004c96137d |
|
MD5 | e3c2b92181c52ec07e399225d2d65e57 |
|
BLAKE2b-256 | 04e4bfcd3dea2e1ad7f2d2230e0629e7f993847b88745c29036bcbd1e634b30f |
Close
Hashes for md_ulb_pwrap-0.0.3-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 50256a5cc912a2e0705b8c19bc677726d482ab863520b3604100a3dbecdb4e0b |
|
MD5 | f809b41a3ef7ba8ea0acf954ab9674b3 |
|
BLAKE2b-256 | 171485c3de8824cc7bc9c235d1c4cbc123d33865316874780e588eb62dcaa453 |
Close
Hashes for md_ulb_pwrap-0.0.3-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 766d3b036546ef1eb4cc78b13f4de67fdf08861d253c3db7e1c3500a00c92d38 |
|
MD5 | a22f7229dd39fefe6a219792aba144ee |
|
BLAKE2b-256 | 1275ca306c59f193ceb1735591a32b02b7dea4215bd1ca6376d02984a071f583 |
Close
Hashes for md_ulb_pwrap-0.0.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c36b5f2a47db2b8f874f89b719c59bb284857b630010933cde94a84894558ba4 |
|
MD5 | a680eb04e81c33782320019db9af97f3 |
|
BLAKE2b-256 | bdf5868a9d00b3c0dde4ade4af502c0dcd857468340949980420243256f83429 |
Close
Hashes for md_ulb_pwrap-0.0.3-cp311-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 33d6817d4e2857d8c5e914348914b55e33a1a04cd80df7d8fc136c1ecc9b8033 |
|
MD5 | 4ced547944a65099e0195c454b5b85d5 |
|
BLAKE2b-256 | 9b4fa67aeee61d94f04ee0739ac525b211b2bb45cc163ca3152a5f4aab800c13 |
Close
Hashes for md_ulb_pwrap-0.0.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3cc8049a39ebc75b5ea7f0e3e50e4ef8c27ecc0fb9c6ef75ac6da310987898a8 |
|
MD5 | 8fe109a81e00f1be49d9761d933b2119 |
|
BLAKE2b-256 | 4196c82995bdf7f539ad26057b239f638d8fd686345fdb86ea0b1998b594b659 |
Close
Hashes for md_ulb_pwrap-0.0.3-cp311-cp311-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6d709f62fef0114f6b3e9dee124646bd22e676a012a99bd09e504f56edb6d06e |
|
MD5 | 1a7ab84cafc866696cd2687a5abaffb1 |
|
BLAKE2b-256 | cbe0c9d71a366ac872647dd9c08d0cab80f75d05d8dfb50ec6cdf8b1818cce18 |
Close
Hashes for md_ulb_pwrap-0.0.3-cp310-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b1506e975f0b052d86978a3615965f8c7487429a27c1fce6df579f6c10896810 |
|
MD5 | 0eb0e4c0f67768eeb93eb8ec72597bee |
|
BLAKE2b-256 | 7401dcc3ac9790de9744ec223114c1763d109e56fda9699aa6cdff40d467c295 |
Close
Hashes for md_ulb_pwrap-0.0.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f82fc7301b4659aa2db2134d17d94afbaf60adf383f51e74c6d3f6069894ffdf |
|
MD5 | c1a122263584699d432c145645e697e2 |
|
BLAKE2b-256 | d3a5e8d4b80763d8e23d58f8d834626e62e47f84eb43922b0601b768a93c454b |
Close
Hashes for md_ulb_pwrap-0.0.3-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 96beceb56f75fb4d8e824e7aafa1d50352f03305f9b1f00445f844b774094b74 |
|
MD5 | 30bc17e2aa49212587d8acb022aa8585 |
|
BLAKE2b-256 | 957151bbfe2a400da9d5e9f30060b3b8ee771bc5bc5f298c921a1921667fc757 |
Close
Hashes for md_ulb_pwrap-0.0.3-cp39-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b4ff83fec138e59aa88f7bc032d29aaaf1e02eb7eedf4d715c837dd2ca14606e |
|
MD5 | 4e1bd7f07c3ba0832c8cd935a53cf628 |
|
BLAKE2b-256 | 117245f08e0fe2b66ab84b68a49bdab066677c644830cdb9835bc88ec7b07caf |
Close
Hashes for md_ulb_pwrap-0.0.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a6b50968f793eb0e25336c47dca54e891b2bd56abbbee112c4e163b722590f03 |
|
MD5 | 3515403927b374aeb9a65ff7c9100b6f |
|
BLAKE2b-256 | dc18200576cabbd8bb23f19bedcb72ca6de8b9a8cb5c2f104ab88b9ca607098a |
Close
Hashes for md_ulb_pwrap-0.0.3-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 92845c2b5f90879e3a3a19a835a94a00e39225aba8ba8f98d24a779ea65170a0 |
|
MD5 | d637aa4487787a51444cb720209a8193 |
|
BLAKE2b-256 | 62ea09bd42b496241eebc8a63548b5a245f2d37ebf2818c805202f8d94b57773 |
Close
Hashes for md_ulb_pwrap-0.0.3-cp38-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 72b2cd110be3654e29de91d601f551ddee999075e2f334e481cfa358361f08a3 |
|
MD5 | bb327f94d3c70c573f9ba0b35142062e |
|
BLAKE2b-256 | 714beedced1c1c0b6e977cca80e58a46f0111c753fb8c6a8c9cb92b419498ce4 |
Close
Hashes for md_ulb_pwrap-0.0.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a78d09b6a7760d2cdf6d868e633ce7d40a3f7944713941209167770a9186272f |
|
MD5 | 9c50003e496923cc1fc9043cd231ff0e |
|
BLAKE2b-256 | 466a4074eda1d337b912afebec833def0d81624fdc0ec2419c62de6db10f81b6 |
Close
Hashes for md_ulb_pwrap-0.0.3-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 25db5785aac07a8ee75503046542e891f1fb3ea9d32db1ae9b55488b962bc81c |
|
MD5 | 6a2c6a2c1be7016df38dd73357a7e5b8 |
|
BLAKE2b-256 | 827021e18ebd8d6d2f426fba43bab898fe7bbeffe51fda08d0c47584f1be3944 |
Close
Hashes for md_ulb_pwrap-0.0.3-cp37-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9575170dcc6ffd1c84384b93788143eb582a3b593d53e7d610d9b0e1906944cb |
|
MD5 | 24b072aef3f451cf17dc20a4244c8751 |
|
BLAKE2b-256 | 67895d5faa6b9562ed63060903ee429538d6379a3bbe70f5460aad8a8f4c1a2b |
Close
Hashes for md_ulb_pwrap-0.0.3-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2d7d11463fd2f1558a27652e194a16d26972ace29efebdb04612c9701c059296 |
|
MD5 | 344b46ce8f97a6207b8ef85d16c533f9 |
|
BLAKE2b-256 | 8d7ee44f8375f39ad1089ac5b2aa75b08d0e70010ad7c172f5f4c3e26f22244f |
Close
Hashes for md_ulb_pwrap-0.0.3-cp37-cp37m-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4032ebaae9a332772307100c30b93f8b4038eb5de553ae096de80a1e4ebd4b6e |
|
MD5 | a74d9146ad00ee0a293a2bb877cffa99 |
|
BLAKE2b-256 | 8c90f1c98b09cc389365a13f32100adaf69569045789dfb5f22ce3067882c893 |