-
-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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
Replace ronn with Kramdown's converter #16868
Conversation
Another benefit: our docs linter seems to now actually work on the Manpage.md whereas before it seemed to not pick up things. |
d97d848
to
13c421b
Compare
This is a huge improvement for readability. Looks great. Is there any way for the URLs at the very end of the man page to be displayed in the roff output as they are in the HTML? |
By this do you mean the formatting of hyperlinks themselves? Right now this is using the groff syntax of: .UR https://github\.com/Homebrew/brew/issues
.UE ( which macOS man viewer automatically renders as being surrounded by I think it displays in bold instead in |
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.
Thanks again @Bo98!
ronn
is old and hasn't been updated in 14 years. The same applies to some of its dependencies and some of those dependencies are now breaking and will never be fixed as they have been made EOL.ronn-ng
does exist, and does a good job at carrying on whereronn
left off. It however has a dependency on Nokogiri which we went through great measures to get rid of before and Nokogiri does have problems when paired with our Bundler standalone file which only supports one platform/arch at a time. I feel like we can do better thanronn
flow anyway, because we had various hacks on top of it already.The flow has always been a bit weird:
Our docs website uses Kramdown and it turns out Kramdown itself has a manpage converter. So we can instead do:
generate-man-completions
itself)It is also Ruby code rather than something we shell out to which means we have more control over it. Previously we had a ton of horrible looking
gsub
hacks:brew/Library/Homebrew/manpages.rb
Lines 98 to 106 in cd1f040
Customisability is also useful in order to maintain compatibility with what we have. We customise Kramdown by subclassing:
Because we're using Kramdown, we can also now use features like definition lists which make the output between the manpage and the docs site much more consistent with each other. Previously we used bullet point lists and relied on
ronn
doing weirdness where it sometimes interpreted a bullet point list like a definition list without it actually being one (clever, though we want to fix the issue at source anyway).The end result should be that:
Fixes #16861