[petsc-dev] Still unable to provide link from manual page into users manual after Sphinx

Barry Smith bsmith at petsc.dev
Thu Aug 25 07:37:32 CDT 2022


  That would be great, thanks. Perhaps I am just not passing the label in the correct format in the .md file, I tried everything I could think of (and everything google suggested), and it either a) left my text untouched, meaning it didn't realize what I was providing was supposed to be a label or b) it complained that the label I provided did not exist. 

  Barry


> On Aug 25, 2022, at 5:56 AM, Lawrence Mitchell <wence at gmx.li> wrote:
> 
> Hi Barry,
> 
> On Sun, 21 Aug 2022 at 20:56, Barry Smith <bsmith at petsc.dev> wrote:
>> 
>> 
>>  To me, one of the best arguments to move to Sphinx was so that manual pages could have links directly into locations in the Users manual. Not possible in practice with a .pdf users manual.
>> 
>>  With the manual in .rst and manual pages generated into .md this still appear to be impossible.
>>    1) when Sphinx is processing .md pages it appears to not know about labels defined in .rst files so  [matrix layout](sec_mat_something) doesn't work
>>    2) Raw, cruder things like [matrix layout](../../manual/mat.html#matrix-and-vector-layouts-and-storage-locations) don't work because it doesn't realize what is inside is a raw URL. I am guessing it needs the http:// at the beginning to realize it is a HTPP url and not a markdown thing.
>>    3) [matrix layout](https://petsc.org/main/docs/manual/mat/#matrix-and-vector-layouts-and-storage-locations) works
>> 
>> but hardwiring it this way is horrible. Could be release, could be (would be most of the time) a strange URL when running inside the CI. Is there a way to start with https::// but be a relative link?
>> figuring the anchor that Sphinx creates from a label (#matrix-and-vector-layouts-and-storage-locations) is super cumbersome.
>> 
> 
> I am pretty sure something close to your option (1) _should_ work, I
> will have a go at the weekend to see if I can figure things out. I
> agree that any of the others are less good.
> 
>>  Is the only good solution to somehow generate .rst files with sowing? How come that wasn't done initially and instead .md files were generated? It seems insanely bad to have this mixture of .md and .rst for a website.
> 
> This should not be necessary: rst and markdown are both frontend
> formats to the parsed restructured text IR that sphinx uses (the
> markdown version goes through one additional conversion step
> internally, but that should not affect things here).
> 
> Lawrence



More information about the petsc-dev mailing list