-
Notifications
You must be signed in to change notification settings - Fork 150
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
Allow preserving newlines #163
Comments
I agree with the feature request, but I don't have any solution. Do you have any proposition? |
One idea would be |
Now, a workaround is using use structopt::StructOpt;
static MANYLINUX_HELP: &str = r#"Control the platform tag on linux.
- `1`: Use the manylinux1 tag and check for compliance
- `1-unchecked`: Use the manylinux1 tag without checking for compliance
- `2010`: Use the manylinux2010 tag and check for compliance
- `2010-unchecked`: Use the manylinux1 tag without checking for compliance
- `off`: Use the native linux tag (off)
This option is ignored on all non-linux platforms"#;
#[derive(StructOpt, Debug)]
struct Opt {
#[structopt(long, raw(help = "MANYLINUX_HELP"))]
manylinux: Option<String>,
}
fn main() {
let opt = Opt::from_args();
println!("{:?}", opt);
} But it will not be used as doc comment. Something like |
Huh I thought I had checked that this doesn't work but apparently it does, so I'll go with that for now. Thanks! |
Works around [1] by using literal `{n}` newline escapes to make structopt's formatter break lines properly. [1]: TeXitoi/structopt#163
as |
Via raw methods:
Come on, people, does anyone read docs these days? |
Thanks, I've read the docs, multiple times, but missed it. (English is not my mothertongue, please bear with me) |
I believe this is a clear indication that our docs aren't as great as we thought they are. We need to improve them, probably along with the error message. |
OK for |
The have the following docstring:
This renders fine in rustdoc:
Structopt however collapses those lines:
Since I fear that full markdown to text rendering like pandoc is currently out of scope, it would great to have a way to preserve newlines.
The text was updated successfully, but these errors were encountered: