sangramga opened a new pull request #24456: [SPARK-27557][DOC] Add copy button 
to Python API docs for easier copying of code-blocks
URL: https://github.com/apache/spark/pull/24456
 
 
   ## What changes were proposed in this pull request?
   
   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()
   ```
   
   
![image](https://user-images.githubusercontent.com/9406431/56715817-560c3600-6756-11e9-8bae-58a3d2d57df3.png)
   
   ## File changes
   Made changes to python/docs/conf.py and copybutton.js - thus only modifying 
sphinx frontend and no changes were made to the documentation itself- Build 
process for documentation remains the same.
   
   copybutton.js -> This JS snippet was taken from the official python.org 
documentation site. 
   
   ## How was this patch tested?
   NA
   
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to