Skip to content

Beautification of rst documentation #11367

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

Merged
merged 13 commits into from
Feb 3, 2023

Conversation

zerothi
Copy link
Contributor

@zerothi zerothi commented Feb 1, 2023

Listified the elements and ensured links were
properly set.

This will close #11340 (eventually)

Signed-off-by: Nick Papior nickpapior@gmail.com

@ompiteam-bot
Copy link

Can one of the admins verify this patch?

Copy link
Member

@jsquyres jsquyres left a comment

Choose a reason for hiding this comment

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

I think you can squash the 2nd commit into the 1st commit.

:ref:`MPI_Put` :ref:`MPI_Get_accumulate` :ref:`MPI_Reduce`
* :ref:`MPI_Put`
* :ref:`MPI_Get_accumulate`
* :ref:`MPI_Reduce`
Copy link
Member

Choose a reason for hiding this comment

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

In list-ifying all the See Also's, I don't think I have a strong opinion, but I do have an opinion. 😄

We took our cue from other Linux and MacOS man pages on how to do the See Also's. For example, man ls in MacOS 13.1:

Screenshot 2023-02-01 at 12 13 41 PM

And if I man uptime on Ubuntu 22.04:

Screenshot 2023-02-01 at 12 14 15 PM

Meaning: if we want to keep with conventions of other man pages, we should probably add commas to our list of man pages, not bullets.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I partially agree ;)

The man-page comma-separated links might be good for a terminal view, but definitely not for a HTML page view. The links gets bunched together. I think this should be fixed via some other means, e.g. by some customization of the conf.py file. I'll have a look whether this could be done.

@zerothi zerothi force-pushed the 11340-doc-beautification branch from 48cfa42 to 83618ad Compare February 1, 2023 20:22
@zerothi
Copy link
Contributor Author

zerothi commented Feb 1, 2023

I am thinking about changing the error block to something like this:

errors-min

would this be an acceptable change?
The specific change involves compressing the two lists into 1 list to show their coherence. My argument would mainly be to reduce the length of the ERROR section.

@zerothi zerothi force-pushed the 11340-doc-beautification branch from e9d79f9 to 201733d Compare February 2, 2023 07:40
@zerothi
Copy link
Contributor Author

zerothi commented Feb 2, 2023

@jsquyres I believe a first merge would be appropriate?
Only need feedback not he ERROR change I proposed?

@jsquyres
Copy link
Member

jsquyres commented Feb 2, 2023

I'm good with your ERRORS change/combination of 2 lists.

You have a minor RST error that CI found:

/home/ubuntu/workspace/pen-mpi.pull_request-v2_PR-11367/docs/man-openmpi/man3/MPI_Pack.3.rst:93: WARNING: Could not lex literal_block as "c". Highlighting skipped.

@zerothi
Copy link
Contributor Author

zerothi commented Feb 2, 2023

I'm good with your ERRORS change/combination of 2 lists.

You have a minor RST error that CI found:

/home/ubuntu/workspace/pen-mpi.pull_request-v2_PR-11367/docs/man-openmpi/man3/MPI_Pack.3.rst:93: WARNING: Could not lex literal_block as "c". Highlighting skipped.

I'll check!

@zerothi
Copy link
Contributor Author

zerothi commented Feb 2, 2023

I didn't get why the MPI_Pack was doing erroneous things, lets see if this small amendment fixes it.
I looked at https://readthedocs.org/api/v2/build/19354327.txt and couldn't find the warning you mentioned?

@jsquyres
Copy link
Member

jsquyres commented Feb 2, 2023

I didn't get why the MPI_Pack was doing erroneous things, lets see if this small amendment fixes it. I looked at https://readthedocs.org/api/v2/build/19354327.txt and couldn't find the warning you mentioned?

It was in https://jenkins.open-mpi.org/jenkins/job/open-mpi.pull_request-v2/job/PR-11367/7/console -- one of the other CI tests (I think it was the make dist test on the overall continuous-integration/jenkins/pr-head CI test). It takes (much) longer than the RTD CI -- the red "X" showed up much later than the RTD CI test green checkmark.

Listified the elements and ensured links were
properly set.

Signed-off-by: Nick Papior <nickpapior@gmail.com>
Signed-off-by: Nick Papior <nickpapior@gmail.com>
Direct links to papers should preferably be done
using DOI links. Publishers may (at will) change
their URLs but they *will* obey doi.org/<doi>
links meaning that links to published articles
with DOI's will always be stable using:
doi.org/<doi> links.

I uncovered this link by doing make linkcheck
which caused problems for the changed link
(in feature/ulmf).

Signed-off-by: Nick Papior <nickpapior@gmail.com>
Basically all files have had a go to be updated
and beautified, too many to list here.

Signed-off-by: Nick Papior <nickpapior@gmail.com>
Signed-off-by: Nick Papior <nickpapior@gmail.com>
Signed-off-by: Nick Papior <nickpapior@gmail.com>
Also removed mentioning of some C++ bindings. It seemed
weird to only have them in the *create_errhandler documents,
hence removed.

Signed-off-by: Nick Papior <nickpapior@gmail.com>
These changes also revealed some typos
and we fixed lots of links and codes that
were present.

Signed-off-by: Nick Papior <nickpapior@gmail.com>
Signed-off-by: Nick Papior <nickpapior@gmail.com>
Signed-off-by: Nick Papior <nickpapior@gmail.com>
Signed-off-by: Nick Papior <nickpapior@gmail.com>
Signed-off-by: Nick Papior <nickpapior@gmail.com>
Signed-off-by: Nick Papior <nickpapior@gmail.com>
@jsquyres jsquyres force-pushed the 11340-doc-beautification branch from 6fe5a58 to c5fdcc0 Compare February 2, 2023 19:11
@jsquyres
Copy link
Member

jsquyres commented Feb 2, 2023

I tweaked / fixed some other typos in the example in the MPI_Pack.3.rst commit.

@zerothi
Copy link
Contributor Author

zerothi commented Feb 2, 2023

I have tried to figure out the man-page stuff... But I must admit the documentation for sphinx/docutils is not wrapping my head...

I think this will deserve a second go later.

Here would be a base-plan on how to use it:

This should just be placed at the bottom of the conf.py file, and then one would be able to do

Please read the documentation about :man3:`MPI_Init` ...

Here:

def man_role(name, rawtext, text, lineno, inliner, options={}, content=[]):
    """ This does not work yet!

    A work in progress, this is mainly to indicate what we intent to do
    for man-page references.

    Adding multiple arguments to inline roles in Sphinx is not ideal.

    Instead it would be better to have roles as:

    :man3:`MPI_Init`

    which would result in MPI_Init(3) in the man-page, but a regular
    link in the web-page.

    It should be able to handle:
   
    :man3:`custom title <MPI_Init>` and result in custom title (omitting (3)).
    """
    
    # The man<> name can get the number
    n = name[3]

    if '<' in text:
        # there must be a space:
        #  :manX:`MPI_toahe <MPI_Init>`
        ref_text, link = text.split("<", 1)
        ref_text = ref_text[:-1] # remove end space
        link = link[:-1] # remove end >
    else:
        ref_text = f"{text}({n})"
        link = text

    # lower-case the link
    link = link.lower()

    raise NotImplementedError(f"still no :{name}: role... please hold!")


def setup(app):
    app.add_role("man1", man_role)
    app.add_role("man3", man_role)
    app.add_role("man5", man_role)

@zerothi zerothi marked this pull request as ready for review February 2, 2023 20:20
@zerothi zerothi changed the title WIP: Beautification of rst documentation Beautification of rst documentation Feb 2, 2023
@jsquyres jsquyres merged commit d5f9e2e into open-mpi:main Feb 3, 2023
@jsquyres
Copy link
Member

jsquyres commented Feb 3, 2023

@zerothi Now that this has merged on main, can you make a cherry-pick PR to bring all of these commits to the v5.0.x branch? See the bits about cherry picking in https://docs.open-mpi.org/en/v5.0.x/developers/git-github.html#git-branch-scheme.

@jsquyres
Copy link
Member

jsquyres commented Feb 6, 2023

When you cherry-pick these commits to v5.0.x, please include 3515978, which fixes a problem that showed up in our nightly testing (not sure why it didn't show in the PR CI).

@zerothi
Copy link
Contributor Author

zerothi commented Feb 6, 2023

I'll have a look end of this week!

@zerothi zerothi deleted the 11340-doc-beautification branch February 28, 2023 07:00
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.

Documentation beautification on the rst pages
3 participants