Metadata-Version: 2.4
Name: thonny-pseudocode
Version: 0.1.6
Summary: A Thonny plugin that generates inline pseudocode explaining the Python source code line-by-line.
Author-email: Raja Soufi <rjsoufi@gmail.com>
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: POSIX :: Linux
Classifier: Operating System :: MacOS :: MacOS X
Classifier: Operating System :: Microsoft :: Windows
Classifier: Environment :: Plugins
Classifier: Topic :: Education
Classifier: Intended Audience :: Education
Classifier: Topic :: Text Editors
Classifier: Topic :: Text Editors :: Integrated Development Environments (IDE)
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: thonny>=4.1.0
Dynamic: license-file


# thonny-pseudocode

[![Publish to PyPI](https://github.com/raja-s/thonny-pseudocode/actions/workflows/publish.yml/badge.svg)](https://github.com/raja-s/thonny-pseudocode/actions/workflows/publish.yml)

A [Thonny](https://thonny.org/) plug-in that generates inline pseudocode on-demand, explaining the Python source code line-by-line, powered by the [PyToPseu project](https://github.com/jppellet/PyToPseu).

The plug-in currently supports generating pseudocode in English and French (depending on the UI language set by the user in Thonny's settings).

Table of contents:<br/>
[Installation](#installation)<br/>
[User Guide](#user-guide)<br/>
[Limitations](#limitations)

## Installation

Inside Thonny, click on `Tools` > `Manage plug-ins...` to open the plug-ins dialog.
Search for the "thonny-pseudocode" package and install it.
**Make sure your installed version is at least 0.1.3.**

Once installed, restart Thonny to load the plug-in.

## User Guide

You can generate pseudocode with the plug-in's "Explain with pseudocode" command. There are 3 ways to trigger the command:

1) From the menu:

![Generating the pseudocode from the menu](https://github.com/raja-s/thonny-pseudocode/blob/main/demos/trigger_menu-item.gif?raw=true)

2) From the toolbar:

![Generating the pseudocode from the toolbar](https://github.com/raja-s/thonny-pseudocode/blob/main/demos/trigger_toolbar-item.gif?raw=true)

3) Using the Ctrl+E/Cmd+E hotkey:

![Generating the pseudocode using the hotkey](https://github.com/raja-s/thonny-pseudocode/blob/main/demos/trigger_hotkey.gif?raw=true)

Once generated, the command may be used again to erase the generated pseudocode:

> Note: When the plug-in erases generated pseudocode, it will systematically remove all trailing whitespaces on all lines.

![Erasing the pseudocode](https://github.com/raja-s/thonny-pseudocode/blob/main/demos/generate-erase.gif?raw=true)

Since the generated pseudocode is actually appended to the source code in the form of comments (preserving the developer's own comments), the developer may continue to edit the code afterwards.
Using the command again on edited code will immediately regenerate pseudocode for the new code.
As soon as the command is used a second time on a particular piece of code, the plug-in will erase the generated pseudocode.

![Erasing the pseudocode](https://github.com/raja-s/thonny-pseudocode/blob/main/demos/generate-regenerate-erase.gif?raw=true)

## Limitations

The plug-in currently has the following limitations:
- It cannot generate pseudocode for code with the slightest syntax error
- It may insert new-lines in the source code to have enough space for the pseudocode, but will not remove those new-lines when it erases the generated pseudocode
- Generated pseudocode goes into (and "pollutes") the editing history, which means that erasing pseudocode then undoing the last change will bring back the pseudocode
