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

verify that a manpage doc is valid #529

Closed
xcoulon opened this issue Apr 5, 2020 · 0 comments · Fixed by #545
Closed

verify that a manpage doc is valid #529

xcoulon opened this issue Apr 5, 2020 · 0 comments · Fixed by #545
Assignees
Milestone

Comments

@xcoulon
Copy link
Member

xcoulon commented Apr 5, 2020

if a document has a doctype=manpage attribute, we should verify that it conforms to the following rules:

Document Header

A man page document header is mandatory. The title line contains the man page name followed immediately by the manual section number in round brackets. The title name should not contain white space. The manual section number is a single digit optionally followed by a single character.
The NAME Section

The first man page section is mandatory, must be titled “NAME” and must contain a single paragraph (usually a single line) consisting of a list of one or more comma separated command name(s) separated from the command purpose by a dash character. The dash must have at least one white space character on either side.
The SYNOPSIS Section

The second man page section is mandatory and must be titled “SYNOPSIS”.

Subsequent sections are optional, but typical sections include “SEE ALSO”, “BUGS REPORTS”, “AUTHORS” and “COPYRIGHT”.

See https://asciidoctor.org/docs/user-manual/#man-pages

If the document does not compy, it should be rendered as a regular article (ie, default rendering templates) and an ERROR should be raised in the console.

@xcoulon xcoulon added this to the v0.4.0 milestone Apr 5, 2020
@xcoulon xcoulon self-assigned this Apr 5, 2020
xcoulon added a commit to xcoulon/libasciidoc that referenced this issue Apr 19, 2020
Add a new `pkg/validator` package which validates
the given document, reports problems and in the case
of a `manpage` document, changes the doctype to `article`
if a problem was found.

Fixes bytesparadise#529

Signed-off-by: Xavier Coulon <[email protected]>
xcoulon added a commit that referenced this issue Apr 19, 2020
Add a new `pkg/validator` package which validates
the given document, reports problems and in the case
of a `manpage` document, changes the doctype to `article`
if a problem was found.

Fixes #529

Signed-off-by: Xavier Coulon <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant