Rewrite logic - can it exist within Sphinx or should it never happen at the Sphinx level? #11922
-
pigweed.dev has a need for some basic rewrite logic. E.g. docname |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
I would say "no" to be on the safe side. If you want to rename how your files are being served, that's something you should likely do at the server-level but not at the generation level. One reason is that if you change the docname, then you need to update all related references. Also, since Sphinx runs in two steps, where in the first you build and the second you write, there should be a consistency between these two, namely you should also remember the association. Also, I don't exactly remember but I think the writing phase uses the docnames that were used by the building phase to write things on the disk. Can you give me an example of why you would want this rewrite logic? |
Beta Was this translation helpful? Give feedback.
-
Thank you. I figured it wasn't a good idea. We don't need this approach; we're just exploring all our options and I wanted to make sure this wasn't one of them. Regarding use cases:
The first and last ones we might be able to handle at build-time. Pretty sure the middle one has to be handled server-side. |
Beta Was this translation helpful? Give feedback.
I would say "no" to be on the safe side. If you want to rename how your files are being served, that's something you should likely do at the server-level but not at the generation level.
One reason is that if you change the docname, then you need to update all related references. Also, since Sphinx runs in two steps, where in the first you build and the second you write, there should be a consistency between these two, namely you should also remember the association. Also, I don't exactly remember but I think the writing phase uses the docnames that were used by the building phase to write things on the disk.
Can you give me an example of why you would want this rewrite logic?