✨ NEW: Capture comment text as one-line codelink description - #96
Conversation
a71d495 to
658083e
Compare
Add a `description_position` option to `OneLineCommentStyle` that lets the comment lines directly above or below a one-line marker be used as the body/content of the generated need. Defaults to `none` (disabled) to preserve existing behavior. Signed-off-by: Florian Roks <florian.roks@mercedes-benz.com>
658083e to
f45289c
Compare
|
Thanks for the PR. Same problem as in What's the markup of that text? Currently sphinx-codelinks uses |
That's a valid concern I didn't think of - I locally added m2r2 and a mapping for each programming comment language language and a generic convert function. I put rust/go in a static map as "markdown", so the convert function then looks that up, and utilizes m2r2 to convert it to rst - this should be sufficient for the item description and title, and be extensible for other conversion types in the future. I still have to validate it locally, but what are your thoughts on that solution? |
Add a
description_positionoption toOneLineCommentStylethat lets the comment lines directly above or below a one-line marker be used as the body/content of the generated need. Defaults tonone(disabled) to preserve existing behavior.Why? When using one-line comments, the description with the links is usually empty, when the rest of the comment (where the one-line comment appears) would have all of the information needed. This can also be used to combine the description for the unit construction (by utilizing the comment), with the actual implementation.