[petsc-dev] links from manual pages to users manual

Patrick Sanan patrick.sanan at gmail.com
Thu May 27 02:44:58 CDT 2021



> Am 27.05.2021 um 00:24 schrieb Barry Smith <bsmith at petsc.dev>:
> 
> 
> 
>  Jed pointed out previously that ideally we would not just generate a million pages of .rst or markdown but we would have the structure of a manual page as an abstract object on which one could write code to validate, to add new information and to output in a particular .rst or markdown. But the abstract object is what we would use to check that all manual pages have the information they need and suitable seealso: etc. I would think doing this in Python (maybe using parts of a Python front end to LLVM to do the function call parsing?) would make sense but are we really going to have the time to design the object, write a decent parser and write the printers? Sowing doesn't really have the abstract object concept, it is local in that reads in a stream and outputs what it finds almost immediately instead of building a complete intermediate form. With this intermediate form generating Fortran, Python, other language binds should be relatively easy and could handle things like character arguments, function pointer arguments etc better. The intermediate form would know which arguments are optional etc. In a sense this intermediate form could define the PETSc API (for functions, structures, enums, macros,...). 
> 
>  But this sounds a bit PETSc future, we can still improve things with our current infrastructure.

Yes, so I think you're suggesting that we add some more processing of the current man pages, which allows insertion of links to pages in the Sphinx docs.

> 
>  Sorry, I was not clear, all function names, enums etc in the users manual were automatically replaced with a link to the manual page. Can we do that with Spinx, seems like not to much to ask for. 
> 
I think that the standard way to do it with Sphinx involves something like :func:`function_name` which isn't very automatic, so for that reason and because our man pages are generated separately, we currently have our custom plugin which adds the links in code snippets (for HTML only, not in the PDF), using the "htmlmap" generated by the "classic" docs build. My hope is that we could modify the plugin to create the correct internal links, once man pages are better integrated.

> Barry
> 
> 
> 
> 
> 
> 
>> On May 26, 2021, at 11:36 AM, Patrick Sanan <patrick.sanan at gmail.com> wrote:
>> 
>> 
>> 
>>> Am 25.05.2021 um 22:58 schrieb Barry Smith <bsmith at petsc.dev>:
>>> 
>>> 
>>> Now that the users manual is html and we can properly link into it, it would be great to have links from the manual pages to appropriate locations in the users manual. For example SNESSetFunction.html would have a link to the generated Spinx location where SNESSetFunction is discussed.
>>> 
>>> How do we go about doing this? 
>>> 
>>> Not only is this useful for users but when developers are fixing/improving a manual page it would be nice if they had a way to jump directly to the appropriate place in the xxx.rst that that discusses the manual page to check that that material is also up-to-date and correct. So I guess we need a way to link to the correct place in the .rst and the generated .html
>>> 
>> This all depends on which approach we take to make the man pages better integrated. There are competing requirements so I think it'll have to be hashed out to find the correct compromise
>> 
>> - we need to leave things for Sowing to generate Fortran stubs
>> - we want to be able to write the man pages as .rst, like the rest of the Sphinx docs
>> - we want the man pages inline with the source
>> - we don't want to have to manually update all the man pages
>> - we want to avoid introducing brittle scripting, if possible
>> 
>>> 
>>> Thanks
>>> 
>>>  Barry
>>> 
>>> In the old users manual I had it rigged to have a link to the manual page for every occurrence of a word that had a manual page in the users manual. Is that feature lost now? Is there anyway to bring it back?
>>> 
>>> 
>> 
>> This is lost, I think. What sorts of words were these? Once we have links from the man pages to the manual, as above, would it be just as good to directly link to sections of the manual?
> 



More information about the petsc-dev mailing list