Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: unwrapped paragraphs #160

Open
Lucretiel opened this issue Feb 6, 2023 · 8 comments
Open

Feature Request: unwrapped paragraphs #160

Lucretiel opened this issue Feb 6, 2023 · 8 comments

Comments

@Lucretiel
Copy link

It should be possible for cargo-rdme to output prose paragraphs that are not wrapped into multiple lines, but instead are on a single line. Some projects prefer this style because of, among other reasons, the friendliness towards git diffs.

@orium
Copy link
Owner

orium commented Feb 13, 2023

I think a useful generalization of this feature is to allow the maximum line length to be set. Maybe some people like 80 columns on the README file and some other 120. To have no wrap that configuration would be set to infinity.

@pczarn
Copy link

pczarn commented Feb 13, 2023

I would like to work on this issue. @orium ?

@orium
Copy link
Owner

orium commented Feb 13, 2023

Sounds good. Take a look at the Markdown structure and add a function like fn with_line_width(&self, line_width: Option<usize>) -> Markdown.

Make sure it doesn't break markdown incorrectly. Use pulldown-cmark, which is already a dependency to parse and process the markdown. Add a decent amount of unit tests.

It should also add both a command line flag (--line-width) and configuration file setting (line-width). Add integration tests for both please.

Also, it shouldn't just make lines shorter. They can also be made longer if the original rustdoc was not using all the width we want in the README.md.

@pczarn
Copy link

pczarn commented Feb 13, 2023

Ok.

@pczarn
Copy link

pczarn commented Feb 14, 2023

@orium
Should I wrap list items as well? Example:

* This is another item.
    * This is yet another
next level item. The purpose
of this level is to check
for correct identation within
lists.
* Item.
*  Item with some whitespace.
*   Item with more whitespace.

@orium
Copy link
Owner

orium commented Feb 14, 2023

Yes. Ideally what can be nicely wrapped should be wrapped. (For instance, for tables I don't think there is a way to wrap them, but even if there was we probably shouldn't.)

@pczarn
Copy link

pczarn commented Feb 14, 2023

Should I indent wrapped lines in lists, or leave them unindented like above?

Indentation for lists is harder to implement.

@orium
Copy link
Owner

orium commented Feb 14, 2023

Leave them unindented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants