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

Barry Smith bsmith at petsc.dev
Wed May 26 17:24:40 CDT 2021



  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.

  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. 

 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