You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My markdown documents have their own NAME sections, because I want them to look mostly like manpages before I do any processing on them. ronn adds another NAME section, even though one already exists.
Testing file:
# Test #
## NAME ##
test - the test manpage
## DESCRIPTION ##
Testing items. w00t!
TESTING(9) Testing manual TESTING(9)
NAME
Testing - Test
NAME
test - the test manpage
DESCRIPTION
Testing items. w00t!
Testers, Inc. August 2019 TESTING(9)
It looks like there's some logic in Ronn::Document to handle the various ways in which the document name can enter the processing, but they seem to assume that they should always add a NAME section. If I move the contents of my NAME section into the top header in the Markdown document, and drop the --name command line flag, ronn will format the resulting manpages correctly, but I lose the manpage format - specifically the NAME section - that I want in the original Markdown documents.
The text was updated successfully, but these errors were encountered:
Coincidentally, another user just emailed me about this last week.
I think we probably need a --no-name option to suppress automatic NAME section generation for cases like this. And maybe more probing for the existence of an explicit NAME section in the input.
The ideal situation would be if ronn was able to notice whether the section was there or not, and add it if necessary. As I was exploring the ronn source, that's what I had in mind, but was never able to find how that new NAME section got injected into the document source.
I've recently picked this back up and did some more hacking, and I think I've got the fix. I went in the direction of having ronn be able to figure things out on its own, rather than requiring any new command-line arguments. The Ronn::Document::sniff method gets some expansion, and then there's some small tweakage to Ronn::Document::html_filter_inject_name_section.
I need to add a unit test for the name injection method, and then I'll have a PR for you to look at.
My markdown documents have their own
NAME
sections, because I want them to look mostly like manpages before I do any processing on them. ronn adds anotherNAME
section, even though one already exists.Testing file:
ronn invocation:
Manual output:
It looks like there's some logic in
Ronn::Document
to handle the various ways in which the document name can enter the processing, but they seem to assume that they should always add aNAME
section. If I move the contents of myNAME
section into the top header in the Markdown document, and drop the--name
command line flag,ronn
will format the resulting manpages correctly, but I lose the manpage format - specifically theNAME
section - that I want in the original Markdown documents.The text was updated successfully, but these errors were encountered: