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

Fix the issues of strip and merge desc for code block #251

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

chenyukang
Copy link

The strip and merge operations in get_doc and merge_description_lines will mess up code block format(or markdown format).

This PR tries to avoid it in some scenarios.

@fhennig
Copy link

fhennig commented Nov 29, 2023

Hey! Great, this is exactly what I'd need, I'd be happy if this gets merged! Currently workaround would be to use #[schemars(description=...)] as it doesn't do the same processing, but it'd be much nicer to continue writing the docs in the Rust doc strings.

@chenyukang
Copy link
Author

chenyukang commented Nov 30, 2023

#[schemars(description=...)] is not a proper way for long description content.

For our project, we have a lot of very long documents in markdown:
https://github.com/nervosnetwork/ckb/blob/develop/rpc/src/module/subscription.rs#L86-L171

my current PR is fixing the current strip and merge to avoid mess up format, maybe we should also add an option to don't do this kind of thing, keep good style is the responsibility of users.

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

Successfully merging this pull request may close these issues.

2 participants