Crates.io | runwrap |
lib.rs | runwrap |
version | 0.2.0 |
source | src |
created_at | 2021-06-03 19:49:40.329166 |
updated_at | 2021-06-07 10:28:12.949423 |
description | Text wrapping for Markdown |
homepage | |
repository | https://github.com/veikman/runwrap |
max_upload_size | |
id | 405826 |
size | 41,879 |
This is a library to wrap and unwrap Markdown, both for ease of editing and for version control. It’s implemented in functional-style Rust.
runwrap
is based on the textwrap
and pulldown_cmark
crates. The latter is
designed to implement the CommonMark specification.
punwrap
(repo).The following may or may not be fixed and should therefore be considered unstable behaviour.
Currently, only a maximum width can be specified for wrapping text. More
advanced options cannot currently be passed through runwrap
to textwrap
.
Width settings passed to wrap
and rewrap
are applied in the scope of each
individual paragraph. This means that the overall line width of list items can
exceed the passed value.
For the same reason, list items wrap to column zero; they are not neatly indented.
runwrap
acts only upon what pulldown_cmark
identifies as paragraphs. This
includes normal paragraphs of running text as well as some list items etc.,
because it is tied to would-be <p>
elements of HTML, not paragraphs in the
typographical sense.
This is a regular paragraph.
* This is a list item.
Because this list item consists of multiple paragraphs, it
(each of its two paragraphs) can be affected by `runwrap`.
A list item made up of one paragraph of text is not identified as a paragraph
by pulldown_cmark
, and is therefore ignored, even if it spans multiple lines.
* This is ignored because it’s one bullet for one paragraph.
* Also
ignored.
Copyright 2021 Viktor Eikman
runwrap
is licensed as detailed in the accompanying file LICENSE.