Code Evaluation
|
This is a MSc Computing group project in Imperial College London – "A literate programming environment for PowerPoint".
Prominent literate programming environments nowadays are Jupyter notebooks, Mathematica, emacs' org-mode, etc. While all of them can produce slides, none of them supports the generation of PowerPoint presentations.
In this project, we aim to build a ppt addin called Code Evaluation
that helps quickly insert code output, such as print and pictures in ppt, and enable command line and table input. This addin also supports shortcut conversion from multiple types to pptx while preserving all fhe features above.
Please refer to published version.
need to install | functionality |
---|---|
g++ | C++ |
JDK | Java |
Python | Python |
Pandoc | conversion to pptx file |
PowerPoint 2016 or later.
Click on a language button to create a codebox. For example, to create a Python codebox, simply click on the Python
button, type in some code (such as print("Hello")
). To execute the code, click the evaluate
button, "Hello" will be shown in a newly inserted textbox.
Currently the addin supports C++, Java and Python. It is worth noting that using C++ and Java requires creating main function and helper functions with different buttons. Before executing main function with multiple helper functions, make sure they are the same language, then choose them all and click evaluate
to get results.
Adding inputs can be easy using the General Inputs
button. After creating a input box, choose it with codeboxes that requires input, click evaluate
to get results.
Graphical output can be triggered using plt.show()
in Python. A plt.show()
will result in a figure inserted in current slide. You can use multiple plt.show()
to insert many images. The addin does not support plt.show()
in loops.
Copy the following Python code in a codebox and try evaluate
it to check the effect.
Use Parameter Table
button to generate a parameter table where you can add any row or column and write data into cells. The first row of the table defaults to the table name, which means that it will not be entered as an argument. It would help if you replaced the table name with the appropriate place in the code block to ensure it doesn't go wrong.
You can then select a parameter table and click the Plot Template
button to generate a block of Python code. Using it, you can draw a simple scatter plot (based on the data in the table).
User can firstly use pandoc to convert Markdown file to PowerPoint file. In order to make addin detect certain language type, the users need to add specific tags for different language codebox (@code_python for python, @code_java_main & @code_java for Java, @code_cpp_main & @code_cpp for C++). For example, python code should be marked like this in md files.
Then users can use Reformat
button to remove all existing tags(users can also run code without reformating). After clicking the reformat button, users can run code by clicking evaluation button.
For full documentation for the PowerPoint add-in, please go to https://luowx0905.github.io/CodeEvaluation_doc/index.html
Geekppt is released under the MIT License. https://opensource.org/licenses/MIT