Support both dirhtml and regular html builders

ix5 requested to merge (removed):builder-dirhtml into master

Do some querying of where Sphinx would place a document and then wrangle the path information based on the detected builder. Also some special handling for pages ending in /index, which sphinx also treats differently.

(Instead of simply querying self.app.builder.name, and writing out own logic, let sphinx figure out the document path itself.)

Cases:

  1. Using dirhtml builder, source = 'path/source.html'
    -> should return outdir/path/source.html
  2. Using dirhtml builder, source = 'path/source'
    -> should return outdir/path/source/index.html
  3. Using dirhtml builder, source = 'path/source/index.html'
    -> should return outdir/path/source/index.html
  4. Using regular html builder, source = 'path/source'
    -> should return outdir/path/source.html
  5. Using regular html builder, source = 'path/source.html'
    -> should return outdir/path/source.html

Merge request reports