-
Notifications
You must be signed in to change notification settings - Fork 66
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 rendering of lists #122
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
corhere
changed the title
Support multi-paragraph definition lists
Fix rendering of lists
Aug 9, 2024
cpuguy83
reviewed
Sep 12, 2024
@@ -13,6 +13,18 @@ written purely in Go so as to reduce dependencies on 3rd party libs. | |||
|
|||
By default, the input is stdin and the output is stdout. | |||
|
|||
# OPTIONS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I realize I should probably include the generated roff in the repo as well so we can see the changes.
cpuguy83
approved these changes
Sep 12, 2024
Needs rebase. |
The AST hierarchy for a list item is always List > Item > Paragraph. Emit newlines when visiting the Paragraph node instead of the Item and List so that Items with multiple Paragraphs and nested Lists correctly render with just the right number of line breaks. Signed-off-by: Cory Snider <csnider@mirantis.com>
List items are already indented paragraphs. There is no need to also increase the relative inset unless the list is nested inside another list. Signed-off-by: Cory Snider <csnider@mirantis.com>
corhere
force-pushed
the
fix-multi-paragraph-lists
branch
from
September 12, 2024 21:05
acef982
to
149c352
Compare
mikelolasagasti
added a commit
to mikelolasagasti/cobra
that referenced
this pull request
Oct 31, 2024
Since cpuguy83/go-md2man 2.0.5 no paraTag is written after "SEE ALSO". In 2.0.4: .SH SEE ALSO .PP \fBroot-bbb(1)\fP, \fBroot-ccc(1)\fP In 2.0.5: .SH SEE ALSO \fBroot-bbb(1)\fP, \fBroot-ccc(1)\fP See: cpuguy83/go-md2man#122 Signed-off-by: Mikel Olasagasti Uranga <mikel@olasagasti.info>
mikelolasagasti
added a commit
to mikelolasagasti/cobra
that referenced
this pull request
Oct 31, 2024
Since cpuguy83/go-md2man 2.0.5 no paraTag is written after "SEE ALSO". With go-md2man 2.0.4: .SH SEE ALSO .PP \fBroot-bbb(1)\fP, \fBroot-ccc(1)\fP With go-md2man 2.0.5: .SH SEE ALSO \fBroot-bbb(1)\fP, \fBroot-ccc(1)\fP See: cpuguy83/go-md2man#122 Signed-off-by: Mikel Olasagasti Uranga <mikel@olasagasti.info>
marckhouzam
pushed a commit
to spf13/cobra
that referenced
this pull request
Dec 11, 2024
Since cpuguy83/go-md2man 2.0.5 no paraTag is written after "SEE ALSO". With go-md2man 2.0.4: .SH SEE ALSO .PP \fBroot-bbb(1)\fP, \fBroot-ccc(1)\fP With go-md2man 2.0.5: .SH SEE ALSO \fBroot-bbb(1)\fP, \fBroot-ccc(1)\fP See: cpuguy83/go-md2man#122 Signed-off-by: Mikel Olasagasti Uranga <mikel@olasagasti.info>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The AST hierarchy for a list item is always
List
>Item
>Paragraph
. Emit newlines when visiting theParagraph
node instead of theItem
andList
so thatItem
s with multipleParagraphs
and nestedLists
correctly render with just the right number of line breaks.Update the man page to show off the new feature.
Stop over-indenting lists which are not nested inside a list item.
Demo
Input
Rendered terminal output
Rendered output from master branch, for comparison