Hi Carl,

On Tue, 7 May 2024 09:24:33 -0700 (PDT), Carl Gay wrote:

> Hi Stefano, thanks for the reply. If I understand your solution
> correctly, it requires duplicating the toctree for each distinct URL.
> What I want is that if any member of the team builds/runs the site on
> their local machine the URL will be correct for their machine.
> Specifically, if I access the site as https://localhost:8001/ then the
> link should take me to https://localhost:8001/books/drm/ and if I access
> the live site as https://opendylan.org/ the link should take me to
> https://opendylan.org/books/drm/.
Well, then I think I got it right. If the "problem" is that every 
developer has its own setup, you could just put the index.rst 
in .gitignore, so the official doc features the opendylan URL and 
everyone 
can test it locally with its preferred URL.
 
I just thought of another possibility, perhaps more maintainable: instead 
of changing the URL in the toctree, you replace the toctree line 

Dylan Reference Manual <https://opendylan.org/books/drm/>

with the name of an actual file (let's call it drm.rst)

with the content of that file being

========================
 Dylan Reference Manual
========================
   
.. raw:: html

   <html>
     <head>
       <meta http-equiv="refresh" content="0; url=http://localhost:8020/
books/drm">
     </head>
     <body>
     </body>
   </html>

(in the 'official' documentation you have url=https://opendylan.org/books/
drm/) 

In this way the effect is exactly the same of having the URL in the 
toctree, but every developer can change the file at will (again, putting 
the drm.rst file in .gitignore allows on the one side every developer to 
change it at will and on the other one prevents pushing it by mistake).

HTH,
Stefano


-- 
You received this message because you are subscribed to the Google Groups 
"sphinx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sphinx-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sphinx-users/v1f59m%24fuo%241%40ciao.gmane.io.

Reply via email to