Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-27557

Add copybutton to spark Python API docs for easier copying of code-blocks

    XMLWordPrintableJSON

Details

    Description

      Add a non-intrusive button for python API documentation, which will remove ">>>" prompts and outputs of code - for easier copying of code.

      For example: The below code-snippet in the document is difficult to copy due to ">>>" prompts

      >>> l = [('Alice', 1)]
      >>> spark.createDataFrame(l).collect()
      [Row(_1='Alice', _2=1)]
      

      Becomes this - After the copybutton in the corner of of code-block is pressed - which is easier to copy

      l = [('Alice', 1)]
      spark.createDataFrame(l).collect()
      

      Sample Screenshot for reference: https://screenshots.firefox.com/ZfBXZrpINKdt9QZg/www269.lunapic.com

      This can be easily done only by adding a copybutton.js script in python/docs/_static folder and calling it at setup time from python/docs/conf.py.

      Attachments

        Issue Links

          Activity

            People

              sangramga Sangram G
              sangramga Sangram G
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 0.5h
                  0.5h
                  Remaining:
                  Remaining Estimate - 0.5h
                  0.5h
                  Logged:
                  Time Spent - Not Specified
                  Not Specified