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

DocBook manpage improvements #1142

Closed
wants to merge 3 commits into from

Conversation

bk2204
Copy link
Contributor

@bk2204 bk2204 commented Oct 11, 2014

The DocBook code for generating manpages contained a few bugs. Probably for historical reasons, DocBook requires manpages (refentry documents) to use refsection instead of section (and refsect1 instead of sect1, etc.). Also, the block element holding the synopsis section should be refsynopsisdiv.

Finally, man pages require some additional metadata in the refmeta and refnamediv elements immediately after the main document's info block. Without these, the DocBook stylesheets won't be able to determine the manpage name and section, and will try to output to a file called .1.

This is the minimal amount of changes required on the Asciidoctor side to build Git using Asciidoctor instead of AsciiDoc. I will be sending a patch series to the Git list to fix up the Git side of things.

Generating a manpage from Asciidoctor's DocBook output requires the
refentrytitle, manvolnum, refname, and refpurpose elements to be present
to work correctly.
In DocBook, the proper tag for the synopsis section of a manpage is
"refsynopsisdiv".
@mojavelinux
Copy link
Member

Merged as b71c342.

I made a few minor changes.

  • We never use the <sectN> tags, so we didn't need special logic to match those
  • Slightly optimized the output of manpage header
  • Used manname instead of mantitle attribute for value of <refname> attribute

Thanks! I checked the output using fopub and it looks great!

@mojavelinux
Copy link
Member

Probably for historical reasons

Definitely for historical reasons :)

@mojavelinux
Copy link
Member

Actually, you can see that we're still missing compatibility with AsciiDoc Python in this area. I probably didn't complete it because it wasn't a priority at the time, but if Asciidoctor is going to be used to generate output for the git man pages, then it obviously becomes a priority :)

https://github.com/asciidoc/asciidoc/blob/master/docbook45.conf#L620

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants