Skip to content

Draft: DPPT-613: Fix copybutton in documentation

Mark Ashdown requested to merge dppt-613-fix-copybutton into master

Fix the configuration of the sphinx-copybutton extension in the documentation. It is now configured to ignore prompts and outputs in the code blocks, and only copy the inputs. This should make it more useful to any user of the documentation.

The prompt for ITango code has been configured manually. It is possible to install the IPython package to add syntax highlighting and configure the prompts automatically, but that has two drawbacks. First, it has many dependencies which results in a large installation. Second, it does not produce the correct results with copybutton (it ignores outputs except for the output prompt Out[...]).

ITango code with multiple inputs has been broken up into one code block per input to make it easier to execute the commands one-by-one and check the outputs are as expected.

There are a some problems (also described in comments):

  • Installation > Installing the SDP

    • The code block with three --sets is copied as blank lines.

    • Kubernetes log output after the # is copied as if it were input. Copybutton seems to be mistaking it for a prompt.

  • Operation > Interacting with the SDP > Accessing the Tango interface

    • Only the first line of the ReleaseResources code block is copied.
  • Operation > Interacting with the SDP > Connecting to the configuration DB

    • ska-sdp command output is copied as blank lines.
  • Development > Automated integration tests

    • I have added a prompt before the commands to make this page consistent with the rest of the documentation, but it doesn't work with copybutton because the source is Markdown (in tests/README.md). This content could be moved into the main documentation as RST.

Read the Docs output: https://developer.skao.int/projects/ska-sdp-integration/en/dppt-613-fix-copybutton/

Edited by Mark Ashdown

Merge request reports