Skip to content

Add more functionality to sphinx extensions and cleanup

Victor Negîrneac requested to merge nbjs into develop

Explanation of changes

@AdriaanRol follow up from !220 (merged)

Sometimes it is useful to generate rst contents in one dir but we want it to be evaluated in another .rst file and for that the file will require an extension that sphinx ignores e.g. .txt. A simple way to achieve this with out extension is to support input files with extensions .rst.*.py, e.g., .rst.txt.py that get converted into .rst.txt.

This MR implements this in the sphinx extensions and applies this to the .rst.txt files that are being used as examples in docstrings. Beside that, the sphinx extension docstring was update to give a tip on this use-case.


Merge checklist

See also merge request guidelines

  • Merge request has been reviewed and approved by a project maintainer.
  • Merge request contains a clear description of the proposed changes and the issue it addresses.
  • Merge request made onto appropriate branch (develop for most MRs).
  • New code is fully tested.
  • New code is documented and docstrings use numpydoc format.
  • CHANGELOG.rst and AUTHORS.rst have been updated (when applicable).
  • CI pipelines pass
    • black code-formatting passes (gitlab-ci),
    • test suite passes (gitlab-ci),
    • no degradation in code-coverage (codacy),
    • no (serious) new pylint code quality issues introduced (codacy),
    • documentation builds successfully (CI and readthedocs),
    • windows tests pass (manually triggered by maintainers before merging).

For reference, the issues workflow is described in the contribution guidelines.

Edited by Victor Negîrneac

Merge request reports