OpenNTI / sphinxcontrib-programoutput

Sphinx extension for capturing program output
BSD 3-Clause "New" or "Revised" License
38 stars 18 forks source link

Add caption and name options to output blocks #41

Closed Madricas closed 4 years ago

Madricas commented 4 years ago

I would like to be able to caption and reference program-output and command-output block like literalinclude directives.

As such, this PR is heavily inspired from what is already done for literalinclude. It adds the :name: option to be able to reference the output block from elsewhere, and the :caption: option to set a caption to the output block.

Thanks in advance for looking at it.

jamadden commented 4 years ago

Thanks for this PR! I don’t see any reason not to add this functionality.

This is a great start. The PR will need a few things before it can be merged:

Let me know if I can assist with any of those things.

Madricas commented 4 years ago

Hi!

I have documented the options in the manual and added a note in the CHANGES.rst. I have also added some tests which required to modify a bit the TestDirective's method assert_output.

The linter detects an error in the src/sphinxcontrib/programoutput/tests/__init__.py for Python3. I did not modify this file, so was this an existing issue ?

I let you review the code and make any modification. Thanks.

jamadden commented 4 years ago

so was this an existing issue ?

Yes, an update to pylint added a new warning. I've taken care of it.

Thanks!