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

Add support for MarkDown headings formatted as "COMMAND(1) ..." #65

Closed
wants to merge 2 commits into from

Conversation

thaJeztah
Copy link
Collaborator

@thaJeztah
Copy link
Collaborator Author

ping @cpuguy83 @tianon PTAL

@thaJeztah
Copy link
Collaborator Author

hm, actually, more may be needed for cobra, as I think it's using % COMMAND(1) (so not a heading)

@thaJeztah thaJeztah force-pushed the fix_headers branch 2 times, most recently from 1302d74 to b20a5ed Compare October 19, 2020 10:33
Comment on lines +336 to +374
extensions := params.extensions
if extensions == 0 {
extensions = renderer.extensions
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, after digging why it didn't work with the % xxx pandoc headers, this seemed to be the problem; the tests were running without the blackfriday.Titleblock extension enabled, so blackfriday was not converting them to H1 blocks.

@thaJeztah
Copy link
Collaborator Author

@cpuguy83 @tianon this should be ready to go now. I noticed that v1 would convert this input;

% DOCKER(1) Docker User Manuals
% Docker Community
% JUNE 2014

To:

.TH "DOCKER" "1" " Docker User Manuals" "Docker Community" "JUNE 2014"
.nh
.ad l

And v2 (with this change applied) converts it to:

.nh
.TH DOCKER 1 Docker User Manuals
Docker Community
JUNE 2014

As a result, the words were split, and didn't show up correctly when viewing the man page;

With V1:

man ./v1.1

DOCKER(1)                                                                              JUNE 2014                                                                              DOCKER(1)

Docker Community                                                                   Docker User Manuals                                                                        DOCKER(1)

With V2:

man ./v2.1

DOCKER(1)                                                                               Manuals                                                                               DOCKER(1)

Docker Community JUNE 2014

User                                                                                     Docker                                                                               DOCKER(1)

I pushed another commit to remove newlines, and to quote each line. It's a bit ugly, so better suggestions welcome

@thaJeztah thaJeztah force-pushed the fix_headers branch 6 times, most recently from 3fea185 to 21c4566 Compare October 19, 2020 13:38
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@cpuguy83
Copy link
Owner

Is this still needed?

@cpuguy83
Copy link
Owner

@thaJeztah ?

@thaJeztah
Copy link
Collaborator Author

I guess with the fix in Cobra, it's no longer needed; let me close this one (I'll keep the branch for now, in case we find we still need it)

@thaJeztah thaJeztah closed this Jul 13, 2021
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.

None yet

2 participants