Holzhaus / sphinx-multiversion

Sphinx extension for building self-hosted versioned docs.
https://holzhaus.github.io/sphinx-multiversion/
BSD 2-Clause "Simplified" License
148 stars 65 forks source link

Adding `dirhtml` build mode support #85

Open raddessi opened 2 years ago

raddessi commented 2 years ago

Hi, thank you for all the work on this extension! It works beautifully.

I would like to add support for dirhtml build mode but want to confirm with you what approach you would like to use before sending up a PR.

Current experience

I like dirhtml builds because they provide cleaner URLs. I can specify -b dirhtml on the command line and that argument is passed along to sphinx correctly, but the pages and links generated by sphinx-multiversion still use the file-based urls.

Desired experience

I would like it if when -b dirhtml is passed on the CLI, the links and filesystem layout generated by sphinx-multiversion would match that of the sphinx-generated docs.

Proposed changes

I think that there are probably a few options.. an argument could be added to this project to mirror the upstream argument and then the value could be passed down, or we could just inspect the unparsed arguments and look for any -b <something> and match there. I think the first option is probably better but I will leave the design choices up to you. There also may be a better method :) Thoughts?

For reference only, this is an issue I noticed when working on https://github.com/pradyunsg/furo/issues/372