Skip to content

Conversation

@levitte
Copy link
Member

@levitte levitte commented Sep 28, 2019

Details from man-pages(7) that are used:

Formatting conventions for manual pages describing functions

    ...
    Variable names should, like argument names, be specified in italics.
    ...

Formatting conventions (general)

    ...
    Special macros, which are usually in uppercase, are in bold.
    Exception: don't boldface NULL.
    ...

Furthermore, for TYPE used as a placeholder for types and correponding
part of function names, we extrapolate that it's both a type and a
variable, and should therefore be bold (typical for types and function
names) and italic (typical for variables). POD processors don'e know
this, so we have to help them along. Therefore:

SPARSE_ARRAY_OF(TYPE)        => B<SPARSE_ARRAY_OF>(B<I<TYPE>>)
ossl_sa_TYPE_num()           => B<ossl_sa_I<TYPE>_num>()
TYPE                         => B<I<TYPE>>

There are some other less typical uses where one simply has to give
formatting some extra though.

Details from man-pages(7) that are used:

    Formatting conventions for manual pages describing functions

        ...
        Variable names should, like argument names, be specified in italics.
        ...

    Formatting conventions (general)

        ...
        Special macros, which are usually in uppercase, are in bold.
        Exception: don't boldface NULL.
        ...

Furthermore, for TYPE used as a placeholder for types and correponding
part of function names, we extrapolate that it's both a type and a
variable, and should therefore be bold (typical for types and function
names) and italic (typical for variables).  POD processors don'e know
this, so we have to help them along.  Therefore:

   SPARSE_ARRAY_OF(TYPE)        => B<SPARSE_ARRAY_OF>(B<I<TYPE>>)
   ossl_sa_TYPE_num()           => B<ossl_sa_I<TYPE>_num>()
   TYPE                         => B<I<TYPE>>

There are some other less typical uses where one simply has to give
formatting some extra though.
@levitte levitte added the branch: master Applies to master branch label Sep 28, 2019
@richsalz
Copy link
Contributor

Oh man, the construct of B<xxx<I<TYPE>xxx> is going to break #10022. Do we have to nest them? Can we do B<xxx>I<TYPE>B<xxx> ?

It's also going to be confusing for developers who will backslide and start doing it for command flags, which took a lot of pain in #10022 to get right.

I think flags and parameters are more important than the half-dozen manpages that use the TYPE convension.

@levitte
Copy link
Member Author

levitte commented Sep 28, 2019

Why do you mix up command line parameters (man1 pages) with function names (man3 and man7 pages)?

Also, your idea breaks another detail from man-page(7):

Formatting conventions for manual pages describing functions
    ...
    Any reference to the subject of the current manual page should be
    written with the name in bold followed by a pair of parentheses in
    Roman (normal) font. ...

I only expand a little bit on that by making the variable part of the subject (i.e. the functions being described) italic as well, not instead of. Please read the commit message, where I'm describing by my reasoning.

@levitte
Copy link
Member Author

levitte commented Sep 28, 2019

Now... if you need help figuring out regexps, all you have to do is ask.

@levitte
Copy link
Member Author

levitte commented Sep 30, 2019

I think we need to talk about the TYPE controversy, I'd like to know what's your actual beef with formatting it the way I've done.

See, there are two man-page conventions that are getting my attention here. One is about the name of the man-page subject, which actually says the same thing about commands and its options (applicable to man1) as well as for function names (man3) [italics mine for emphasis]:

Formatting conventions for manual pages describing commands
For manual pages that describe a command (typically in Sections 1 and 8), the arguments are always specified using italics, even in the SYNOPSIS section.

The name of the command, and its options, should always be formatted in bold.

Formatting conventions for manual pages describing functions
...
Variable names should, like argument names, be specified in italics.

Any reference to the subject of the current manual page should be written with the name in bold followed by a pair of parentheses in Roman (normal) font.

However, we have things in our manual pages that are... unusual in the man-page world, such as variable options (-cipher) and function name specs with a variable part (i2d_TYPE or BIO_s_*). The convention is clear, since they are command options and function names, they should be bold, giving -cipher and i2d_TYPE or BIO_s_*. Fine according to the conventions, and yet not, because while we're making options and function names bold, this leads people to think that those should be used literally. We need a way to add to the convention while following it, and that's where making the variable part italic as well comes in.

-cipher (on terminals, the italic part is often underlined instead)
i2d_TYPE

The counter proposal is to make them only italics:

-cipher (on terminals, the italic part is often underlined instead)
i2d_TYPE

To me, that makes them not part of the name, but, er, something else, and it completely breaks the convention of having command options and function names / man-page subject in bold (do note that the conventions do not say only bold).

Comments?

@richsalz
Copy link
Contributor

richsalz commented Sep 30, 2019

There are a number of issues here:

1 Typography and display
2 End-user (the "reader") clarity
3 Tooling

There are probably others (such as ego since I created the "TYPE" pages :).

We treat these things with different importance, and we end up coming to two different conclusions.

Oh well.

@levitte
Copy link
Member Author

levitte commented Sep 30, 2019

I would say that 1 and 2 can be treated as one and the same, because the intention with the conventions with man-pages(7) as well as my proposal is better clarity.

Re tooling, I would say tooling should adapt to what we decide is the best display of the manual, not the other way around. So at least in my mind, it has lower priority as a deciding factor.

@richsalz
Copy link
Contributor

Yes, we disagree about the relative importance of (at least) those issues.

Copy link
Member

@mattcaswell mattcaswell left a comment

Choose a reason for hiding this comment

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

This looks fine to me.

@mattcaswell mattcaswell added the approval: done This pull request has the required number of approvals label Oct 1, 2019
levitte added a commit that referenced this pull request Oct 1, 2019
Details from man-pages(7) that are used:

    Formatting conventions for manual pages describing functions

        ...
        Variable names should, like argument names, be specified in italics.
        ...

    Formatting conventions (general)

        ...
        Special macros, which are usually in uppercase, are in bold.
        Exception: don't boldface NULL.
        ...

Furthermore, for TYPE used as a placeholder for types and correponding
part of function names, we extrapolate that it's both a type and a
variable, and should therefore be bold (typical for types and function
names) and italic (typical for variables).  POD processors don'e know
this, so we have to help them along.  Therefore:

   SPARSE_ARRAY_OF(TYPE)        => B<SPARSE_ARRAY_OF>(B<I<TYPE>>)
   ossl_sa_TYPE_num()           => B<ossl_sa_I<TYPE>_num>()
   TYPE                         => B<I<TYPE>>

There are some other less typical uses where one simply has to give
formatting some extra though.

Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from #10041)
@levitte
Copy link
Member Author

levitte commented Oct 1, 2019

Merged.

bbecf04 Make manuals with TYPE conform with man-pages(7)

@levitte levitte closed this Oct 1, 2019
@levitte
Copy link
Member Author

levitte commented Oct 1, 2019

Like I suspected, util/find-doc-nits isn't entirely happy with this. I guess I have some fixing to do...

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

Labels

approval: done This pull request has the required number of approvals branch: master Applies to master branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants