I have this folder structure for generating docs (html) in sphinx:
doc-root - static (custom.css, custom.js) - doc-1 (*.rst) - doc-2 (*.rst) - doc-3 (*.rst) conf.py index.rst (toctree for doc-1, doc-2 and doc-3) I'm generating htmls and want to add the custom.js as a script tag only for doc-2.
I tried adding the app.add_javascript('custom.js') in the setup(app) of root conf.py, but sphinx adds the custom.js to all generated htmls.
I added a doc-1/conf.py and added the setup(app), but it never gets called, because I am generating htmls from the root directory using -c option from the root.
Is there a way to achieve this, by making sphinx respect conf.py from its subfolders or by providing logic in the root conf.py?